Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- medical
|
| 8 |
+
- cardiology
|
| 9 |
+
- emergency-medicine
|
| 10 |
+
- classification
|
| 11 |
+
- bert
|
| 12 |
+
datasets:
|
| 13 |
+
- MIMIC-III
|
| 14 |
+
metrics:
|
| 15 |
+
- accuracy
|
| 16 |
+
- f1
|
| 17 |
+
- auc
|
| 18 |
+
model-index:
|
| 19 |
+
- name: OHCA-Classifier-V9
|
| 20 |
+
results:
|
| 21 |
+
- task:
|
| 22 |
+
type: text-classification
|
| 23 |
+
name: Out-of-Hospital Cardiac Arrest Detection
|
| 24 |
+
metrics:
|
| 25 |
+
- type: accuracy
|
| 26 |
+
value: 0.86
|
| 27 |
+
- type: f1
|
| 28 |
+
value: 0.80
|
| 29 |
+
- type: auc
|
| 30 |
+
value: 0.905
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
# OHCA Classifier V9
|
| 34 |
+
|
| 35 |
+
## Model Description
|
| 36 |
+
This model classifies clinical notes to identify Out-of-Hospital Cardiac Arrest (OHCA) cases. It's based on BiomedNLP-PubMedBERT and trained on MIMIC-III data.
|
| 37 |
+
|
| 38 |
+
## Model Performance
|
| 39 |
+
- **AUC-ROC**: 0.905
|
| 40 |
+
- **Sensitivity**: 80%
|
| 41 |
+
- **Specificity**: 95%
|
| 42 |
+
- **F1-Score**: 0.80
|
| 43 |
+
- **Optimal Threshold**: 0.120
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
```python
|
| 47 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 48 |
+
import torch
|
| 49 |
+
|
| 50 |
+
# Load model
|
| 51 |
+
tokenizer = AutoTokenizer.from_pretrained("monajm36/ohca-classifier-v9")
|
| 52 |
+
model = AutoModelForSequenceClassification.from_pretrained("monajm36/ohca-classifier-v9")
|
| 53 |
+
|
| 54 |
+
# Predict
|
| 55 |
+
def predict_ohca(text):
|
| 56 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
|
| 57 |
+
with torch.no_grad():
|
| 58 |
+
outputs = model(**inputs)
|
| 59 |
+
probs = torch.softmax(outputs.logits, dim=-1)
|
| 60 |
+
return probs[0][1].item() # OHCA probability
|
| 61 |
+
|
| 62 |
+
# Example
|
| 63 |
+
text = "Chief Complaint: Cardiac arrest. HPI: Patient found unresponsive..."
|
| 64 |
+
prob = predict_ohca(text)
|
| 65 |
+
print(f"OHCA Probability: {prob:.3f}")
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## Training Data
|
| 69 |
+
- **Dataset**: MIMIC-III
|
| 70 |
+
- **Samples**: 330 clinical notes
|
| 71 |
+
- **Classes**: Binary (OHCA vs Non-OHCA)
|
| 72 |
+
|
| 73 |
+
## Disclaimer
|
| 74 |
+
This model is for research purposes only. Not intended for clinical decision-making.
|