yungisimon commited on
Commit
e86f68c
·
verified ·
1 Parent(s): 983a9a7

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +25 -38
README.md CHANGED
@@ -5,23 +5,20 @@ pipeline_tag: token-classification
5
  tags: [pii, ner, privacy, multilingual, token-classification]
6
  ---
7
 
8
- # LiquidAI/pii-detect (v14)
9
 
10
- Multilingual PII detection — a full fine-tune of the bidirectional **LFM2.5-350M** MLM
11
- encoder with a token-classification head, covering **40 PII types** across **16 languages**
12
- (en, de, fr, es, pt, it, pl, ru, zh, ja, ko, ar, hi, id, vi, th). Ships with an
13
- inference-time **hybrid regex decode** (`pii_hybrid_decode.py`) that adds validator-gated
14
- formats (email/IBAN/credit-card/IP/JWT/…) and cue-gated IDs on top of the model, fixing
15
- byte-BPE boundary fragmentation.
16
 
17
- **v14** is trained on a persona-driven, gemma-generated synthetic corpus (coherent
18
- locale-personas × scenarios × cue/inline/structured embedding, LLM-judge-filtered,
19
- contamination-cleaned against all eval sets).
20
 
21
  ## Entity types (40 PII types across 11 domains)
22
 
23
- The model emits canonical `type` labels (BIOES token classification + an inference-time hybrid regex decode for format-bound types). Full label set:
24
-
25
  | Domain | Types |
26
  |---|---|
27
  | **Identity** | `identity.person_name`, `identity.ssn`, `identity.national_id`, `identity.passport`, `identity.drivers_license`, `identity.date_of_birth`, `identity.tax_id` |
