Skip to main content

Mutato Synonym Swapping API

Project description

mutato

Python Version Status License Built with Poetry spaCy

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

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:

  1. Exact -- literal string match against ontology terms
  2. Span -- multi-token window matching
  3. Hierarchy -- parent/child concept traversal
  4. spaCy -- lemma and POS-aware NLP matching

Requirements

  • Python >= 3.10, < 3.14
  • Poetry for dependency management
  • spaCy en_core_web_sm model (installed via make get_model)

Links

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

mutato-0.5.23.tar.gz (59.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mutato-0.5.23-py3-none-any.whl (104.4 kB view details)

Uploaded Python 3

File details

Details for the file mutato-0.5.23.tar.gz.

File metadata

  • Download URL: mutato-0.5.23.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.9 Darwin/24.6.0

File hashes

Hashes for mutato-0.5.23.tar.gz
Algorithm Hash digest
SHA256 e7468624bf49e143388db97294cd4dc7e436c9063fb607ec99e48a1f6fa8a6ec
MD5 74ea59e739708c8d021a53bbec538c19
BLAKE2b-256 a8c4cb49c4fba02c2765c6d6fa3e618d6e813a0a7e7f0185deb05fcbde29f173

See more details on using hashes here.

File details

Details for the file mutato-0.5.23-py3-none-any.whl.

File metadata

  • Download URL: mutato-0.5.23-py3-none-any.whl
  • Upload date:
  • Size: 104.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.9 Darwin/24.6.0

File hashes

Hashes for mutato-0.5.23-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc5b8f67ee8d141ecc60bb914b1799452ac69499259303e1e71d40440784c2d
MD5 ddc90c47339a7cc09ad78e6c4f4985dc
BLAKE2b-256 8fe7ccfb01a0caf8376fdcce71b872c29190368910526995ae081f16651a4a46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page