Skip to content

Commit 26e0802

Browse files
Sid Mohanclaude
andcommitted
Remove ETHNICITY, GENETIC_DATA, TRADE_UNION from entity taxonomy
These types are not span-extractable by NER: ethnicity is inferred from context, genetic data is structured lab results, and trade union membership is a document-level fact. Reduces taxonomy from 44 to 41 entity types (83 BIO labels). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ceb94e2 commit 26e0802

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Open research and development for lightweight PII detection models. This repo co
66

77
## PII-NER v1
88

9-
A 22.7M parameter model for detecting 44 types of personally identifiable information in English text. Combines a pretrained DeBERTa-v3-xsmall backbone with a character CNN encoder, adaptive gating fusion, and CRF output layer.
9+
A 22.7M parameter model for detecting 41 types of personally identifiable information in English text. Combines a pretrained DeBERTa-v3-xsmall backbone with a character CNN encoder, adaptive gating fusion, and CRF output layer.
1010

1111
```
1212
Input Text
@@ -104,7 +104,7 @@ See [eval_benchmark.md](pii-ner-v1/docs/eval_benchmark.md) for flags and options
104104
| [NVIDIA Nemotron-PII](https://huggingface.co/datasets/nvidia/Nemotron-PII) | ~100K examples | CC-BY-4.0 |
105105
| [Gretel Synthetic PII Finance](https://huggingface.co/datasets/gretelai/synthetic_pii_finance_multilingual) | ~56K examples | Apache 2.0 |
106106

107-
Combined: ~169K English examples after filtering and dedup. 44 canonical entity types across 4 sensitivity tiers, unified into 89 BIO labels. The dataset has a 323x frequency imbalance (DATE: 170K occurrences vs PASSPORT: 526), which drives many of the training innovations below.
107+
Combined: ~169K English examples after filtering and dedup. 41 canonical entity types across 4 sensitivity tiers, unified into 83 BIO labels. The dataset has a 323x frequency imbalance (DATE: 170K occurrences vs PASSPORT: 526), which drives many of the training innovations below.
108108

109109
## Documentation
110110

@@ -149,7 +149,7 @@ Key finding: no published work combines differentiable character-level pattern r
149149
## Open problems
150150

151151
- **Tier 1 recall gap**: 0.823 vs 0.98 target. Passport number (0.426 F1) has only 526 training examples.
152-
- **16 zero-occurrence entity types**: NATIONALITY, ETHNICITY, RELIGION, etc. exist in the taxonomy but no training data covers them.
152+
- **13 zero-occurrence entity types**: NATIONALITY, RELIGION, MARITAL_STATUS, etc. exist in the taxonomy but no training data covers them.
153153
- **Head instability**: Root cause of the epoch 3+ training spike is unknown. Gradient clipping, per-component LR decay, or early stopping are candidate fixes.
154154
- **ONNX export**: CRF Viterbi decode doesn't export cleanly; needs pure-PyTorch reimplementation.
155155

pii-ner-v1/src/datafog_pii_ner/data/label_schema.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"AGE",
3636
"NATIONALITY",
3737
"GENDER",
38-
"ETHNICITY",
3938
"RELIGION",
4039
"MARITAL_STATUS",
4140
]
@@ -60,8 +59,6 @@
6059
"POLITICAL_AFFILIATION",
6160
"SEXUAL_ORIENTATION",
6261
"HEALTH_CONDITION",
63-
"GENETIC_DATA",
64-
"TRADE_UNION",
6562
]
6663

6764
ALL_ENTITY_TYPES = TIER_1 + TIER_2 + TIER_3 + TIER_4
@@ -150,7 +147,6 @@ def build_label_weights(tier_weights: dict[int, float] | None = None) -> list[fl
150147
"GENDER": "GENDER",
151148
"AGE": "AGE",
152149
"NATIONALITY": "NATIONALITY",
153-
"ETHNICITY": "ETHNICITY",
154150
"RELIGION": "RELIGION",
155151
"MARITAL_STATUS": "MARITAL_STATUS",
156152
"POLITICAL_AFFILIATION": "POLITICAL_AFFILIATION",

0 commit comments

Comments
 (0)