Commit
·
30847ee
1
Parent(s):
ff15437
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- text-classification
|
5 |
+
datasets:
|
6 |
+
- Mimic III
|
7 |
---
|
8 |
+
|
9 |
+
# Clinical BERT for ICD-10 Prediction
|
10 |
+
|
11 |
+
The Publicly Available Clinical BERT Embeddings paper contains four unique clinicalBERT models: initialized with BERT-Base (cased_L-12_H-768_A-12) or BioBERT (BioBERT-Base v1.0 + PubMed 200K + PMC 270K) & trained on either all MIMIC notes or only discharge summaries.
|
12 |
+
|
13 |
+
---
|
14 |
+
|
15 |
+
## How to use the model
|
16 |
+
|
17 |
+
Load the model via the transformers library:
|
18 |
+
|
19 |
+
from transformers import AutoTokenizer, BertForSequenceClassification
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained("AkshatSurolia/ICD-10-Code-Prediction")
|
21 |
+
model = BertForSequenceClassification.from_pretrained("AkshatSurolia/ICD-10-Code-Prediction")
|
22 |
+
config = model.config
|
23 |
+
|
24 |
+
Run the model with clinical diagonosis text:
|
25 |
+
|
26 |
+
text = "subarachnoid hemorrhage scalp laceration service: surgery major surgical or invasive"
|
27 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
28 |
+
output = model(**encoded_input)
|
29 |
+
|
30 |
+
Return the Top-5 predicted ICD-10 codes:
|
31 |
+
|
32 |
+
results = output.logits.detach().cpu().numpy()[0].argsort()[::-1][:5]
|
33 |
+
return [ config.id2label[ids] for ids in results]
|