Skip to main content

ThematOS

pypi-image license-image

LDA topic modeling on tomotopy. ThematOS is a plain Python library; it also ships HyFI 2.0 config groups and workflows, so a training run, a parameter sweep, or an inference run can be started from the command line and recorded in a run manifest. The name comes from the Greek θέματος, "of the theme".

ThematOS 1.0 drops the HyFI 1.x API. Pin thematos<1 to keep it.

Install

uv add thematos          # or: pip install thematos
pip install pyLDAvis     # optional: LDAvis HTML next to the other artifacts

Python 3.11 or newer. Stopwords come from lexikanon, which pulls in MeCab through fugashi; on Python 3.15 fugashi builds from source and needs the MeCab library (apt-get install libmecab-dev or brew install mecab).

Use it as a library

from thematos.datasets import Corpus
from thematos.models import LdaModel

corpus = Corpus(data_file="news.parquet", text_col="tokens")  # or Corpus(data=dataframe)
model = LdaModel(output_dir="workspace/topic/model", seed=42, model_args={"k": 10})
model.train(corpus)  # trains and computes coherence; writes nothing
model.save()  # model file, log-likelihood trace, distributions, top words
model.summarize()  # tomotopy summary and one JSON line in model-summary.jsonl
model.plot()  # log-likelihood plot and topic word clouds
model.model.perplexity

Every file name starts with the model id, LDA_model_k(10) here. Importing thematos never imports HyFI.

Use it from HyFI

Installing thematos registers its config groups through the hyfi.plugins entry point:

group options
model lda
dataset topic_corpus (stopwords from lexikanon's stopwords group)
words wordprior
plot wordcloud
workflow thematos_lda, thematos_lda_sweep, thematos_lda_infer
hyfi run workflow=thematos_lda dataset.data_file=news.parquet dataset.text_col=tokens \
  model.model_args.k=20 model.seed=42

Artifacts go under the project workspace (workspace/topic/model/ by default) and the run manifest under .hyfi/runs/<run id>/manifest.json. See Usage for the sweep and inference workflows.

Citation

See CITATION.cff, or use GitHub's "Cite this repository" button.

License

MIT

Metadata

Release files for thematos 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thematos 1.0.1
File Size Uploaded Provenance Actions
thematos-1.0.1.tar.gz 1.3 MB With provenance Details for thematos-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thematos 1.0.1
File Interpreter ABI Platform Actions
thematos-1.0.1-py3-none-any.whl Python 3 none any Details for thematos-1.0.1-py3-none-any.whl

Total release size: 1.3 MB

Release files / thematos-1.0.1.tar.gz

Download URL thematos-1.0.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
2b7fa2aabcdc7d3fed77524dd185e3fd6144d8b691d699538c648d2fef5cadcf
BLAKE2b-256 checksum
How to use checksums
466bcf49a516cf78eacf818b60a6029ce42f451eb52239f7a2c3a14e23590d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / thematos-1.0.1-py3-none-any.whl

Download URL thematos-1.0.1-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e3504211d374746412416620bf7f1cfcdbd11409d59ad0c9c5c51723e365f50
BLAKE2b-256 checksum
How to use checksums
b5dd26b9a3701b493ac19745be4aab3e7dcc3afb1d6c11fc5ea347349863b66f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for thematos 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for thematos-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page