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/234209888-0d20ede9-2ea1-4d6e-b69b-71b863287cc9.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.4.tar.gz (64.0 kB view details)

Uploaded Source

Built Distribution

topic_wizard-0.2.4-py3-none-any.whl (77.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: topic_wizard-0.2.4.tar.gz
  • Upload date:
  • Size: 64.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.19.0-41-generic

File hashes

Hashes for topic_wizard-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8a9c32c120dc2640f36bf77819c6ace6d93fd7080c585db7113f9aeccaccf34a
MD5 dd585c1820e3c8d1c30fee12a491a212
BLAKE2b-256 eaf49e05a847c8d4c9d701a9b7924759f6701f42e0af059b88690c5054cae23d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: topic_wizard-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 77.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.19.0-41-generic

File hashes

Hashes for topic_wizard-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f548e75a4948c21b4024e020427536422ff3e7ff00996b2f8a7c0d422bf6c2
MD5 e016c19b9fea5eda7568d161eb4bcce4
BLAKE2b-256 10a163a30420d2fcb15cc6b43eba6eb42db514d88ae09c8d4ea0c6b40b1d7ed9

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