Instructions to use lethalantidote/phi-detector-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lethalantidote/phi-detector-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="lethalantidote/phi-detector-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("lethalantidote/phi-detector-model") model = AutoModelForTokenClassification.from_pretrained("lethalantidote/phi-detector-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Publish quality-gated PHI token classifier
Browse files- README.md +2 -2
- config.json +7 -1
- model.safetensors +2 -2
- run_manifest.json +6 -6
- tokenizer.json +0 -0
- tokenizer_config.json +1 -1
README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
language: en
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: token-classification
|
| 5 |
-
base_model:
|
| 6 |
tags:
|
| 7 |
- clinical
|
| 8 |
- phi
|
|
@@ -11,7 +11,7 @@ tags:
|
|
| 11 |
|
| 12 |
# Synthetic PHI Detector
|
| 13 |
|
| 14 |
-
This token-classification model was fine-tuned from `
|
| 15 |
Synthetic Synthea-derived clinical templates. It recognizes three entity types
|
| 16 |
with the BIO labels stored in `config.json`.
|
| 17 |
|
|
|
|
| 2 |
language: en
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: token-classification
|
| 5 |
+
base_model: StanfordAIMI/stanford-deidentifier-base
|
| 6 |
tags:
|
| 7 |
- clinical
|
| 8 |
- phi
|
|
|
|
| 11 |
|
| 12 |
# Synthetic PHI Detector
|
| 13 |
|
| 14 |
+
This token-classification model was fine-tuned from `StanfordAIMI/stanford-deidentifier-base` using
|
| 15 |
Synthetic Synthea-derived clinical templates. It recognizes three entity types
|
| 16 |
with the BIO labels stored in `config.json`.
|
| 17 |
|
config.json
CHANGED
|
@@ -8,6 +8,8 @@
|
|
| 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,
|
|
@@ -37,10 +39,14 @@
|
|
| 37 |
"model_type": "bert",
|
| 38 |
"num_attention_heads": 12,
|
| 39 |
"num_hidden_layers": 12,
|
|
|
|
| 40 |
"pad_token_id": 0,
|
|
|
|
| 41 |
"tie_word_embeddings": true,
|
|
|
|
| 42 |
"transformers_version": "5.14.1",
|
| 43 |
"type_vocab_size": 2,
|
|
|
|
| 44 |
"use_cache": true,
|
| 45 |
-
"vocab_size":
|
| 46 |
}
|
|
|
|
| 8 |
"classifier_dropout": null,
|
| 9 |
"dtype": "float32",
|
| 10 |
"eos_token_id": null,
|
| 11 |
+
"eos_token_ids": null,
|
| 12 |
+
"finetuning_task": null,
|
| 13 |
"hidden_act": "gelu",
|
| 14 |
"hidden_dropout_prob": 0.1,
|
| 15 |
"hidden_size": 768,
|
|
|
|
| 39 |
"model_type": "bert",
|
| 40 |
"num_attention_heads": 12,
|
| 41 |
"num_hidden_layers": 12,
|
| 42 |
+
"output_past": true,
|
| 43 |
"pad_token_id": 0,
|
| 44 |
+
"pruned_heads": {},
|
| 45 |
"tie_word_embeddings": true,
|
| 46 |
+
"torchscript": false,
|
| 47 |
"transformers_version": "5.14.1",
|
| 48 |
"type_vocab_size": 2,
|
| 49 |
+
"use_bfloat16": false,
|
| 50 |
"use_cache": true,
|
| 51 |
+
"vocab_size": 30522
|
| 52 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8da8478c5d4ba0cdacd229827f96b0c8b34c54ba34a84d3c61ecb8b4f6d9294
|
| 3 |
+
size 435611468
|
run_manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"base_model": "
|
| 3 |
-
"base_model_revision": "
|
| 4 |
"bio_labels": [
|
| 5 |
"O",
|
| 6 |
"B-MEDICAL_RECORD",
|
|
@@ -30,14 +30,14 @@
|
|
| 30 |
"MEDICATION_precision": 1.0,
|
| 31 |
"MEDICATION_recall": 1.0,
|
| 32 |
"MEDICATION_support": 702.0,
|
| 33 |
-
"loss": 0.
|
| 34 |
"overall_f1": 1.0,
|
| 35 |
"overall_precision": 1.0,
|
| 36 |
"overall_recall": 1.0,
|
| 37 |
"overall_support": 1942.0,
|
| 38 |
-
"runtime": 1.
|
| 39 |
-
"samples_per_second":
|
| 40 |
-
"steps_per_second":
|
| 41 |
},
|
| 42 |
"seed": 42,
|
| 43 |
"training_parameters": {
|
|
|
|
| 1 |
{
|
| 2 |
+
"base_model": "StanfordAIMI/stanford-deidentifier-base",
|
| 3 |
+
"base_model_revision": "661b9c1c717d3165512d440abc3700c386aefab6",
|
| 4 |
"bio_labels": [
|
| 5 |
"O",
|
| 6 |
"B-MEDICAL_RECORD",
|
|
|
|
| 30 |
"MEDICATION_precision": 1.0,
|
| 31 |
"MEDICATION_recall": 1.0,
|
| 32 |
"MEDICATION_support": 702.0,
|
| 33 |
+
"loss": 0.0005009130109101534,
|
| 34 |
"overall_f1": 1.0,
|
| 35 |
"overall_precision": 1.0,
|
| 36 |
"overall_recall": 1.0,
|
| 37 |
"overall_support": 1942.0,
|
| 38 |
+
"runtime": 1.7193,
|
| 39 |
+
"samples_per_second": 1129.54,
|
| 40 |
+
"steps_per_second": 35.48
|
| 41 |
},
|
| 42 |
"seed": 42,
|
| 43 |
"training_parameters": {
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"is_local": false,
|
| 6 |
"local_files_only": false,
|
| 7 |
"mask_token": "[MASK]",
|
| 8 |
-
"model_max_length":
|
| 9 |
"pad_token": "[PAD]",
|
| 10 |
"sep_token": "[SEP]",
|
| 11 |
"strip_accents": null,
|
|
|
|
| 5 |
"is_local": false,
|
| 6 |
"local_files_only": false,
|
| 7 |
"mask_token": "[MASK]",
|
| 8 |
+
"model_max_length": 512,
|
| 9 |
"pad_token": "[PAD]",
|
| 10 |
"sep_token": "[SEP]",
|
| 11 |
"strip_accents": null,
|