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.

Synthetic Data & Clinical Safety Notice: All clinical note presets on this page are 100% synthetic (zero real patient records). Automated PHI de-identification is an assistive screening tool and requires human review before HIPAA Safe Harbor release.

At a glance

Model identity, architecture, BILOU labels, quantisation and runtime
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

Redaction mode
Filter active HIPAA PHI categories (11 i2b2 classes)

Prepare the model above to start PHI detection.

Backend Β· dtype–
Latency–
WordPiece tokens–
Detected PHI spans–
Redacted replacements–
NaN count–

Detected HIPAA PHI spans

Run detection to highlight PHI spans by category.

Scrubbed output ([CATEGORY_N] Tag)

Redacted note will appear here.

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.

Raw WordPiece tokens with BILOU predictions, confidence scores, and character offsets
# WordPiece BILOU Tag Category Score Offsets
Run detection to inspect WordPiece BILOU tokens.

Use-case ladder

How it works

Show the code β€” off-main-thread BILOU token classification and truncation check in worker.js
Show the code β€” deterministic Tag / Block / Synthetic Surrogate redaction in deid-core.mjs

References