# 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
90
Safetensors
Model size
65.2M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ChadTollison/pii-distilbert-v2

Finetuned
(350)
this model