Polish public model card for Stage 5

#2
Files changed (1) hide show
  1. README.md +121 -79
README.md CHANGED
@@ -18,115 +18,157 @@ license: mit
18
 
19
  # Premove ITN v0.1.0
20
 
21
- Premove ITN is an English inverse text normalization system for voice-agent
22
- utterances. This release is the first frozen, inference-only artifact for its
23
- structured-value contextual scorer. It ranks deterministic Rust candidates
24
- using sentence context, then applies exact maximum-score decoding.
25
 
26
- **Premove ITN is released as an open-weight contextual inverse text
27
- normalization model. The inference code and model weights are licensed under
28
- MIT.**
 
 
 
 
 
29
 
30
- The artifact contains the complete trained parameters in `model.safetensors`,
31
- the exact DeBERTa configuration, and the tokenizer files used by the selected
32
- production checkpoint. Optimizer state, scheduler state, training counters,
33
- training data, and evaluation rows are not included.
34
 
35
- The artifact is loaded through the `premove-itn` package. It is not a generic
36
- Transformers model; use `PremoveITN.from_pretrained()` so candidate generation,
37
- scoring, and decoding stay aligned with the release implementation:
 
38
 
39
  ```python
40
  from premove_itn import PremoveITN
41
 
42
- itn = PremoveITN.from_pretrained(
43
- "premove-ai/premove-itn",
44
- revision="v0.1.0",
45
- )
46
- print(itn.normalize("call me at four thirty")) # call me at 04:30
47
  ```
48
 
49
- Source code, deterministic Rust realization rules, the Python API, benchmark
50
- code, and retained results are available in the
51
- [`premove-ai/premove-itn`](https://github.com/premove-ai/premove-itn)
52
- repository.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- The model uses `microsoft/deberta-v3-large` at the exact revision recorded in
55
- `provenance.json`. The artifact includes the tokenizer and base configuration;
56
- the base model is not separately redistributed. Microsoft lists the base model
57
- under the MIT license; retain that attribution when redistributing this
58
- artifact.
59
 
60
- This release is tagged `v0.1.0`. Do not move or overwrite that tag after
61
- publication. The artifact digest and source checkpoint lineage are recorded in
62
- `provenance.json`.
63
 
64
- ## Intended use
65
 
66
- Use this artifact for English voice-agent text normalization where spoken
67
- numbers, dates, times, money, phone values, identifiers, URLs, and related
68
- structured values require context-sensitive disambiguation. The model receives
69
- only the utterance text at inference time. Candidate metadata is generated by
70
- the package's deterministic Rust layer.
71
 
72
- ## Supported span kinds
73
 
74
- The supported span kinds are listed in `config.json`: `DIGIT_SEQUENCE`,
75
- `CARDINAL`, `TIME`, `DATE`, `MONEY`, `DECIMAL`, `PHONE`, `ELECTRONIC`,
76
- `MEASUREMENT`, `ORDINAL`, `PUNCTUATION`, `WHITELIST`, and `WORD`.
 
 
77
 
78
- ## Runtime
79
 
80
- The contextual API requires Python 3.11 or newer, PyTorch, Transformers,
81
- SentencePiece, safetensors, and huggingface_hub. `device="auto"` selects CUDA,
82
- then Apple MPS, then CPU. Pass `device="cpu"`, `device="mps"`, or
83
- `device="cuda"` to select a device explicitly. The retained latency result was
84
- measured with batch size one on Apple MPS. Other runtimes and devices can have
85
- different latency and memory use.
86
 
87
- ## First Evaluation
 
88
 
89
- The retained First Evaluation used 1,500 frozen VoiceAgent ITN rows and three
90
- backends. The metrics below are semantic entity metrics unless marked strict.
91
- Formatting-only differences can reduce strict exact match while preserving the
92
- same semantic value.
 
93
 
94
- | Backend | Entity micro | Entity macro | Voice rows | Mean latency |
95
- |---|---:|---:|---:|---:|
96
- | Premove ITN | 89.70% | 90.71% | 398/400 (99.50%) | 56.49 ms |
97
- | Thutmose | 59.39% | 57.61% | 268/400 (67.00%) | 15.98 ms |
98
- | text-processing-rs | 55.79% | 55.05% | 273/400 (68.25%) | 0.14 ms |
99
 
100
- Premove leads the measured semantic accuracy overall and on the 400
101
- voice-agent-domain rows. It does not lead latency. This is a balanced synthetic
102
- stress benchmark, not an estimate of production traffic accuracy, and the run
103
- was not blind.
 
 
 
 
 
 
 
 
 
104
 
105
  ## Limitations
106
 
107
- - This custom scorer is not directly loadable with `AutoModel.from_pretrained`.
108
- Use `PremoveITN.from_pretrained()` and the matching `premove-itn` package
109
- version.
110
- - The artifact is English-only and depends on the package's candidate graph and
111
- decoder for end-to-end normalization.
112
- - Benchmark results are not a guarantee for unseen domains or formatting
113
- policies. Human gold adjudication and broader production-distribution testing
114
- remain separate requirements.
 
 
 
115
 
116
- ## Release identity
117
 
118
  - Artifact version: `v0.1.0`
119
  - Architecture: `premove-candidate-scorer-v1`
120
- - Package version: `0.1.0`
121
  - Hub repository: `premove-ai/premove-itn`
122
- - Original artifact namespace: `premove-itn/premove-itn-contextual`
123
- - Hub revision: `v0.1.0`
124
- - Hub commit: `80bda5e2e1fe9542aa628597090242df57c1a157`
125
  - Base model: `microsoft/deberta-v3-large`
126
  - Base model revision: `64a8c8eab3e352a784c658aef62be1662607476f`
127
- - Source checkpoint SHA-256: `9021fa11a028faefb31ef67878170cbe29ed25e68a9a78999f37b120c2ad00d5`
128
- - Inference artifact SHA-256: `119c0f19767b61446e04da1f8f01a001edf97a47a66965e7146db2483b4937a1`
129
 
130
- ## Licensing
 
 
 
131
 
132
- Premove ITN is MIT licensed. The pinned base model is [`microsoft/deberta-v3-large`](https://huggingface.co/microsoft/deberta-v3-large), whose model card lists an MIT license. The architecture derives from [DeBERTaV3](https://arxiv.org/abs/2111.09543). Review and retain both notices when redistributing this artifact.
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  # Premove ITN v0.1.0
20
 
21
+ Premove ITN is an open-weight contextual inverse text normalization system for
22
+ English voice-agent transcripts. It turns spoken-form ASR text into structured
23
+ written text:
 
24
 
25
+ ```text
26
+ call me at four thirty → call me at 04:30
27
+ the total is twenty dollars → the total is $20
28
+ ```
29
+
30
+ Deterministic Rust realizers propose valid written forms. A
31
+ DeBERTa-v3-large contextual scorer uses the complete sentence to score those
32
+ candidates, and an exact decoder selects compatible, non-overlapping edits.
33
 
34
+ This repository contains the frozen, inference-only v0.1.0 model artifact. It
35
+ does not contain optimizer state, scheduler state, training counters, training
36
+ data, or evaluation rows. Source code and retained evaluation evidence are in
37
+ [`premove-ai/premove-itn`](https://github.com/premove-ai/premove-itn).
38
 
39
+ ## Loading the model
40
+
41
+ This is a custom candidate-scoring architecture. Do not load it with
42
+ `AutoModel.from_pretrained()`.
43
 
44
  ```python
45
  from premove_itn import PremoveITN
46
 
47
+ itn = PremoveITN.from_pretrained()
48
+ print(itn.normalize("call me at four thirty"))
49
+ # call me at 04:30
 
 
50
  ```
51
 
52
+ The `premove-itn` PyPI release is not published yet. Until the public package
53
+ release, contributors can build and install the release wheel from the GitHub
54
+ repository. Create one `PremoveITN` instance and reuse it; model initialization
55
+ is expensive compared with warm normalization.
56
+
57
+ `device="auto"` selects CUDA when available, then Apple MPS, then CPU. The
58
+ current release candidate has been validated end-to-end only on macOS Apple
59
+ Silicon with Python 3.11 and MPS. Other environments require release
60
+ validation.
61
+
62
+ ## Architecture
63
+
64
+ ```text
65
+ Spoken ASR text
66
+
67
+ deterministic Rust candidates
68
+
69
+ DeBERTa-v3-large contextual scores
70
+
71
+ exact maximum-score decoder
72
+
73
+ written transcript
74
+ ```
75
 
76
+ The scorer has 435,594,145 parameters. The artifact contains the complete
77
+ trained state in `model.safetensors`, the pinned DeBERTa configuration, and the
78
+ tokenizer files required by the release.
 
 
79
 
80
+ Supported candidate kinds are `DIGIT_SEQUENCE`, `CARDINAL`, `TIME`, `DATE`,
81
+ `MONEY`, `DECIMAL`, `PHONE`, `ELECTRONIC`, `MEASUREMENT`, `ORDINAL`,
82
+ `PUNCTUATION`, `WHITELIST`, and `WORD`.
83
 
84
+ ## First Evaluation
85
 
86
+ The retained First Evaluation used a frozen, balanced synthetic stress suite.
87
+ Semantic entity accuracy is the primary structured-value metric. Strict exact
88
+ match separately measures the complete canonical output.
 
 
89
 
90
+ ### Dedicated voice-agent rows
91
 
92
+ | Backend | Correct entities | Semantic accuracy | Mean latency |
93
+ | --- | ---: | ---: | ---: |
94
+ | **Premove ITN** | **398/400** | **99.50%** | 57.41 ms |
95
+ | Thutmose | 268/400 | 67.00% | 16.04 ms |
96
+ | text-processing-rs | 273/400 | 68.25% | 0.15 ms |
97
 
98
+ ### Overall 1,500-row benchmark
99
 
100
+ | Backend | Semantic accuracy | Strict exact | Mean latency |
101
+ | --- | ---: | ---: | ---: |
102
+ | **Premove ITN** | **89.70%** | **40.53%** | 56.49 ms |
103
+ | Thutmose | 59.39% | 22.13% | 15.98 ms |
104
+ | text-processing-rs | 55.79% | 16.53% | 0.14 ms |
 
105
 
106
+ Premove led measured semantic accuracy overall and on the 400 dedicated
107
+ voice-agent rows. It did not lead latency.
108
 
109
+ Latency used sequential batch-one requests on an Apple M4 MacBook Air with
110
+ MPS, an optimized Rust extension, and eight Rayon workers. Models were loaded
111
+ and warmed before request latency was measured. Download and initialization
112
+ are excluded. The result is not an estimate of production-traffic accuracy,
113
+ and the evaluation was not blind.
114
 
115
+ See the
116
+ [`First Evaluation report`](https://github.com/premove-ai/premove-itn/blob/main/eval/voice_agent_itn/results/first-evaluation/REPORT.md)
117
+ and
118
+ [`detailed tables`](https://github.com/premove-ai/premove-itn/blob/main/eval/voice_agent_itn/results/first-evaluation/DETAILS.md).
 
119
 
120
+ ## Intended use
121
+
122
+ Use Premove for English voice-agent transcripts in which numbers, dates,
123
+ times, money, phone values, identifiers, URLs, and related structured values
124
+ need sentence-level disambiguation. The runtime receives only transcript text.
125
+ Candidate metadata is generated internally.
126
+
127
+ ## Model lifecycle
128
+
129
+ - The first use downloads about 1.6 GB; duration depends on the network.
130
+ - Cached initialization takes several seconds on the tested system.
131
+ - Warm normalization averaged 56.49 ms in the retained MPS benchmark.
132
+ - Services and transcript streams should keep one normalizer resident.
133
 
134
  ## Limitations
135
 
136
+ - English only.
137
+ - A 435.6M-parameter model with an approximately 1.6 GB download.
138
+ - Multi-second initialization.
139
+ - Not compatible with generic `AutoModel.from_pretrained()` loading.
140
+ - The benchmark is synthetic and does not measure live production traffic.
141
+ - Weaker measured categories include URL, MONEY, CARDINAL, TIME,
142
+ REFERENCE_ID, and VERSION.
143
+ - Blind human gold adjudication and broader contamination checks remain
144
+ incomplete.
145
+ - End-to-end release validation currently covers macOS Apple Silicon, Python
146
+ 3.11, and MPS only.
147
 
148
+ ## Release identity and provenance
149
 
150
  - Artifact version: `v0.1.0`
151
  - Architecture: `premove-candidate-scorer-v1`
152
+ - Required package version: `0.1.0`
153
  - Hub repository: `premove-ai/premove-itn`
154
+ - Immutable model commit: `80bda5e2e1fe9542aa628597090242df57c1a157`
 
 
155
  - Base model: `microsoft/deberta-v3-large`
156
  - Base model revision: `64a8c8eab3e352a784c658aef62be1662607476f`
157
+ - Model SHA-256: `119c0f19767b61446e04da1f8f01a001edf97a47a66965e7146db2483b4937a1`
 
158
 
159
+ The package pins the immutable model commit and verifies its release metadata,
160
+ base-model identity, and model digest before inference. Full training
161
+ composition and checkpoint selection evidence are in the
162
+ [`production model record`](https://github.com/premove-ai/premove-itn/blob/main/docs/model-provenance.md).
163
 
164
+ ## License and attribution
165
+
166
+ Premove ITN source code and model weights are MIT licensed. The scorer uses
167
+ [`microsoft/deberta-v3-large`](https://huggingface.co/microsoft/deberta-v3-large)
168
+ at the revision above. Its architecture derives from the
169
+ [`DeBERTaV3` paper](https://arxiv.org/abs/2111.09543).
170
+
171
+ The Rust realization layer uses
172
+ [`text-processing-rs`](https://github.com/FluidInference/text-processing-rs),
173
+ which is Apache-2.0 licensed. Required notices are retained in the source
174
+ repository.