Downloads · 30 days
15
5% of all-time downloads
mkocher/hipaa-phi-detector
hipaa-phi-detector is a token classification model from mkocher. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
A fine-tuned DistilBERT model for detecting Protected Health Information (PHI) in text, covering all 18 HIPAA Safe Harbor categories.
Downloads · 30 days
15
5% of all-time downloads
All-time downloads
290
Public
Parameters
66.4M
531 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors266 MB · 100%
From the Hugging Face model README
A fine-tuned DistilBERT model for detecting Protected Health Information (PHI) in text, covering all 18 HIPAA Safe Harbor categories.
| Label | HIPAA Category |
|---|---|
| NAME | Names |
| LOCATION | Geographic subdivisions |
| DATE | Dates |
| PHONE | Phone numbers |
| FAX | Fax numbers |
| Email addresses | |
| SSN | Social Security numbers |
| MRN | Medical record numbers |
| HEALTH_PLAN | Health plan beneficiary numbers |
| ACCOUNT | Account numbers |
| LICENSE | Certificate/license numbers |
| VEHICLE | Vehicle identifiers |
| DEVICE | Device identifiers |
| URL | Web URLs |
| IP | IP addresses |
| BIOMETRIC | Biometric identifiers |
| PHOTO | Photographic images |
| OTHER | Any other unique identifying number |
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}")
Apache 2.0