token-classification Β· clinical NLP Β· WASM q8 Β· 108.51 MB Β· 45 BILOU labels Β· MIT
Clinical DeID-BERT β local HIPAA PHI redaction in the browser
A Bio_ClinicalBERT encoder fine-tuned on the i2b2/UTHealth 2014 de-identification corpus to tag
11 HIPAA Protected Health Information categories (PATIENT, STAFF, HOSP,
DATE, AGE, PHONE, ID, LOC, PATORG,
EMAIL, OTHERPHI) using 45 BILOU labels β running privately on your device via WebAssembly.
At a glance
| Upstream model | obi/deid_bert_i2b2 |
|---|---|
| Browser ONNX build | onnx-community/deid_bert_i2b2-ONNX Β· onnx/model_quantized.onnx |
| Task / pipeline | token-classification with { ignore_labels: [] } β 45 BILOU tags merged into spans |
| Architecture | BertForTokenClassification (from emilyalsentzer/Bio_ClinicalBERT) Β· 12 layers Β· 12 heads Β· hidden 768 Β· 28,996 cased WordPiece vocab |
| Sequence length | 512 WordPiece tokens max (trained on 128-token sentences with 32-token left/right context) |
| Quantisation & size | q8 Β· 108.51 MB (108,507,617 B) + 0.67 MB tokenizer, cached by Transformers.js |
| Backend | WebAssembly (CPU, shared Transformers.js 3.7.5) β runs off the main thread in a Web Worker |
| License | MIT |
Interactive clinical PHI de-identification & Safe-Harbor lab
Prepare the model above to start PHI detection.
Detected HIPAA PHI spans
Scrubbed output ([CATEGORY_N] Tag)
See inside: raw BILOU WordPiece tokens & scores
DeID-BERT uses BILOU (B- Begin, I- Inside, L- Last,
U- Unit, O Outside) over cased WordPiece subwords. Inspecting raw tokens reveals how
## continuations and multi-token spans merge β and why subwords occasionally split a name or ID.
| # | WordPiece | BILOU Tag | Category | Score | Offsets |
|---|---|---|---|---|---|
| Run detection to inspect WordPiece BILOU tokens. | |||||
Use-case ladder
Basics Β· BILOU & thresholds
Explore all 11 i2b2 PHI classes, watch BILOU + WordPiece merging on clinician names & MRNs, and sweep thresholds (0.30 β 0.95) for high-recall screening.
Practical Β· Batch scrubber
Upload .txt/.md/.csv/.json synthetic note queues, process off-thread with mid-batch cancel, and export scrubbed notes + formula-safe CSV audit logs.
Wild Β· Leakage stress-tester
Stress-test lowercase dictation, missing punctuation, Dr./DOB shorthand, and OCR typos to measure real PHI leakage and missed spans.
Multi-model Β· Scrub β clinical NLI
Stage 1 scrubs PHI locally; Stage 2 (DeBERTa-v3 NLI) triages only the sanitized note into specialty/urgency queues with zero-PHI handoff verification.