@@ -38,34 +35,25 @@ The model emits canonical `type` labels (BIOES token classification + an inferen
38
 
39
  ## Benchmarks (18-locale-filtered, partial-F1, hybrid decode)
40
 
41
- Comparison vs the prior release (v8) and external models (SauerkrautLM-LFM2.5-GLiNER, the
42
- LFM ShieldFlow demo q4). All on identical, contamination-cleaned, 16-language splits.
43
-
44
- | Benchmark | **v14** | v8 (prev) | GLiNER | LFM-demo-q4 |
45
- |---|---|---|---|---|
46
- | SPY | **0.388** | 0.351 | 0.280 | 0.192 |
47
- | Gretel | **0.765** | 0.758 | 0.663 | 0.804 |
48
- | TAB | **0.789** | 0.749 | 0.685 | 0.490 |
49
- | ai4privacy | **0.557** | 0.643 | 0.488 | 0.500 |
50
- | Nemotron | **0.782** | 0.773 | 0.639 | 0.656 |
51
- | MAPA | **0.157** | 0.486 | 0.416 | 0.250 |
52
- | Internal (40-type) | **0.628** | 0.616 | 0.479 | 0.466 |
53
- | ShieldFlow proxy | **0.838** | 0.847 | 0.646 | 0.839 |
54
- | ShieldFlow proxy-xl | **0.841** | 0.797 | 0.658 | 0.842 |
55
 
56
  ![leaderboard](leaderboard_18lang.png)
57
 
58
- ### Honest notes
59
- - **v14 beats both external models** (GLiNER, LFM-demo) on the general/multilingual
60
- benchmarks (TAB, Nemotron, Internal, SPY, Gretel) and **matches the LFM-demo on its own
61
- ShieldFlow distribution**, where it is the in-distribution incumbent.
62
- - **Two regressions vs v8** to be transparent about: **MAPA** (v14 0.157 vs v8 0.486) — a
63
- benchmark-convention conflict (MAPA labels citation dates as `date_of_birth`, which
64
- conflicts with TAB where dates are not PII; v14 follows the standard convention) — and
65
- **ai4privacy** (v14 0.557 vs v8 0.643; note ai4privacy is in the backbone's pretraining).
66
- - **Detection-tier** (does it find the PII span, ignoring fine type — the metric that
67
- matters for redaction) is markedly higher than exact-type across the board (≈0.77–0.85
68
- internal/general), i.e. the strict per-type F1 understates real detection.
69
 
70
  ## Usage
71
  ```python
@@ -77,5 +65,4 @@ hd = importlib.util.module_from_spec(spec); spec.loader.exec_module(hd)
77
  tok = AutoTokenizer.from_pretrained("LiquidAI/pii-detect", trust_remote_code=True)
78
  m = AutoModelForTokenClassification.from_pretrained("LiquidAI/pii-detect", trust_remote_code=True).eval()
79
  spans = hd.predict("Email Dr. Laura Schmidt at [email protected] about Marco Bianchi.", tok, m)
80
- # -> [{'type':'identity.person_name','text':'Laura Schmidt',...}, {'type':'contact.email',...}, ...]
81
  ```
 
5
  tags: [pii, ner, privacy, multilingual, token-classification]
6
  ---
7
 
8
+ # LiquidAI/pii-detect
9
 
10
+ Multilingual PII detection — a full fine-tune of a **bidirectional LFM2.5 phase-2 MLM encoder**
11
+ with a token-classification head, covering **40 PII types** across **16 languages**
12
+ (en, de, fr, es, pt, it, pl, ru, zh, ja, ko, ar, hi, id, vi, th). Ships with an inference-time
13
+ **hybrid regex decode** (`pii_hybrid_decode.py`) that adds validator-gated formats
14
+ (email/IBAN/credit-card/IP/JWT/…) and cue-gated IDs on top of the model.
 
15
 
16
+ Trained on a persona-driven, gemma-generated synthetic corpus (coherent locale-personas ×
17
+ scenarios × cue/inline/structured embedding × ID-contrastive disambiguation), LLM-judge-filtered
18
+ and contamination-cleaned against all evaluation sets.
19
 
20
  ## Entity types (40 PII types across 11 domains)
21
 
 
 
22
  | Domain | Types |
23
  |---|---|
24
  | **Identity** | `identity.person_name`, `identity.ssn`, `identity.national_id`, `identity.passport`, `identity.drivers_license`, `identity.date_of_birth`, `identity.tax_id` |
 
35
 
36
  ## Benchmarks (18-locale-filtered, partial-F1, hybrid decode)
37
 
38
+ | Benchmark | **this model** | detection-tier | prev (v8) | GLiNER | LFM-demo-q4 |
39
+ |---|---|---|---|---|---|
40
+ | SPY | **0.428** | 0.509 | 0.351 | 0.280 | 0.192 |
41
+ | Gretel | **0.880** | 0.885 | 0.758 | 0.663 | 0.804 |
42
+ | TAB | **0.867** | 0.888 | 0.749 | 0.685 | 0.490 |
43
+ | ai4privacy | **0.715** | 0.774 | 0.643 | 0.488 | 0.500 |
44
+ | Nemotron | **0.855** | 0.863 | 0.773 | 0.639 | 0.656 |
45
+ | MAPA | **0.236** | 0.267 | 0.486 | 0.416 | 0.250 |
46
+ | Internal (40-type) | **0.720** | 0.829 | 0.616 | 0.479 | 0.466 |
47
+ | ShieldFlow | **0.901** | 0.911 | 0.847 | 0.646 | 0.839 |
48
+ | ShieldFlow-xl | **0.859** | 0.871 | 0.797 | 0.658 | 0.842 |
 
 
 
49
 
50
  ![leaderboard](leaderboard_18lang.png)
51
 
52
+ - **Best overall** across general/multilingual benchmarks and the ShieldFlow product gate; beats
53
+ SauerkrautLM-GLiNER and the LFM demo on every benchmark except MAPA's idiosyncratic
54
+ date-as-`date_of_birth` labeling convention.
55
+ - **Detection-tier** (did it find the PII span, ignoring fine type — the metric that matters for
56
+ redaction) is markedly higher than exact-type, e.g. Internal 0.83 / ShieldFlow 0.91.
 
 
 
 
 
 
57
 
58
  ## Usage
59
  ```python
 
65
  tok = AutoTokenizer.from_pretrained("LiquidAI/pii-detect", trust_remote_code=True)
66
  m = AutoModelForTokenClassification.from_pretrained("LiquidAI/pii-detect", trust_remote_code=True).eval()
67
  spans = hd.predict("Email Dr. Laura Schmidt at [email protected] about Marco Bianchi.", tok, m)
 
68
  ```