Token Classification
Transformers
Safetensors
English
bert
ner
clinical
medical
healthcare
biomedical
bio-clinicalbert
named-entity-recognition
phi
pii
de-identification
hipaa
ehr
Eval Results (legacy)
Instructions to use genzeonplatform/healthcare-brain-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use genzeonplatform/healthcare-brain-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="genzeonplatform/healthcare-brain-ner")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("genzeonplatform/healthcare-brain-ner") model = AutoModelForTokenClassification.from_pretrained("genzeonplatform/healthcare-brain-ner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Antrixsh Gupta commited on
Upload clinical NER model for PHI/PII de-identification
Browse files- README.md +180 -0
- config.json +114 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +14 -0
README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- token-classification
|
| 8 |
+
- ner
|
| 9 |
+
- clinical
|
| 10 |
+
- phi
|
| 11 |
+
- pii
|
| 12 |
+
- de-identification
|
| 13 |
+
- medical
|
| 14 |
+
- genzeon-platform
|
| 15 |
+
- cliniguard
|
| 16 |
+
- healthcare
|
| 17 |
+
pipeline_tag: token-classification
|
| 18 |
+
model-index:
|
| 19 |
+
- name: cliniguard-ner
|
| 20 |
+
results:
|
| 21 |
+
- task:
|
| 22 |
+
type: token-classification
|
| 23 |
+
name: Named Entity Recognition
|
| 24 |
+
metrics:
|
| 25 |
+
- type: f1
|
| 26 |
+
value: 0.9695
|
| 27 |
+
name: Micro F1
|
| 28 |
+
- type: precision
|
| 29 |
+
value: 0.9659
|
| 30 |
+
name: Micro Precision
|
| 31 |
+
- type: recall
|
| 32 |
+
value: 0.9732
|
| 33 |
+
name: Micro Recall
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
# CliniGuard NER -- PHI/PII De-identification by Genzeon Platform
|
| 37 |
+
|
| 38 |
+
**CliniGuard NER** is a clinical Named Entity Recognition model developed by
|
| 39 |
+
[Genzeon Platform](https://genzeon.one/) for automated detection and
|
| 40 |
+
de-identification of Protected Health Information (PHI) and Personally
|
| 41 |
+
Identifiable Information (PII) in clinical text. Built on a domain-specialized
|
| 42 |
+
BERT architecture fine-tuned on healthcare corpora, CliniGuard delivers
|
| 43 |
+
production-grade entity recognition across 20 PHI categories.
|
| 44 |
+
|
| 45 |
+
## Model Details
|
| 46 |
+
|
| 47 |
+
| Property | Value |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Developed by | **Genzeon Platform** |
|
| 50 |
+
| Architecture | BertForTokenClassification |
|
| 51 |
+
| Parameters | ~110M |
|
| 52 |
+
| Tagging scheme | BIO (41 labels) |
|
| 53 |
+
| Max sequence length | 512 tokens |
|
| 54 |
+
| License | Apache-2.0 |
|
| 55 |
+
|
| 56 |
+
## Intended Use
|
| 57 |
+
|
| 58 |
+
CliniGuard NER is designed for enterprise healthcare environments where patient
|
| 59 |
+
data privacy is critical. Primary use cases include:
|
| 60 |
+
|
| 61 |
+
- **Clinical text de-identification** -- removing or masking patient identifiers
|
| 62 |
+
before sharing medical records for research.
|
| 63 |
+
- **PII detection** -- flagging sensitive information in healthcare documents,
|
| 64 |
+
EHRs, and discharge summaries.
|
| 65 |
+
- **Regulatory compliance** -- supporting HIPAA Safe Harbor de-identification
|
| 66 |
+
requirements.
|
| 67 |
+
- **Healthcare AI pipelines** -- preprocessing clinical text for downstream NLP
|
| 68 |
+
tasks while ensuring patient privacy.
|
| 69 |
+
|
| 70 |
+
## Entity Types
|
| 71 |
+
|
| 72 |
+
The model recognizes **20 PHI entity types** using BIO tagging (41 labels total):
|
| 73 |
+
|
| 74 |
+
| Category | Entity Types |
|
| 75 |
+
|---|---|
|
| 76 |
+
| Patient identifiers | PATIENT_NAME, DATE_OF_BIRTH, AGE, GENDER, SSN, MRN |
|
| 77 |
+
| Contact information | PHONE, FAX, EMAIL |
|
| 78 |
+
| Location | ADDRESS, CITY, STATE, ZIP, COUNTRY |
|
| 79 |
+
| Organization | HOSPITAL |
|
| 80 |
+
| Provider | DOCTOR_NAME |
|
| 81 |
+
| Digital identifiers | USERNAME, ID_NUMBER, IP_ADDRESS, URL |
|
| 82 |
+
|
| 83 |
+
## Performance
|
| 84 |
+
|
| 85 |
+
### Overall Metrics
|
| 86 |
+
|
| 87 |
+
| Metric | Precision | Recall | F1 |
|
| 88 |
+
|---|---|---|---|
|
| 89 |
+
| **Micro avg** | 0.9659 | 0.9732 | 0.9695 |
|
| 90 |
+
| Macro avg | 0.9609 | 0.9706 | 0.9656 |
|
| 91 |
+
|
| 92 |
+
### Per-Entity Metrics
|
| 93 |
+
|
| 94 |
+
| Entity | Precision | Recall | F1 | Support |
|
| 95 |
+
|---|---|---|---|---|
|
| 96 |
+
| PATIENT_NAME | 0.9817 | 0.9853 | 0.9835 | 14335 |
|
| 97 |
+
| DATE_OF_BIRTH | 0.9798 | 0.9740 | 0.9769 | 9818 |
|
| 98 |
+
| AGE | 0.9028 | 0.9854 | 0.9423 | 1508 |
|
| 99 |
+
| GENDER | 0.9596 | 0.9885 | 0.9738 | 1562 |
|
| 100 |
+
| SSN | 0.9513 | 0.9935 | 0.9719 | 766 |
|
| 101 |
+
| MRN | 0.9938 | 0.9923 | 0.9930 | 1943 |
|
| 102 |
+
| PHONE | 0.9730 | 0.9869 | 0.9799 | 2590 |
|
| 103 |
+
| FAX | 0.9481 | 0.9454 | 0.9468 | 696 |
|
| 104 |
+
| EMAIL | 0.9965 | 0.9936 | 0.9950 | 4543 |
|
| 105 |
+
| ADDRESS | 0.9746 | 0.9844 | 0.9794 | 1985 |
|
| 106 |
+
| CITY | 0.9086 | 0.8891 | 0.8988 | 2047 |
|
| 107 |
+
| STATE | 0.9103 | 0.9060 | 0.9082 | 2734 |
|
| 108 |
+
| ZIP | 0.9770 | 0.9832 | 0.9801 | 951 |
|
| 109 |
+
| COUNTRY | 0.9485 | 0.9504 | 0.9495 | 2056 |
|
| 110 |
+
| HOSPITAL | 0.9033 | 0.9345 | 0.9186 | 5267 |
|
| 111 |
+
| DOCTOR_NAME | 0.9865 | 1.0000 | 0.9932 | 802 |
|
| 112 |
+
| USERNAME | 0.9689 | 0.9431 | 0.9559 | 1917 |
|
| 113 |
+
| ID_NUMBER | 0.9724 | 0.9898 | 0.9811 | 8555 |
|
| 114 |
+
| IP_ADDRESS | 0.9892 | 0.9924 | 0.9908 | 926 |
|
| 115 |
+
| URL | 0.9910 | 0.9947 | 0.9928 | 3001 |
|
| 116 |
+
|
| 117 |
+
## Usage
|
| 118 |
+
|
| 119 |
+
```python
|
| 120 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
| 121 |
+
|
| 122 |
+
model_name = "genzeonplatform/cliniguard-ner"
|
| 123 |
+
|
| 124 |
+
# Option 1: Use the transformers pipeline
|
| 125 |
+
nlp = pipeline("token-classification", model=model_name, aggregation_strategy="simple")
|
| 126 |
+
text = "Patient John Smith, DOB 03/15/1960, was seen at Springfield General Hospital by Dr. Jane Doe."
|
| 127 |
+
entities = nlp(text)
|
| 128 |
+
for ent in entities:
|
| 129 |
+
print(f" {ent['entity_group']:20s} {ent['word']:30s} (score: {ent['score']:.3f})")
|
| 130 |
+
|
| 131 |
+
# Option 2: Manual inference
|
| 132 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 133 |
+
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 134 |
+
|
| 135 |
+
import torch
|
| 136 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
|
| 137 |
+
with torch.no_grad():
|
| 138 |
+
outputs = model(**inputs)
|
| 139 |
+
predictions = torch.argmax(outputs.logits, dim=2)
|
| 140 |
+
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
|
| 141 |
+
for token, pred in zip(tokens, predictions[0]):
|
| 142 |
+
label = model.config.id2label[str(pred.item())]
|
| 143 |
+
if label != "O":
|
| 144 |
+
print(f" {token:20s} -> {label}")
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
## Training Details
|
| 148 |
+
|
| 149 |
+
- **Developed by**: Genzeon Platform
|
| 150 |
+
- **Architecture**: Domain-specialized BERT fine-tuned on clinical corpora
|
| 151 |
+
- **Training data**: Genzeon Platform's proprietary clinical NER dataset with diverse healthcare note formats
|
| 152 |
+
- **Epochs**: 15 (with early stopping, patience=3)
|
| 153 |
+
- **Learning rate**: 3e-5 (linear schedule with warmup)
|
| 154 |
+
- **Batch size**: 16 (train) / 32 (eval)
|
| 155 |
+
- **Max sequence length**: 512 tokens
|
| 156 |
+
- **Optimizer**: AdamW (weight decay 0.01)
|
| 157 |
+
|
| 158 |
+
## Limitations
|
| 159 |
+
|
| 160 |
+
- **English only**: Currently optimized for English clinical text. Multilingual
|
| 161 |
+
support is on the Genzeon Platform roadmap.
|
| 162 |
+
- **Recommended with human-in-the-loop**: For high-stakes de-identification
|
| 163 |
+
workflows, Genzeon Platform recommends pairing CliniGuard with human review for
|
| 164 |
+
maximum safety.
|
| 165 |
+
- **Entity coverage**: Covers 20 common PHI types as defined by HIPAA Safe
|
| 166 |
+
Harbor. Rare or domain-specific identifiers may require custom fine-tuning --
|
| 167 |
+
contact Genzeon Platform for enterprise support.
|
| 168 |
+
- **Context window**: Limited to 512 tokens per input. Longer documents should
|
| 169 |
+
be chunked with overlap for best results.
|
| 170 |
+
|
| 171 |
+
## About Genzeon Platform
|
| 172 |
+
|
| 173 |
+
[Genzeon Platform](https://genzeon.one/) is a healthcare technology
|
| 174 |
+
company specializing in AI-powered solutions for clinical data management,
|
| 175 |
+
regulatory compliance, and healthcare interoperability. CliniGuard NER is part
|
| 176 |
+
of Genzeon Platform's suite of healthcare AI tools designed to accelerate clinical
|
| 177 |
+
research while safeguarding patient privacy.
|
| 178 |
+
|
| 179 |
+
For enterprise licensing, custom fine-tuning, or integration support, contact
|
| 180 |
+
**hi@genzeon.one**.
|
config.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForTokenClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": null,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "O",
|
| 16 |
+
"1": "B-PATIENT_NAME",
|
| 17 |
+
"10": "I-SSN",
|
| 18 |
+
"11": "B-MRN",
|
| 19 |
+
"12": "I-MRN",
|
| 20 |
+
"13": "B-PHONE",
|
| 21 |
+
"14": "I-PHONE",
|
| 22 |
+
"15": "B-FAX",
|
| 23 |
+
"16": "I-FAX",
|
| 24 |
+
"17": "B-EMAIL",
|
| 25 |
+
"18": "I-EMAIL",
|
| 26 |
+
"19": "B-ADDRESS",
|
| 27 |
+
"2": "I-PATIENT_NAME",
|
| 28 |
+
"20": "I-ADDRESS",
|
| 29 |
+
"21": "B-CITY",
|
| 30 |
+
"22": "I-CITY",
|
| 31 |
+
"23": "B-STATE",
|
| 32 |
+
"24": "I-STATE",
|
| 33 |
+
"25": "B-ZIP",
|
| 34 |
+
"26": "I-ZIP",
|
| 35 |
+
"27": "B-COUNTRY",
|
| 36 |
+
"28": "I-COUNTRY",
|
| 37 |
+
"29": "B-HOSPITAL",
|
| 38 |
+
"3": "B-DATE_OF_BIRTH",
|
| 39 |
+
"30": "I-HOSPITAL",
|
| 40 |
+
"31": "B-DOCTOR_NAME",
|
| 41 |
+
"32": "I-DOCTOR_NAME",
|
| 42 |
+
"33": "B-USERNAME",
|
| 43 |
+
"34": "I-USERNAME",
|
| 44 |
+
"35": "B-ID_NUMBER",
|
| 45 |
+
"36": "I-ID_NUMBER",
|
| 46 |
+
"37": "B-IP_ADDRESS",
|
| 47 |
+
"38": "I-IP_ADDRESS",
|
| 48 |
+
"39": "B-URL",
|
| 49 |
+
"4": "I-DATE_OF_BIRTH",
|
| 50 |
+
"40": "I-URL",
|
| 51 |
+
"5": "B-AGE",
|
| 52 |
+
"6": "I-AGE",
|
| 53 |
+
"7": "B-GENDER",
|
| 54 |
+
"8": "I-GENDER",
|
| 55 |
+
"9": "B-SSN"
|
| 56 |
+
},
|
| 57 |
+
"initializer_range": 0.02,
|
| 58 |
+
"intermediate_size": 3072,
|
| 59 |
+
"is_decoder": false,
|
| 60 |
+
"label2id": {
|
| 61 |
+
"B-ADDRESS": 19,
|
| 62 |
+
"B-AGE": 5,
|
| 63 |
+
"B-CITY": 21,
|
| 64 |
+
"B-COUNTRY": 27,
|
| 65 |
+
"B-DATE_OF_BIRTH": 3,
|
| 66 |
+
"B-DOCTOR_NAME": 31,
|
| 67 |
+
"B-EMAIL": 17,
|
| 68 |
+
"B-FAX": 15,
|
| 69 |
+
"B-GENDER": 7,
|
| 70 |
+
"B-HOSPITAL": 29,
|
| 71 |
+
"B-ID_NUMBER": 35,
|
| 72 |
+
"B-IP_ADDRESS": 37,
|
| 73 |
+
"B-MRN": 11,
|
| 74 |
+
"B-PATIENT_NAME": 1,
|
| 75 |
+
"B-PHONE": 13,
|
| 76 |
+
"B-SSN": 9,
|
| 77 |
+
"B-STATE": 23,
|
| 78 |
+
"B-URL": 39,
|
| 79 |
+
"B-USERNAME": 33,
|
| 80 |
+
"B-ZIP": 25,
|
| 81 |
+
"I-ADDRESS": 20,
|
| 82 |
+
"I-AGE": 6,
|
| 83 |
+
"I-CITY": 22,
|
| 84 |
+
"I-COUNTRY": 28,
|
| 85 |
+
"I-DATE_OF_BIRTH": 4,
|
| 86 |
+
"I-DOCTOR_NAME": 32,
|
| 87 |
+
"I-EMAIL": 18,
|
| 88 |
+
"I-FAX": 16,
|
| 89 |
+
"I-GENDER": 8,
|
| 90 |
+
"I-HOSPITAL": 30,
|
| 91 |
+
"I-ID_NUMBER": 36,
|
| 92 |
+
"I-IP_ADDRESS": 38,
|
| 93 |
+
"I-MRN": 12,
|
| 94 |
+
"I-PATIENT_NAME": 2,
|
| 95 |
+
"I-PHONE": 14,
|
| 96 |
+
"I-SSN": 10,
|
| 97 |
+
"I-STATE": 24,
|
| 98 |
+
"I-URL": 40,
|
| 99 |
+
"I-USERNAME": 34,
|
| 100 |
+
"I-ZIP": 26,
|
| 101 |
+
"O": 0
|
| 102 |
+
},
|
| 103 |
+
"layer_norm_eps": 1e-12,
|
| 104 |
+
"max_position_embeddings": 512,
|
| 105 |
+
"model_type": "bert",
|
| 106 |
+
"num_attention_heads": 12,
|
| 107 |
+
"num_hidden_layers": 12,
|
| 108 |
+
"pad_token_id": 0,
|
| 109 |
+
"tie_word_embeddings": true,
|
| 110 |
+
"transformers_version": "5.3.0",
|
| 111 |
+
"type_vocab_size": 2,
|
| 112 |
+
"use_cache": false,
|
| 113 |
+
"vocab_size": 28996
|
| 114 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f33aa459a32c0afae05d89d43617ac19d81561e77c4cb843b453ed33dba8916b
|
| 3 |
+
size 431028148
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_lower_case": true,
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"mask_token": "[MASK]",
|
| 7 |
+
"model_max_length": 512,
|
| 8 |
+
"pad_token": "[PAD]",
|
| 9 |
+
"sep_token": "[SEP]",
|
| 10 |
+
"strip_accents": null,
|
| 11 |
+
"tokenize_chinese_chars": true,
|
| 12 |
+
"tokenizer_class": "BertTokenizer",
|
| 13 |
+
"unk_token": "[UNK]"
|
| 14 |
+
}
|