Last active
February 2, 2020 07:30
-
-
Save khuangaf/e39fdf01a5a9954186128a034b480e58 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
from gensim.test.utils import common_texts | |
from gensim.corpora.dictionary import Dictionary | |
from gensim.models import LdaModel | |
# Create a corpus from a list of texts | |
common_dictionary = Dictionary(common_texts) | |
common_corpus = [common_dictionary.doc2bow(text) for text in common_texts] | |
# Train the model on the corpus. | |
lda = LdaModel(common_corpus, num_topics=10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment