Skip to main content

Pretty and opinionated topic model visualization in Python.

Project description

topicwizard


Pretty and opinionated topic model visualization in Python.

Open in Colab PyPI version pip downloads python version Code style: black

https://user-images.githubusercontent.com/13087737/219967955-1263c35b-4c5b-4ccc-adb9-23e073e099f0.mp4

Features

  • Investigate complex relations between topics, words and documents
  • Highly interactive
  • Name topics
  • Pretty :art:
  • Intuitive :cow:
  • Clean API :candy:
  • Sklearn 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.

from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline

topic_pipeline = Pipeline(
    [
        ("bow", CountVectorizer()),
        ("nmf", NMF(n_components=10)),
    ]
)
topic_pipeline.fit(texts)

Step 2:

Visualize with topicwizard.

import topicwizard

topicwizard.visualize(pipeline=topic_pipeline, corpus=texts)

Step 3:

Investigate :eyes: .

a) Topics

topics screenshot

b) Words

words screenshot words screenshot

c) Documents

documents screenshot

Project details


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.2.tar.gz (61.5 kB view details)

Uploaded Source

Built Distribution

topic_wizard-0.2.2-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file topic_wizard-0.2.2.tar.gz.

File metadata

  • Download URL: topic_wizard-0.2.2.tar.gz
  • Upload date:
  • Size: 61.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/5.14.0-1057-oem

File hashes

Hashes for topic_wizard-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bb6d754f665e900490a639357c6e997630f9fd4a65b06c677db7ecf4d102d0ae
MD5 c60288813b784aecffa0d7096db1acf8
BLAKE2b-256 bb4834d2409cd137e440361aa510786b67a488ada8c39e63455d8e37ef214afb

See more details on using hashes here.

File details

Details for the file topic_wizard-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: topic_wizard-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/5.14.0-1057-oem

File hashes

Hashes for topic_wizard-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8aa3344565ac7b41c5e14db7f7c76a9895769f20969909183b97e67dec4e7c71
MD5 df8fde1b855768318c7cdb64dd5c9b45
BLAKE2b-256 85f3d778f80bd4005ef069558fef22e851fa5a715e8d2bc52c1a06cdda9d72f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page