Created
May 27, 2019 20:23
-
-
Save ajitesh123/3d8bd5fe87eabf29eec3ef922e439151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import pyLDAvis\n", | |
"import pyLDAvis.sklearn\n", | |
"pyLDAvis.enable_notebook()\n", | |
"from __future__ import print_function\n", | |
"import nltk\n", | |
"\n", | |
"#Collection of all Tweet text for topic modelling \n", | |
"data_dump=data['Tweets_Cln'].str.cat(sep=', ')\n", | |
"\n", | |
"#Making sure we have just alphbest and numerals \n", | |
"words = set(nltk.corpus.words.words())\n", | |
"data_dump= \" \".join(w for w in nltk.wordpunct_tokenize(data_dump) \\\n", | |
" if w.lower() in words and w.isalpha())" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.0" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment