CoolFace
Modelpublic

mkocher/hipaa-phi-detector

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
1likes9downloads
Model Card

HIPAA PHI Detector (DistilBERT)

A fine-tuned DistilBERT model for detecting Protected Health Information (PHI) in text, covering all 18 HIPAA Safe Harbor categories.

Model Details

  • Architecture: DistilBERT (66M params) with token classification head
  • Training: Fine-tuned on 5,000+ synthetic HIPAA examples
  • Labels: 37 BIO labels (18 entity types x 2 + O)
  • Framework: PyTorch / HuggingFace Transformers

Supported Entity Types

LabelHIPAA Category
NAMENames
LOCATIONGeographic subdivisions
DATEDates
PHONEPhone numbers
FAXFax numbers
EMAILEmail addresses
SSNSocial Security numbers
MRNMedical record numbers
HEALTH_PLANHealth plan beneficiary numbers
ACCOUNTAccount numbers
LICENSECertificate/license numbers
VEHICLEVehicle identifiers
DEVICEDevice identifiers
URLWeb URLs
IPIP addresses
BIOMETRICBiometric identifiers
PHOTOPhotographic images
OTHERAny other unique identifying number

Usage

python
from transformers import pipeline

pipe = pipeline("token-classification", model="mkocher/hipaa-phi-detector", aggregation_strategy="simple")
results = pipe("Patient John Smith, SSN 123-45-6789")

Or with the aare-core package:

python
from aare import HIPAAGuardrail

guardrail = HIPAAGuardrail()
result = guardrail.check("Patient John Smith, SSN 123-45-6789")
if result.blocked:
    print(f"PHI detected: {result.violations}")

License

Apache 2.0