Created
December 12, 2018 18:18
-
-
Save FelixChop/b780ce89b16e8a69651cbe4035ab67a7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from gensim import corpora, models | |
| dictionary_LDA = corpora.Dictionary(list_of_list_of_tokens) | |
| dictionary_LDA.filter_extremes(no_below=3) | |
| corpus = [dictionary_LDA.doc2bow(list_of_tokens) for list_of_tokens in list_of_list_of_tokens] | |
| num_topics = 20 | |
| %time lda_model = models.LdaModel(corpus, num_topics=num_topics, \ | |
| id2word=dictionary_LDA, \ | |
| passes=4, alpha=[0.01]*num_topics, \ | |
| eta=[0.01]*len(dictionary_LDA.keys())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment