v13: production-engine score added, hivetrace ru F1 0.59->0.80, MUST 21/21
Browse files- README.md +57 -31
- onnx/model_quantized.onnx +1 -1
- special_tokens_map.json +15 -0
- tokenizer_config.json +55 -0
README.md
CHANGED
|
@@ -32,46 +32,67 @@ does (see `touch_rate` below).
|
|
| 32 |
|
| 33 |
## Verified results
|
| 34 |
|
| 35 |
-
Gate run 2026-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
| | this model |
|
| 38 |
|---|---|---|
|
| 39 |
-
| **regex-owned identifiers wrongly touched** (real ru text) | **0.
|
| 40 |
-
| **known-defect suite** | **
|
| 41 |
-
| hivetrace ru PII — F1 / P / R | 0.
|
| 42 |
-
| Wojood ar NER — F1 | 0.
|
| 43 |
-
|
|
| 44 |
-
| int8
|
| 45 |
-
|
|
| 46 |
-
|
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
## Read this before using it
|
| 53 |
|
| 54 |
-
**Recall was traded for precision
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
**
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
`вадим бельский из клиники «Здоровье»` it returns `клиники` (the common noun
|
| 64 |
-
"clinic") rather than the quoted name `«Здоровье»`. It finds an organisation is
|
| 65 |
-
present; it does not always choose the right span.
|
| 66 |
|
| 67 |
**Trained only on synthetic data.** Entity pools are finite, so scores on
|
| 68 |
-
generated text overstate real-world ability
|
| 69 |
-
|
| 70 |
-
benchmarks above, not the synthetic figure.
|
| 71 |
|
| 72 |
**Arabizi is a reconstruction.** No corpus contains it; its conventions
|
| 73 |
(3=ain, 7=haa, 2=hamza) are our model of how people type, not observed data.
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
## Use
|
| 76 |
|
| 77 |
Three files: `config.json`, `tokenizer.json`, `onnx/model_quantized.onnx`.
|
|
@@ -93,14 +114,19 @@ logits = sess.run(None, {i.name: enc[i.name] for i in sess.get_inputs()})[0]
|
|
| 93 |
# argmax -> id2label -> merge BIO spans using `offsets` for character positions
|
| 94 |
```
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
Pair it with a regex/checksum layer for the structured identifiers it
|
| 97 |
deliberately ignores.
|
| 98 |
|
| 99 |
## Training data
|
| 100 |
|
| 101 |
-
`ScienceSoft/scnsoft-pii-synthetic-corpus` —
|
| 102 |
-
|
| 103 |
-
|
| 104 |
|
| 105 |
## Licence
|
| 106 |
|
|
|
|
| 32 |
|
| 33 |
## Verified results
|
| 34 |
|
| 35 |
+
Gate run 2026-09-03 (internal build v13), scored through the production Rust
|
| 36 |
+
inference engine, not a Python decode of the same ONNX. Every figure measured,
|
| 37 |
+
none estimated.
|
| 38 |
|
| 39 |
+
| | this model | previously shipped |
|
| 40 |
|---|---|---|
|
| 41 |
+
| **regex-owned identifiers wrongly touched** (real ru text) | **0.0%** (0/770) | 0.1% (1/770) |
|
| 42 |
+
| **known-defect suite** | **21/21** | 18/18 |
|
| 43 |
+
| hivetrace ru PII — F1 / P / R | 0.8036 / 0.6888 / **0.9643** | 0.5888 / 0.4375 / 0.9000 |
|
| 44 |
+
| Wojood ar NER — F1 / P / R | 0.4945 / 0.6143 / 0.4137 | 0.4888 / — / — |
|
| 45 |
+
| production-engine filtered F1 (held-out synthetic) | **0.8563** | 0.7357 |
|
| 46 |
+
| int8 F1 (held-out synthetic, Python decode) | 0.9321 | 0.8906 |
|
| 47 |
+
| int8 vs fp32 F1 cost | 0.0025 | 0.0081 |
|
| 48 |
+
| latency p95 @512 tok (CPU) | 193.4 ms | 190.9 ms |
|
| 49 |
+
| name-origin bias delta | 0.0469 | 0.0312 |
|
| 50 |
+
|
| 51 |
+
Head-to-head vs the incumbent it replaces (`onnx-community/multilang-pii-ner-ONNX`,
|
| 52 |
+
PERSON only, WikiANN), ours ahead in every language: es +0.56 · it +0.53 ·
|
| 53 |
+
en +0.55 · fr +0.51 · de +0.51 · ar +0.51 · ru +0.12 (95% CI entirely above the
|
| 54 |
+
`-0.02` no-regression floor for every language).
|
| 55 |
+
|
| 56 |
+
**The production-engine number is new in this run and is the one that matters.**
|
| 57 |
+
Earlier cards quoted only a Python decode of the ONNX graph — the actual Rust
|
| 58 |
+
inference engine (chunking, tokenizer template, span filtering) had never been
|
| 59 |
+
scored directly, and doing so once already surfaced and fixed a real skew (the
|
| 60 |
+
engine was dropping the `<s>`/`</s>` special tokens the model was trained with).
|
| 61 |
+
0.8563 is what the shipped agent actually emits on held-out synthetic text.
|
| 62 |
+
|
| 63 |
+
**Latency and bias moved slightly against this model, both still inside
|
| 64 |
+
budget.** p95 latency rose 2.5 ms (ceiling is 200 ms) and bias delta rose 0.0157
|
| 65 |
+
(budget is 0.05). Neither regression is large enough to matter on its own; noted
|
| 66 |
+
for anyone tracking the trend across runs rather than a single gate pass.
|
| 67 |
|
| 68 |
## Read this before using it
|
| 69 |
|
| 70 |
+
**Recall was traded for precision, then partly traded back.** The previously
|
| 71 |
+
shipped model already cut false positives on structured identifiers roughly
|
| 72 |
+
500× versus its own predecessor (53.6% → 0.1% touch rate); this run holds that
|
| 73 |
+
line at 0.0% while also lifting real Russian PII recall 0.90 → 0.96 and F1
|
| 74 |
+
0.5888 → 0.8036 — the biggest jump this model line has made on real text in one
|
| 75 |
+
step.
|
| 76 |
|
| 77 |
+
**Organisation boundaries are still imperfect.** Wojood F1 is barely moved
|
| 78 |
+
(0.4888 → 0.4945) and organisation spans remain the weakest category on real
|
| 79 |
+
Arabic text — expect it to sometimes find that an organisation is present
|
| 80 |
+
without choosing the exact right span.
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
**Trained only on synthetic data.** Entity pools are finite, so scores on
|
| 83 |
+
generated text overstate real-world ability. Judge it on the external
|
| 84 |
+
benchmarks above (hivetrace, Wojood), not the synthetic figure.
|
|
|
|
| 85 |
|
| 86 |
**Arabizi is a reconstruction.** No corpus contains it; its conventions
|
| 87 |
(3=ain, 7=haa, 2=hamza) are our model of how people type, not observed data.
|
| 88 |
|
| 89 |
+
**DATE_TIME scores 0.000 in the production-filtered number by design, not by
|
| 90 |
+
defect.** The production filter keeps a date span only next to an explicit
|
| 91 |
+
birth-context cue (`born on`, `DOB:`, …); this eval corpus carries none, so
|
| 92 |
+
every date the model correctly finds is filtered back out before it reaches
|
| 93 |
+
the number above. It is not gated and should not be read as a date-detection
|
| 94 |
+
failure — see `precision.rs`'s date-context rule in the agent's source.
|
| 95 |
+
|
| 96 |
## Use
|
| 97 |
|
| 98 |
Three files: `config.json`, `tokenizer.json`, `onnx/model_quantized.onnx`.
|
|
|
|
| 114 |
# argmax -> id2label -> merge BIO spans using `offsets` for character positions
|
| 115 |
```
|
| 116 |
|
| 117 |
+
**Include `<s>`/`</s>` in the tokenizer call for full-fidelity results** — this
|
| 118 |
+
is what closed most of the gap between the Python-decode number and the
|
| 119 |
+
production-engine number above. `AutoTokenizer.__call__` does this by default;
|
| 120 |
+
only a hand-rolled encode path that skips special tokens needs to add them back.
|
| 121 |
+
|
| 122 |
Pair it with a regex/checksum layer for the structured identifiers it
|
| 123 |
deliberately ignores.
|
| 124 |
|
| 125 |
## Training data
|
| 126 |
|
| 127 |
+
`ScienceSoft/scnsoft-pii-synthetic-corpus` — fully synthetic, no real person's
|
| 128 |
+
data. A meaningful share of rows contain no entity at all; those entity-free
|
| 129 |
+
negatives are what keeps `touch_rate` near zero.
|
| 130 |
|
| 131 |
## Licence
|
| 132 |
|
onnx/model_quantized.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 278234412
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e7189f37871b9d261edc9f8a771651459b4e20a3d23506100d10e3ed7a10ff1
|
| 3 |
size 278234412
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<s>",
|
| 3 |
+
"cls_token": "<s>",
|
| 4 |
+
"eos_token": "</s>",
|
| 5 |
+
"mask_token": {
|
| 6 |
+
"content": "<mask>",
|
| 7 |
+
"lstrip": true,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false
|
| 11 |
+
},
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"unk_token": "<unk>"
|
| 15 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<s>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"250001": {
|
| 36 |
+
"content": "<mask>",
|
| 37 |
+
"lstrip": true,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"bos_token": "<s>",
|
| 45 |
+
"clean_up_tokenization_spaces": false,
|
| 46 |
+
"cls_token": "<s>",
|
| 47 |
+
"eos_token": "</s>",
|
| 48 |
+
"extra_special_tokens": {},
|
| 49 |
+
"mask_token": "<mask>",
|
| 50 |
+
"model_max_length": 512,
|
| 51 |
+
"pad_token": "<pad>",
|
| 52 |
+
"sep_token": "</s>",
|
| 53 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
| 54 |
+
"unk_token": "<unk>"
|
| 55 |
+
}
|