Open-source, context-aware inverse text normalization for conversational voice-agent transcripts, with open weights.
Premove ITN converts spoken ASR output into canonical written forms for phone numbers, email addresses, identifiers, dates, times, money, measurements, and alphanumeric codes.
| System | Output |
|---|---|
| Input | the room code is one oh five |
| Expected | the room code is 105 |
| Premove ITN | the room code is 105 ✓ |
| NVIDIA Thutmose | the room code is 1 oh 5 ✗ |
text-processing-rs |
the room code is 01:05 ✗ |
The spoken form is ambiguous. Context tells us that one oh five is an
identifier, not a time.
These are the retained outputs for row va6_collision_0013 in the
frozen evaluation.
On our frozen benchmark, Premove ITN reaches 99.50% semantic accuracy on the
voice-agent subset, compared with 68.25% for text-processing-rs and 67.00%
for NVIDIA Thutmose.
| Backend | Voice-agent semantic | Overall semantic | Mean warm latency |
|---|---|---|---|
| Premove ITN | 99.50% (398/400) | 89.70% | 56.49 ms |
| NVIDIA Thutmose | 67.00% (268/400) | 59.39% | 15.98 ms |
text-processing-rs |
68.25% (273/400) | 55.79% | 0.14 ms |
The benchmark is a frozen, balanced synthetic stress suite with 1,500 rows and includes a dedicated 400-row voice-agent subset. It was held out from both training and checkpoint selection, so these scores come from unseen evaluation data. Semantic accuracy checks whether the structured value is correct while allowing approved formatting differences. Latency is warm, sequential batch-one inference on an Apple M4 MacBook Air; every backend received transcript text only. This is a synthetic stress benchmark, not a sample of live production traffic.
Full report · Detailed results · Reproduce the benchmark
Install from PyPI:
pip install premove-itnfrom premove_itn import PremoveITN
itn = PremoveITN.from_pretrained()
print(itn.normalize("the room code is one oh five"))
# the room code is 105from_pretrained() downloads the frozen model weights from
premove-ai/premove-itn on
first use and caches them locally.
Create one PremoveITN instance and reuse it across requests. Model loading is
expensive; warm normalization calls are much faster.
For reproducible deployments, pin the package version:
pip install premove-itn==0.1.0I ran into this problem while building a voice agent. Deepgram gave me
transcripts in spoken form, but the tools behind the agent needed normalized
values. A person can read one hundred twenty three and know it means 123; an
API usually cannot.
My first solution was text-processing-rs.
It was extremely fast and handled straightforward normalization well. But some
spoken forms are impossible to normalize correctly without the sentence around
them. one oh five might mean 105, 1:05, or something else entirely. Rules
can generate plausible answers, but they cannot always know which one the
speaker meant.
That sent me looking for context-aware ITN. I tried NVIDIA Thutmose, but on the structured values I cared about for tool calls, I still found surprisingly simple failures.
Premove ITN came from a different idea: do not ask the model to perform the entire normalization. Generate the valid written forms first, then train the model only to decide which one fits the context. An exact decoder handles the rest.
Premove ITN splits normalization into three steps: generate, score, decode.
Simplified example:
input
enter the digits four one seven two zero one two
│
▼
1. GENERATE
Python enumerates spans; Rust generates valid written forms.
[four] → 4
[four one] → 41 | 04:01
[one seven two] → 172 | 17:02
...
[four one seven two zero one two] → 4172012 | 417-2012
│
▼
2. SCORE
DeBERTa encodes the transcript once.
Each candidate gets one score from:
contextual source span + candidate kind labels + proposed replacement
│
▼
3. DECODE
Candidates can overlap, so Premove ITN uses exact dynamic programming
to find the highest-scoring compatible path through the transcript.
│
▼
output
enter the digits 4172012
The rules decide what can be written. The model decides what fits the context. The decoder decides which edits can coexist.
Premove ITN covers English structured values commonly needed by voice agents:
| Form | Example |
|---|---|
| Numbers | one hundred twenty → 120 |
| Digit sequences | zero eight two zero six three → 082063 |
| Times | four thirty → 04:30 |
| Dates | march fifth twenty twenty four → march 5 2024 |
| Money | twenty dollars → $20 |
| Decimals | one point five → 1.5 |
| Measurements | two hundred meters → 200 m |
| Ordinals | the eighth → 8th |
| Phone numbers | eight one four two three one four → 814-2314 |
| Email and URLs | support at example dot com → support@example.com |
| Versions and identifiers | v three dot one dot nine → v3.1.9 |
| Punctuation | comma → , |
| Abbreviations | doctor → dr. |
Premove ITN currently targets English structured text. It does not provide first-class normalization for non-English speech, street addresses, free-form rewriting, or arbitrary application-specific formats.
Source text is preserved wherever no candidate is selected.
See the full candidate coverage for the exact forms supported by each realizer.
- English only.
- Normalization is bounded by the deterministic candidates generated by the Rust realizers. The scorer cannot select a written form that was not generated.
- Inputs longer than 512 DeBERTa encoder tokens are rejected rather than silently truncated.
- A 435.6M-parameter DeBERTa-v3-large contextual scorer.
- About a 1.6 GB first model download.
- Multi-second model initialization.
- A custom candidate-scoring architecture; it is not a generic
AutoModel.from_pretrained()model. - A synthetic stress benchmark, not observed live-traffic accuracy.
- CUDA, Windows, macOS Intel, Linux ARM64, and other accelerators are not validated v0.1.0 support claims.
- Getting started
- Architecture
- Candidate coverage
- Model card
- Model provenance
- Inference artifact
- Platform support
- Benchmark reproduction
- Contributing
The current public release is v0.1.0:
The public inference artifact is
premove-ai/premove-itn,
release v0.1.0, at the immutable commit
80bda5e2e1fe9542aa628597090242df57c1a157. PremoveITN.from_pretrained()
uses that commit by default and verifies the resolved revision, release
metadata, base model, and model-file digest before inference.
The artifact is inference-only. It excludes optimizer state, scheduler state, training counters, training data, and evaluation rows. See the artifact release record and training provenance.
The released scorer was trained on 418,000 examples across general text normalization, conversational adaptation, and structured-value adaptation. The frozen evaluation was excluded from training and checkpoint selection; see the training provenance.
The contextual scorer uses
microsoft/deberta-v3-large
at a pinned revision as its encoder backbone. Premove ITN adds a custom candidate
scorer and exact decoder around the
DeBERTaV3 architecture.
Premove ITN source code and model weights are MIT licensed. The contextual
scorer uses microsoft/deberta-v3-large
at a pinned revision as its encoder backbone. Candidate scoring and exact
decoding are Premove ITN-specific.
The Rust realization layer uses
text-processing-rs,
which is Apache-2.0 licensed. Required third-party licenses and notices are in
THIRD_PARTY_NOTICES.md and LICENSES/.
