Created
December 28, 2019 17:13
-
-
Save GeorgeSeif/97f58ab815a3480c908fe8854d788c6c 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 sklearn.decomposition import LatentDirichletAllocation as LDA | |
NUM_TOPICS = 3 | |
# Here we create and fit the LDA model | |
# The "document_word_matrix" is a 2D array where each row is a document | |
# and each column is a word. The cells contain the count of the word within | |
# each document | |
lda = LDA(n_components=NUM_TOPICS, n_jobs=-1) | |
lda.fit(document_word_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment