Installation
Install the latest release from PyPI. Release wheels target Python 3.11–3.13 on the validated macOS and Linux platforms:Python API
from_pretrained() downloads the current frozen model weights from
premove-ai/premove-itn on
first use and caches them through the normal Hugging Face cache. The package
pins the model to the release revision, so upgrading the package automatically
selects the matching model snapshot on the next initialization. It can also
load a local inference-artifact directory for offline use.
Create one PremoveITN instance and reuse it across requests:
Structured and contextual results
Usenormalize_structured() when a downstream system needs exact edits or a
deterministic temporal value. One call returns readable text, resolved text,
and immutable spans:
normalize_resolved() returns only the resolved text view. Context replaces any
instance default for that call and is never discovered automatically. The
resolver supports relative dates, bounded day/week offsets, weekdays, named
dates, weekday-qualified dates, and numeric dates. See the Python API
reference for the complete context and DateOrder
contract.
Command-line interface
Normalize one transcript:--device auto, --device cpu, --device mps,
--device cuda, --version, and --help. Normal stdout contains only
normalized transcripts. Diagnostics and errors use stderr. See the
CLI reference for usage details.
Model lifecycle
Do not combine these three costs:
The benchmark excludes model download and initialization. A one-shot CLI
timing includes process startup and model initialization, so it is not
comparable to warm request latency. Services and transcript streams should keep
one normalizer resident.
Device selection
device="auto" selects CUDA when available, then Apple MPS, then CPU. Python
users can pass device="cpu", device="mps", or device="cuda" to
PremoveITN.from_pretrained(). The CLI exposes the same choices through
--device.
Release wheels are validated on macOS 14+ arm64 and manylinux_2_28 x86_64
for Python 3.11–3.13. Real frozen-model inference is validated on Apple Silicon
MPS and Linux CPU. See the platform support matrix for
the complete support boundary.
More examples
These outputs were checked with the pinned v0.2.0 model artifact used by the
v0.3.0 package. They are
examples, not guarantees for every sentence. The frozen benchmark records
cases where contextual ranking selected the wrong format. See the
benchmark results before using the output as a tool argument.
Next, check supported forms or read
how Premove ITN works.