awacke1's picture
Create app.py
b2cb6f5
raw
history blame
398 Bytes
from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
bow_vectorizer = CountVectorizer()
nmf = NMF(n_components=10)
topic_pipeline = Pipeline(
[
("bow", bow_vectorizer),
("nmf", nmf),
]
)
topic_pipeline.fit(texts)
import topicwizard
topicwizard.visualize(pipeline=topic_pipeline, corpus=texts)