ttucs: Text to UCS
ttucs turns spoken field-recording slates (speech-to-text output) into Universal Category System metadata. For each slate it returns a CatID, Category/SubCategory, a confidence, the parsed slate fields, a suggested UCS filename, and keywords. It is built with PyTorch and MLflow, and inference runs locally and offline.
pip install ttucs # also installs the pretrained weights (ttucs-model-bow, ~32 MB)
from ttucs import TTUCS
model = TTUCS.from_pretrained() # offline: loads the installed weights, no network
p = model.predict("Project Thick As Thieves, location Squamish forest, recording a wooden door creak slow, "
"Sennheiser MKH 416 and Sound Devices MixPre, 96k 24 bit, take 3")
p.cat_id, p.category_full, p.confidence
p.filename # e.g. 'DOORCreak_Wooden Door Creak Slow_NONE_ThickAsThieves_MKH416'
p.slate["sample_rate"], p.slate["take"]
p.to_json()
Only the parsed description goes to the classifier. The other slate fields are returned but are never used for classification.
Install
| what | command |
|---|---|
inference (API + ttucs predict/parse/info/download) |
pip install ttucs |
| training, evaluation, reports, MLflow | pip install "ttucs[train]" |
| MiniLM encoder model | pip install "ttucs[transformers]" |
| development | pip install -e packages/ttucs-model-bow -e ".[dev]" |
PyTorch is required. On machines without a GPU, install the much smaller CPU-only wheel first:
pip install torch --index-url https://download.pytorch.org/whl/cpu.
Weights and offline use
The weights ship as a separate, data-only distribution,
ttucs-model-bow.
ttucs depends on it, so pip install ttucs fetches it automatically. Wheels can't run code at install
time, which is why the weights are their own package. After installation nothing touches the network.
TTUCS.from_pretrained() (or from_pretrained("bow")) looks for a model in this order:
- an explicit local directory:
TTUCS.from_pretrained("models/my-model"); - the installed
ttucs_model_bowpackage; - the user cache:
$TTUCS_HOME, or the platform cache dir (e.g.~/.cache/ttucs), filled byttucs download; - a SHA-256-verified download of the GitHub Release asset, only when offline mode is off.
Set TTUCS_OFFLINE=1 (HF_HUB_OFFLINE=1 is honoured too) to guarantee no network access. If no weights
are found, the error lists exactly what to install or run.
ttucs info [--verify] # resolved model path/source, versions, offline mode (and sha256 check)
ttucs download --model bow # fill the cache, e.g. for air-gapped images (--dest DIR, --url MIRROR --sha256 HEX)
from_mlflow("models:/ttucs/1") still loads models from an MLflow registry (needs [train] or [mlflow]).
CLI
ttucs predict "glass bottle smash on concrete, exterior, take two" # --json, -k 5, --file slates.txt
ttucs parse "project nightfall, location tofino beach, waves on rocks, ninety six k, take one"
ttucs generate-data -c configs/bow-release.yaml # [train]
ttucs train -c configs/bow-release.yaml # [train]; MLflow optional
ttucs eval -m models/ttucs-bow-release # [train]
ttucs report -c configs/bow-release.yaml # [train]
The API also offers predict_batch, top_k, aggregated category scores, temperature calibration, a
decision field (confident / category_fallback to the category's MISC CatID / unknown), and
save_pretrained.
Models
| config | model | notes |
|---|---|---|
configs/bow-release.yaml |
hashed word+char n-gram bag of embeddings (131,072 × 256), CatID + Category heads | published weights (fp16 safetensors, ~68 MB); CPU; ~3 min training |
configs/bow.yaml |
the same, larger (524,288 × 192) | ~400 MB fp32; no accuracy gain on synthetic data (see model card) |
configs/minilm.yaml |
frozen all-MiniLM-L6-v2 + MLP head | optional, needs [transformers] (not trained/verified yet) |
configs/zeroshot.yaml |
TF-IDF similarity to UCS Explanation+Synonyms | cold-start floor, no training |
Results: published model (ttucs-model-bow 0.2.0, fp16)
| test split | n | top-1 | top-5 | macro-F1 | ECE |
|---|---|---|---|---|---|
| synthetic descriptions | 22,384 | 0.908 | 0.983 | 0.904 | 0.020 |
| synthetic spoken slates (parser → model) | 2,000 | 0.900 | 0.976 | 0.884 | 0.023 |
| hand-written dev descriptions (tuning set) | 332 | 0.789 | 0.925 | 0.788 | 0.069 |
| hand-written realistic slates (held out) | 80 | 0.713 | 0.925 | 0.723 | 0.138 |
The fp16 export matches the fp32 checkpoint to within 0.0001 on every split. The previous weights (0.1.1) scored 0.488 top-1 / 0.813 top-5 on the realistic slates.
Read these numbers with caution. The synthetic test sets come from the same generator as the training data and overstate real-world accuracy. The 80 hand-written slates are the most honest signal: about seven in ten are right at top-1 and over nine in ten are in the top 5. The set is tiny (one slate is 1.25 points), and confidence is still over-optimistic on real phrasing (ECE 0.14). Part of the gain comes from a hand-written phrase bank, and some everyday wording in it also appears in these slates; on the 29 slates that share no bank phrase with their own class, top-1 went from 0.552 to 0.724. The model is trained only on redistributable data (synthetic text plus UCS label documents). Training on your own labelled library metadata is the most promising way to improve further; it is on the roadmap and not yet a built-in option. See MODEL_CARD.md and DATA_CARD.md.
Roadmap
- Fine-tune on your own labelled library metadata (Soundminer/BaseHead exports) and real slate recordings.
- Speech-to-text integration (e.g. Whisper) with word timestamps → slate-to-region alignment.
- Active learning: log low-confidence predictions and user corrections, then retrain.
- Train and evaluate the MiniLM path; consider a learned slate parser (token tagging).
Releasing
See docs/RELEASING.md (Trusted Publishing to TestPyPI/PyPI, model release assets) and the CHANGELOG.
Credits & license
Code and published weights: MIT (c) 2025 Jon Evans. The UCS category list v8.2.1 is by Tim Nielsen, Justin Drury, Kai Paquin and contributors, a public-domain initiative (https://universalcategorysystem.com/).
Metadata
Release files for ttucs 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ttucs-0.3.0.tar.gz | 339.9 kB | With provenance | Details for ttucs-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ttucs-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for ttucs-0.3.0-py3-none-any.whl |
Total release size: 524.9 kB
Release files / ttucs-0.3.0.tar.gz
| Download URL | ttucs-0.3.0.tar.gz |
|---|---|
| Size | 339.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ffdc440a74be2d0bc234e2c29054badbb578ba8daed2fc1be2139bb65b4e156
|
|
BLAKE2b-256 checksum How to use checksums |
63397d9af49fd5ad8a0f577ba499f7e1946c25cfcd872bb4b4bf0394c500ca47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 7, 2026.
Transparency logRelease files / ttucs-0.3.0-py3-none-any.whl
| Download URL | ttucs-0.3.0-py3-none-any.whl |
|---|---|
| Size | 184.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce64dc38996ba17ea2a80b3c40233dbbf1dc3e1cb9fe010452834b1a9b3dfbd0
|
|
BLAKE2b-256 checksum How to use checksums |
9f3f597f9b6cf483bfa00c85483b93c622e6bc4120de2db2bb7e844db2971e7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 7, 2026.
Transparency logSecurity for ttucs 0.3.0
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.
Attestation for ttucs-0.3.0.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 Nov 7, 2026.
Transparency logA 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.