YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
---
license: apache-2.0
library_name: transformers
pipeline_tag: token-classification
base_model: distilbert-base-cased
tags:
- pii
- ner
- privacy
---
# PII Detector (DistilBERT v2)
Token-classification model that tags PERSON, EMAIL, PHONE, SSN, CREDIT_CARD, and IP_ADDRESS spans with BIO labels. Fine-tuned from distilbert-base-cased on 8,000 synthetic, template-generated examples.
Intended use: as the candidate-finding stage of a pipeline where format validators (Luhn checksum for cards, structural rules for SSNs and IPs) confirm structured types. Code, evaluation, and the FastAPI service are at https://github.com/chadtollison/PII-Detector
## Results (span-level exact match, 1,000-example held-out set with unseen templates and names)
| Setup | Precision | Recall | F1 |
|---|---|---|---|
| Model alone | 0.97 | 0.98 | 0.97 |
| Model + validators | 0.98 | 0.98 | 0.98 |
## Limitations
- Trained and tested only on synthetic data; real-world text will be harder.
- US formats only (SSN, phone numbers, Visa prefix).
- Cannot verify checksums itself; pair it with validators for card numbers.
- Capitalized words at the start of a sentence are sometimes tagged as names.
- Downloads last month
- 19