Instructions to use Deerpark/pii-tagger-hipaa-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use Deerpark/pii-tagger-hipaa-large with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("Deerpark/pii-tagger-hipaa-large") text = "Cristiano Ronaldo dos Santos Aveiro was born on 5 February 1985 in Funchal, Madeira, Portugal." labels = ["person", "date", "location"] entities = model.predict_entities(text, labels) for entity in entities: print(entity["text"], "=>", entity["label"]) - Notebooks
- Google Colab
- Kaggle
PII Tagger HIPAA Large
A 440M-parameter GLiNER span tagger (DeBERTa-v3-large) for the identifiers HIPAA's Safe Harbor method lists, in clinical text. It gives their exact positions and writes no text. Beyond the small HIPAA model's labels, it is also asked for dates, ages over 89 and unique characteristics, which only rules looked for before.
It is one of three readers in veil's larger HIPAA system, for libraries and servers. The other two are Deerpark/pii-tagger-hipaa (45M) and the listing reader Deerpark/pii-lister-hipaa. The figures below are for the three together, beside veil's HIPAA rules; it wasn't chosen to be used alone.
Use
from gliner import GLiNER
model = GLiNER.from_pretrained("Deerpark/pii-tagger-hipaa-large")
LABELS = ["name", "street address", "postcode", "email address", "phone number", "ssn", "account number",
"credit card number", "iban", "swift code", "date of birth", "customer id", "employee id", "username",
"passport number", "driver license number", "tax id",
"employer", "town or county", "other identifying number", "date", "age over 89", "unique characteristic"]
model.predict_entities(text, LABELS, threshold=0.20)
- Ask with these label names. The last six are this model's own (
veil_labelsingliner_config.json); it is asked fortown or countyinstead ofcity. Medical record and health plan numbers come back ascustomer id. - 0.20 is the threshold chosen on dev for the three readers together.
- Give it up to about 200 words at a time, split on whole lines.
In veil, HipaaLargeRedactor runs it with the other two readers beside
the HIPAA profile's rules.
Results
The three readers with veil's HIPAA rules, scored once on a sealed test of 960 agent-written clinical documents (10,955 identifiers), written before any of them was trained. Found: every word of an identifier hidden. Audited: blind reviewers ruled on every miss, and a mark they judged not an identifier, or a miss that left only a label or article showing, is corrected. Other words hidden: of the words no mark covers.
| System | Found | Found, audited | Documents fully de-identified | Other words hidden |
|---|---|---|---|---|
| rules + pii-tagger-hipaa | 97.05% | 98.32% | 73.4% | 3.92% |
| rules + the three readers | 99.32% | 99.87% | 92.6% | 4.45% |
Found rose by 2.27 points (+1.96 to +2.59; 2,000 resamples of documents). Counting the six debatable misses as found, the audited figure is 99.93%. On dev, this tagger with the rules alone found 99.51%, against 98.61% for the rules with the small model, while hiding fewer other words (4.27% against 4.76%). That option wasn't tested on the sealed test.
Every test document is agent-written, as the training documents are; how this carries to real notes hasn't been measured.
Training
From knowledgator/gliner-pii-large-v1.0, four 500-step segments, each continuing the last (batch 8, learning rates 1e-5 and 2e-5, focal loss 0.75 and 2, bf16). 15 of the 2,000 batches were skipped because they didn't fit in GPU memory. The training mix:
- Agent-written clinical documents (1,600 from the training writers, less 3 too close to a test, plus a spent sealed test of 960, less 6), each taken twice: discharge summaries, emergency and EMS notes, clinic notes, letters, lab and device reports, nursing and hospice notes, billing and claims, patient messages, in English and some Spanish, with every identifier marked; all invented. No training document shares more than a fifth of its 8-word runs with any dev or test document.
- The same documents in capitals or OCR-misread.
- Nemotron-PII's healthcare and pharmaceutical documents (train split), © NVIDIA, CC BY 4.0.
- Case reports from the PubMed Central open-access subset, under CC BY or CC0. Each article remains under its own
licence; the list of PMCIDs and licences is in veil's repository (
benchmarks/train/clinical/pmc_raw/reports.jsonl). - Replay: a third of the mix, round 7's training chunks and judged chat turns, so the general labels stay found.
The protocol, the data and the scripts are in veil's repository (benchmarks/judged/PROTOCOL.md, "A larger HIPAA
model"; benchmarks/hipaa_large.py).
- Downloads last month
- -
Model tree for Deerpark/pii-tagger-hipaa-large
Base model
knowledgator/gliner-pii-large-v1.0