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.2

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.2
File Size Uploaded Provenance Actions
thematos-1.0.2.tar.gz 1.3 MB With provenance Details for thematos-1.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / thematos-1.0.2.tar.gz

Download URL thematos-1.0.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
815ffaf46f445e8b446cb2e0d7873e22e629daf3aad7ded16d0087b1c6353474
BLAKE2b-256 checksum
How to use checksums
acdd52dcf1566496666f5e92933b1b71373be611dfff1511e001bf9ded8d78e5
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.2-py3-none-any.whl

Download URL thematos-1.0.2-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddd24c93a023dcb89356b2703e02d47f18dec7554cf2ae57e0d9bdc1fdd368c2
BLAKE2b-256 checksum
How to use checksums
96be9bbd074373a01284b67824bdcd5ec576215c7c6dfb4ed672c58a1b61308c
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.2

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.2.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