mutato
Ontology-driven synonym swapping for semantic text enrichment. Mutato identifies terms in input text and replaces them with semantically equivalent synonyms sourced from OWL ontologies, enabling consistent, structured analysis of natural language content.
Use Cases
- Normalize terminology across transcripts before downstream analysis
- Enrich tokens with ontology-backed synonym candidates
- Bridge informal language to structured vocabulary in NLP pipelines
Quick Start
from mutato.parser import owl_parse
results = owl_parse(tokens=["student", "learned", "math"], ontologies=[...])
Installation
make all
This downloads the spaCy model, installs dependencies, runs tests, builds the package, and freezes requirements.
Or step by step:
make get_model # download en_core_web_sm
make install # poetry lock + install
make test # run pytest
make build # install + test + poetry build
make freeze # export requirements.txt
CLI
The parse command parses input text against an OWL ontology and prints canonical forms:
poetry run parse --ontology path/to/ontology.owl --input-text "fiscal policy analysis"
Three modes are available:
| Mode | Flag | Effect |
|---|---|---|
| Cached (default) | none | Load JSON snapshot; build it on first run |
| Rebuild cache | --force-cache |
Regenerate snapshot, then parse |
| Live OWL | --live |
Parse directly from the OWL file; no cache |
See docs/cli.md for the full reference, including the MIXED-schema caveat for --live.
Architecture
Mutato is organized into four modules:
| Module | Purpose |
|---|---|
mutato.parser |
Main API -- synonym swapping and token matching |
mutato.finder |
Ontology lookup across single and multiple OWL graphs |
mutato.mda |
Metadata and NER enrichment generation |
mutato.core |
Shared utilities (file I/O, text, validation, timing) |
See docs/architecture.md for design details.
Matching Strategies
The parser applies multiple matching passes in order:
- Exact -- literal string match against ontology terms
- Span -- multi-token window matching
- Hierarchy -- parent/child concept traversal
- spaCy -- lemma and POS-aware NLP matching
Requirements
- Python >= 3.10, < 3.14
- Poetry for dependency management
- spaCy
en_core_web_smmodel (installed viamake get_model)
Links
Metadata
Release files for mutato 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mutato-1.1.1.tar.gz | 65.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mutato-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.2 kB
Release files / mutato-1.1.1.tar.gz
| Download URL | mutato-1.1.1.tar.gz |
|---|---|
| Size | 65.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6a433ae7863547bdfff144e8a30a295c62aa6cc245a38c9d0ee8974c6e1fd56
|
|
BLAKE2b-256 checksum How to use checksums |
f5ed3ea15e1b6758976f2a7bfcc8fe647b3b7d78104d30d3d948dbb118dd5805
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.9 Darwin/24.6.0
|
Release files / mutato-1.1.1-py3-none-any.whl
| Download URL | mutato-1.1.1-py3-none-any.whl |
|---|---|
| Size | 113.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abaf50ce2480794ce19bf204b117f3132c395f451930f402e9c3ef74e336751c
|
|
BLAKE2b-256 checksum How to use checksums |
c653ac2293d6c453db90799bd967269f77dbe57d3ee9276a026c3871bc9ee634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.9 Darwin/24.6.0
|