Update PII detector model card

#1
by iamleonie - opened
.gitattributes CHANGED
@@ -35,4 +35,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  leaderboard.png filter=lfs diff=lfs merge=lfs -text
37
  leaderboard_18lang.png filter=lfs diff=lfs merge=lfs -text
38
- per_language_internal.png filter=lfs diff=lfs merge=lfs -text
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  leaderboard.png filter=lfs diff=lfs merge=lfs -text
37
  leaderboard_18lang.png filter=lfs diff=lfs merge=lfs -text
 
README.md CHANGED
@@ -53,13 +53,16 @@ base_model:
53
 
54
  # LFM2.5-Encoder-350-PII-Detector
55
 
56
- A full fine-tune of [LFM2.5-Encoder-350M](https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M) with a token-classification head, covering **40 PII types** across **16 languages**.
 
 
 
57
 
58
  Find more details about our encoders in our [blog post](https://www.liquid.ai/blog/lfm2-5-encoders).
59
 
60
  > [!NOTE]
61
  > 💻 **Demos**: Try this fine-tuned model running in a CPU-only Hugging Face space:
62
- > **[PII detection](https://huggingface.co/spaces/LiquidAI/pii-detection)** — spot and remove 40 kinds of personal information across 16 languages.
63
 
64
  ## Entity types (40 PII types across 11 domains)
65
 
@@ -79,25 +82,22 @@ Find more details about our encoders in our [blog post](https://www.liquid.ai/bl
79
 
80
  ## Benchmarks (18-locale-filtered, partial-F1, hybrid decode)
81
 
82
- | Benchmark | **this model** | detection tier | SauerkrautLM GLiNER | openai/privacy-filter | Piiranha-v1 | OpenMed privacy-filter | regex + validators |
83
- |---|---|---|---|---|---|---|---|
84
- | SPY | **0.428** | 0.509 | 0.280 | 0.264 | 0.232 | 0.226 | 0.358 |
85
- | Gretel | **0.880** | 0.885 | 0.663 | 0.458 | 0.553 | 0.770 | 0.337 |
86
- | TAB | **0.867** | 0.888 | 0.685 | 0.543 | 0.262 | 0.672 | 0.000 |
87
- | ai4privacy | **0.715** | 0.774 | 0.488 | 0.394 | 0.946 | 0.432 | 0.195 |
88
- | Nemotron | **0.855** | 0.863 | 0.639 | 0.572 | 0.658 | 0.918 | 0.335 |
89
- | MAPA | **0.236** | 0.267 | 0.416 | 0.288 | 0.228 | 0.164 | 0.000 |
 
 
 
90
 
91
  ![leaderboard](leaderboard_18lang.png)
92
 
93
- - **Best on every benchmark except MAPA**, whose idiosyncratic date-as-`date_of_birth` labeling
94
- convention penalises correctly-typed predictions. Only two external scores land higher
95
- anywhere — Piiranha-v1's 0.946 on ai4privacy and OpenMed's 0.918 on Nemotron — and both are
96
- in-distribution: each model trains on that exact corpus, as did our own encoder's pretraining
97
- on those same two.
98
- - **Detection tier** is the same model and the same predictions, scored with the type label
99
- ignored — did it find the PII span at all, which is the metric that matters for redaction. The
100
- gap to exact-type is the type-confusion rate, e.g. SPY 0.428 → 0.509.
101
 
102
  ## Usage
103
 
 
53
 
54
  # LFM2.5-Encoder-350-PII-Detector
55
 
56
+ A full fine-tune of [LFM2.5-Encoder-350M](https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M) with a token-classification head, covering **40 PII types** across **16 languages** (en, de, fr, es, pt, it, pl, ru, zh, ja, ko, ar, hi, id, vi, th).
57
+ Ships with an inference-timem**hybrid regex decode** (`pii_hybrid_decode.py`) that adds validator-gated formats (email/IBAN/credit-card/IP/JWT/…) and cue-gated IDs on top of the model.
58
+
59
+ Trained on a persona-driven, gemma-generated synthetic corpus (coherent locale-personas × scenarios × cue/inline/structured embedding × ID-contrastive disambiguation), LLM-judge-filtered and contamination-cleaned against all evaluation sets.
60
 
61
  Find more details about our encoders in our [blog post](https://www.liquid.ai/blog/lfm2-5-encoders).
62
 
63
  > [!NOTE]
64
  > 💻 **Demos**: Try this fine-tuned model running in a CPU-only Hugging Face space:
65
+ > [PII detection](https://huggingface.co/spaces/LiquidAI/pii-detection)** — spot and remove 40 kinds of personal information across 16 languages.
66
 
67
  ## Entity types (40 PII types across 11 domains)
68
 
 
82
 
83
  ## Benchmarks (18-locale-filtered, partial-F1, hybrid decode)
84
 
85
+ | Benchmark | **this model** | detection-tier | prev (v8) | GLiNER | LFM-demo-q4 |
86
+ |---|---|---|---|---|---|
87
+ | SPY | **0.428** | 0.509 | 0.351 | 0.280 | 0.192 |
88
+ | Gretel | **0.880** | 0.885 | 0.758 | 0.663 | 0.804 |
89
+ | TAB | **0.867** | 0.888 | 0.749 | 0.685 | 0.490 |
90
+ | ai4privacy | **0.715** | 0.774 | 0.643 | 0.488 | 0.500 |
91
+ | Nemotron | **0.855** | 0.863 | 0.773 | 0.639 | 0.656 |
92
+ | MAPA | **0.236** | 0.267 | 0.486 | 0.416 | 0.250 |
93
+ | Internal (40-type) | **0.720** | 0.829 | 0.616 | 0.479 | 0.466 |
94
+ | ShieldFlow | **0.901** | 0.911 | 0.847 | 0.646 | 0.839 |
95
+ | ShieldFlow-xl | **0.859** | 0.871 | 0.797 | 0.658 | 0.842 |
96
 
97
  ![leaderboard](leaderboard_18lang.png)
98
 
99
+ - **Best overall** across general/multilingual benchmarks and the ShieldFlow product gate; beats SauerkrautLM-GLiNER and the LFM demo on every benchmark except MAPA's idiosyncratic date-as-`date_of_birth` labeling convention.
100
+ - **Detection-tier** (did it find the PII span, ignoring fine type — the metric that matters for redaction) is markedly higher than exact-type, e.g. Internal 0.83 / ShieldFlow 0.91.
 
 
 
 
 
 
101
 
102
  ## Usage
103
 
leaderboard_18lang.png CHANGED

Git LFS Details

  • SHA256: e07a7e7a92156948ab7fa700a6aab58385588712f8559b92d8e0414c5a81bbd8
  • Pointer size: 131 Bytes
  • Size of remote file: 174 kB

Git LFS Details

  • SHA256: da826baa3ee36608bde022a59a18e3307904c3964c08e14b9a0a6980f864e2c6
  • Pointer size: 131 Bytes
  • Size of remote file: 123 kB
plots/candidates_comparison.png ADDED
plots/internal_v1/by_domain_f1.png ADDED
plots/internal_v1/by_edge_f1.png ADDED
plots/internal_v1/by_language_f1.png ADDED
plots/internal_v1/gap_probe_recall.png ADDED
plots/internal_v1/overall_summary.png ADDED
plots/internal_v1/partial_vs_exact.png ADDED
plots/internal_v1/per_type_f1.png ADDED
plots/v7/by_domain_f1.png ADDED
plots/v7/by_edge_f1.png ADDED
plots/v7/by_language_f1.png ADDED
plots/v7/gap_probe_recall.png ADDED
plots/v7/overall_summary.png ADDED
plots/v7/partial_vs_exact.png ADDED
plots/v7/per_type_f1.png ADDED
plots/v8/by_domain_f1.png ADDED
plots/v8/by_edge_f1.png ADDED
plots/v8/by_language_f1.png ADDED
plots/v8/gap_probe_recall.png ADDED
plots/v8/overall_summary.png ADDED
plots/v8/partial_vs_exact.png ADDED
plots/v8/per_type_f1.png ADDED
plots/vs_external.png ADDED