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

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:

  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-1.1.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

mutato-1.1.0-py3-none-any.whl (113.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mutato-1.1.0.tar.gz
  • Upload date:
  • Size: 65.7 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-1.1.0.tar.gz
Algorithm Hash digest
SHA256 de5ff8139c3ae11add87ee7a64a82a82acb950d20301d6be904841116919321a
MD5 276b2f711c376e170fbfd993228bdeee
BLAKE2b-256 f68593246efb0f01ca9a40080e4119dc74c468c1e21f0dce69ffb8015c5dbbe1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mutato-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 113.5 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-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7dc69072984865ec56d7fab4dc6af571e0854592f66cacf9053a13a8d047681
MD5 26aeb04ba000ef778e97d78928b56c94
BLAKE2b-256 25d8b68b4a21e4bc78ac6cc43b9f59d5486c1e53609c514149297d333869a89e

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