Created
August 28, 2021 13:38
-
-
Save techykajal/3a8af7b97201294de874b73dfb90e5de 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
| for k in range(2,25): # Train LDA on different values of k | |
| print('Round: '+str(k)) | |
| LDA = gensim.models.ldamulticore.LdaMulticore | |
| ldamodel = LDA(doc_term_matrix, num_topics=k, id2word = dictionary, passes=20, iterations=100, | |
| chunksize = 10000, eval_every = 10, random_state=20) | |
| ldamodel.save(f"ldamodel_for_{k}topics_Run_10") | |
| pprint(ldamodel.print_topics()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment