use case · basics · 11 HIPAA PHI categories · BILOU · Recall vs Precision

Inside Clinical DeID-BERT: BILOU subwords & recall thresholds

Why does a clinical de-identifier predict 45 tags instead of 11, how do fragmented WordPiece subwords like Jen + ##kins or 555 + - + 867 reassemble, and why do clinical pipelines tune thresholds for recall over precision?

Synthetic Data & Clinical Safety Notice: All clinical notes and annotated gold spans below are 100% synthetic (zero real patient records). Automated PHI de-identification is an assistive screening tool that requires human review before HIPAA Safe Harbor release.

1 · Model runtime

Prepare the model to run live BILOU & threshold probes.

2 · i2b2 / HIPAA PHI tag taxonomy (11 categories × BILOU = 45 labels)

Each of the 11 entity types has four positional prefixes — B- (Begin), I- (Inside), L- (Last), U- (Unit single-token) — plus shared O (Outside). Notice the training skew in the i2b2 2014 corpus: DATE has 7,502 training spans while EMAIL (4) and OTHERPHI (2) are rare.

All 11 i2b2 HIPAA PHI categories with train/test counts and descriptions
Category Group HIPAA / i2b2 mapping i2b2 Train / Test Synthetic example

3 · Subword BILOU merging lab

Raw WordPiece tokens (non-O)

Waiting for model…

Merged BILOU spans

Waiting for model…
Merged BILOU entity spans with pattern and subword counts
Span Category BILOU Pattern Subwords Score

4 · Recall-vs-precision threshold sweep (0.30 → 0.95)

In clinical de-identification, a false negative leaks patient PHI whereas a false positive merely over-redacts a word. Run the sweep on the annotated synthetic note below and drag the threshold slider to see how missed PHI spans rise as the confidence bar increases.

Threshold–
Measured Recall–
Measured Precision–
F1 Score–
Missed PHI (FN)–

Confidence threshold sweep from 0.30 to 0.95 on synthetic clinical note
Threshold TP / Gold FP Missed PHI (FN) Recall Precision F1
Run the threshold sweep to populate live metrics.

How it works

Show the code — BILOU state transitions, ## subword merging, and punctuation bridging
Show the code — computing Recall, Precision, and F1 across confidence thresholds