Pretty and opinionated topic model visualization in Python.
Project description
topicwizard
Pretty and opinionated topic model visualization in Python.
New in version 0.2.5 🌟 🌟
- Compatiblity with Gensim topic models 💥
- Compatibility with BERTopic(experimental 🧪)
- Topic name inference 🧠
Features
- Investigate complex relations between topics, words and documents
- Highly interactive
- Automatically infer topic names
- Name topics manually
- Pretty :art:
- Intuitive :cow:
- Clean API :candy:
- Sklearn, Gensim and BERTopic compatible :nut_and_bolt:
- Easy deployment :earth_africa:
Installation
Install from PyPI:
pip install topic-wizard
Usage (documentation)
Step 1:
Train a scikit-learn compatible topic model. (If you want to use non-scikit-learn topic models, check compatibility)
from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import make_pipeline
# Create topic pipeline
topic_pipeline = make_pipeline(
CountVectorizer(),
NMF(n_components=10),
)
# Then fit it on the given texts
topic_pipeline.fit(texts)
Step 2:
Visualize with topicwizard.
import topicwizard
# You can get automatically assigned topic labels, that you can change manually later
topic_names = topicwizard.infer_topic_names(pipeline=pipeline)
# Then you can visualize your results
topicwizard.visualize(pipeline=topic_pipeline, corpus=texts, topic_names=topic_names)
Step 3:
Investigate :eyes: .
a) Topics
b) Words
c) Documents
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
topic_wizard-0.2.6.tar.gz
(66.1 kB
view hashes)
Built Distribution
Close
Hashes for topic_wizard-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1354448cf613352bdfbf2c3220db4f552f62e6fe3e61b250c04a563eda3acd7 |
|
MD5 | 171d31e2d1cc8c03fb1408ec1032c5f5 |
|
BLAKE2b-256 | ac4ff4fed60f86c0a9a69fa889c457251e8f49f59df498bc9261b1003c8755f5 |