Downloads · 30 days
10
29% of all-time downloads
Shoriful025/clinical-ner-deid-biobert-v2
clinical-ner-deid-biobert-v2 is a machine learning model from Shoriful025. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a highly specialized Named Entity Recognition (NER) model fine-tuned on BioBERT, designed for the crucial task of Clinical De-identification (De-ID). Its primary function is to identify and classify Prot…
Downloads · 30 days
10
29% of all-time downloads
All-time downloads
35
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md3.1 KB · 57%
From the Hugging Face model README
This model is a highly specialized Named Entity Recognition (NER) model fine-tuned on BioBERT, designed for the crucial task of Clinical De-identification (De-ID). Its primary function is to identify and classify Protected Health Information (PHI) within unstructured clinical notes, such as patient names, dates, ages, and medical record IDs, which is essential for compliance with regulations like HIPAA.
BioBERT-v1.1 (based on BERT-large, pre-trained on biomedical corpora like PubMed abstracts and PMC full-text articles).BertForTokenClassification). A linear classification head is placed on top of the last hidden state of every input token.NAME (Patient/Doctor Names)AGE (Specific Age/Year)DATE (Admission, Discharge, Test Dates)ID (Medical Record Numbers, Social Security Numbers)To use the model for de-identification:
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
# Load model and tokenizer
model_name = "YourOrg/clinical-ner-deid-biobert-v2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
# Create the NER pipeline
ner_pipeline = pipeline(
"ner",
model=model,
tokenizer=tokenizer,
aggregation_strategy="simple"
)
clinical_note = "Patient Alex Johnson, aged 65, was admitted on 2024-11-15 with MRN 98765432."
results = ner_pipeline(clinical_note)
print("--- Detected PHI Entities ---")
for result in results:
entity_type = result['entity_group']
word = result['word']
print(f"Type: {entity_type:<5} | Value: {word}")
# Output structure allows for easy PHI redaction/replacement