SHUB-8 commited on
Commit
d499d6e
·
verified ·
1 Parent(s): 84e6ca2

Upload TriageBERT ESI model (recall optimized)

Browse files
README.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - medical
7
+ - triage
8
+ - classification
9
+ - emergency
10
+ - esi
11
+ pipeline_tag: text-classification
12
+ ---
13
+
14
+ # TriageBERT - ESI Triage Classification Model
15
+
16
+ A BERT-based model fine-tuned for Emergency Severity Index (ESI) classification on PubMedBERT.
17
+
18
+ ## Model Description
19
+
20
+ This model classifies emergency medical text into 5 ESI levels:
21
+ - **ESI 1**: Immediate (life-threatening)
22
+ - **ESI 2**: Emergent (high risk)
23
+ - **ESI 3**: Urgent (stable but needs multiple resources)
24
+ - **ESI 4**: Less Urgent (single resource needed)
25
+ - **ESI 5**: Non-Urgent (no resources needed)
26
+
27
+ ## Training
28
+
29
+ - **Base Model**: PubMedBERT (biomedical domain)
30
+ - **Training Data**: MIMIC-IV ED-Triage data + synthetic data
31
+ - **Optimization**: Recall-optimized for critical cases (ESI 1-2)
32
+
33
+ ## Usage
34
+
35
+ ```python
36
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
37
+ import torch
38
+
39
+ # Load model
40
+ tokenizer = AutoTokenizer.from_pretrained("SHUB-8/Triage-BERT")
41
+ model = AutoModelForSequenceClassification.from_pretrained("SHUB-8/Triage-BERT")
42
+
43
+ # Predict
44
+ text = "Patient has chest pain and difficulty breathing"
45
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
46
+
47
+ with torch.no_grad():
48
+ outputs = model(**inputs)
49
+ probs = torch.softmax(outputs.logits, dim=1)
50
+ esi_level = torch.argmax(probs).item() + 1 # ESI 1-5
51
+
52
+ print(f"ESI Level: {esi_level}")
53
+ ```
54
+
55
+ ## Performance
56
+
57
+ | Metric | Value |
58
+ |--------|-------|
59
+ | Accuracy | ~85% |
60
+ | Recall (ESI 1-2) | ~92% |
61
+ | F1 Score | ~83% |
62
+
63
+ ## Intended Use
64
+
65
+ - Emergency department triage assistance
66
+ - Medical emergency prioritization
67
+ - Healthcare AI research
68
+
69
+ ## Limitations
70
+
71
+ - English language only
72
+ - Should be used as decision support, not replacement for clinical judgment
73
+ - Performance may vary on out-of-distribution data
74
+
75
+ ## Citation
76
+
77
+ If you use this model, please cite:
78
+ ```
79
+ @misc{triage-bert-esi,
80
+ author = {Your Name},
81
+ title = {TriageBERT: ESI Triage Classification Model},
82
+ year = {2024},
83
+ publisher = {Hugging Face},
84
+ url = {https://huggingface.co/SHUB-8/triage-bert-esi-recall-optimized}
85
+ }
86
+ ```
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "LABEL_0",
13
+ "1": "LABEL_1",
14
+ "2": "LABEL_2",
15
+ "3": "LABEL_3",
16
+ "4": "LABEL_4"
17
+ },
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3072,
20
+ "label2id": {
21
+ "LABEL_0": 0,
22
+ "LABEL_1": 1,
23
+ "LABEL_2": 2,
24
+ "LABEL_3": 3,
25
+ "LABEL_4": 4
26
+ },
27
+ "layer_norm_eps": 1e-12,
28
+ "max_position_embeddings": 512,
29
+ "model_type": "bert",
30
+ "num_attention_heads": 12,
31
+ "num_hidden_layers": 12,
32
+ "pad_token_id": 0,
33
+ "position_embedding_type": "absolute",
34
+ "problem_type": "single_label_classification",
35
+ "transformers_version": "4.57.3",
36
+ "type_vocab_size": 2,
37
+ "use_cache": true,
38
+ "vocab_size": 30522
39
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c100e7ddcb769e78f5af52eafe4d20b9bee3dd5066eb46a358d2b7867dfdef7
3
+ size 437967876
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 1000000000000000019884624838656,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff