mkocher/hipaa-phi-detector
19
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
Usage
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:
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
