Why Names Are Harder to Mask than Numbers — and What a Model Buys You
An ID number has a shape: fixed length, a checksum, often a prefix. A person's name has none. "Ada" is a name, a verb, a brand and a build tool. Heuristic matching produces either noise or silence.
What patterns can do
Patterns are excellent where structure exists: emails (RFC-shape), phone numbers (per-country shapes), card numbers (Luhn), national IDs (checksums). For these, a deterministic rule is better than a model — it is auditable, instant, and works offline.
What a model can do that a rule cannot
A Named-Entity-Recognition model trained on a corpus like CoNLL-03 learned the context a name appears in: capitalised tokens next to verbs like "joined", "shared", "reported". PII Shield runs such a model — a quantized DistilBERT NER (~66 MB, downloaded once from a public CDN) — inside your browser via transformers.js. No page text is uploaded; by affirming that boundary, the model is no worse a risk than a regex.
The honest limitation
Quantized and modest, this model misses uncommon or non-English names, and it is never a substitute for ticking "mask all names" when you mean it. What it is: a two-tone pass that finds most names in ordinary documents that a pattern cannot see at all. The verification step after masking is the part that matters — it tells you what actually left the output, not what was intended.
How to actually use the two layers
In practice: paste the document and mask immediately — the pattern and ID layers need no download, so names are the only thing missing. Then enable name detection, wait once for the model, and re-scan; new findings appear inline with a confidence score so you can tell a high-precision rule match from a model guess. Untick any group you want to keep. The verify step runs against whatever groups you selected, so the summary always describes the output you will actually send — not an idealised version of it.
How the pipeline runs
Four layers, merged once: pattern detectors (emails, cards, keys),
country ID rules, phone shapes, and the NER model for people, organisations
and places. Each layer reports spans with a confidence; the merge is by
span, not by detector, so overlapping findings collapse into one token
instead of four. Tokens are consistent within a pass — the same email
becomes the same <EMAIL_1> everywhere — and alias
grouping collapses two mentions of one person into one token. The masked
output is then re-scanned: that is the verify step, and the summary reports
whether the result is clean or names what survived.
Layered on purpose
Findings from the three layers (patterns, ID rules, NER) are merged on overlap: two detectors that found the same characters produce one finding. The merge is by span, not by detector id — the number of layers retains no influence over how the result is grouped.
Everything on this page runs in your browser — open PII Shield and paste the document you are about to send.