NLP - Topic Modeling
Identify the error in this code snippet that uses LDA with scikit-learn:
from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import CountVectorizer docs = ["cat dog", "dog mouse", "cat mouse"] vectorizer = CountVectorizer() dtm = vectorizer.fit_transform(docs) lda = LatentDirichletAllocation(n_components=2) lda.fit_transform(dtm) print(lda.components_)
