Downloads · 30 days
13
5% of all-time downloads
cristian-untaru/roberta-medical-triage
roberta-medical-triage is a text classification model from cristian-untaru. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This repository contains a fully fine-tuned RoBERTa sequence classification model. Full fine-tuning updates the transformer encoder and the classification head.
Downloads · 30 days
13
5% of all-time downloads
All-time downloads
264
Public
Parameters
125M
997 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 100%
From the Hugging Face model README
This repository contains a fully fine-tuned RoBERTa sequence classification model. Full fine-tuning updates the transformer encoder and the classification head.
The model receives a short English symptom description and predicts one of the following triage-oriented labels:
self_monitorconsult_gpurgentThis model was developed as part of the SortMed academic project, a medical pre-triage assistant prototype built for a bachelor's thesis by Cristian Untaru at the West University of Timișoara, Faculty of Informatics.
The model is intended for research and educational use. It is not a diagnostic system and is not a certified medical device.
This model is intended to be used in an academic medical pre-triage prototype for:
Example input:
I have chest pain, shortness of breath, and I feel dizzy.
Example output:
urgent
This model must not be used as:
For severe, worsening, or emergency symptoms, users should contact emergency services or a qualified healthcare professional.
The model predicts one of three labels:
| Label | Meaning |
|---|---|
self_monitor | Symptoms appear mild and may be monitored, assuming no worsening or additional warning signs. |
consult_gp | A general practitioner or non-emergency medical professional should be consulted. |
urgent | Symptoms may require urgent medical attention or emergency evaluation. |
The label mapping is included in label_map.json and in the model configuration.
Expected mapping:
{
0: "self_monitor",
1: "consult_gp",
2: "urgent",
}
The model was trained on the cristian-untaru/symcat-medical-triage-dataset, a SymCAT-derived dataset prepared for academic experiments in medical pre-triage classification.
The dataset contains English symptom-based text examples labeled into three triage classes:
self_monitorconsult_gpurgentDataset split used for training:
| Split | Examples |
|---|---|
| Train | 490 |
| Validation | 105 |
| Test | 106 |
| Total | 701 |
The dataset labels were produced using rule-based triage logic for academic experimentation. They are not clinically validated annotations from medical professionals.
MedQuAD was not used to train this classifier. In the broader SortMed system, MedQuAD is used separately for retrieval of related medical information through the cristian-untaru/medquad-retrieval-pretriage dataset.
Base checkpoint:
FacebookAI/roberta-base
| Parameter | Value |
|---|---|
| Fine-tuning method | Full Fine-Tuning |
| Maximum sequence length | 128 |
| Epochs | 5 |
| Train batch size | 16 |
| Evaluation batch size | 32 |
| Learning rate | 2e-05 |
| Weight decay | 0.01 |
| Warmup ratio | 0.1 |
| Mixed precision | FP16 |
| Early stopping patience | 2 |
| Best checkpoint metric | f1 |
| Random seed | 42 |
Additional training metadata is available in training_config.json.
The model was evaluated on the held-out test split.
| Metric | Test Score |
|---|---|
| Accuracy | 0.6792 |
| Macro Precision | 0.6908 |
| Macro Recall / Sensitivity | 0.6742 |
| Macro Specificity | 0.8355 |
| Macro F1 | 0.6772 |
| Macro AUC OvR | 0.8523 |
| Macro IoU / Jaccard | 0.5181 |
| Test Loss | 0.8294 |
| Class | Precision | Recall / Sensitivity | F1-score | Support |
|---|---|---|---|---|
self_monitor | 0.68 | 0.70 | 0.69 | 33 |
consult_gp | 0.63 | 0.60 | 0.62 | 40 |
urgent | 0.65 | 0.67 | 0.66 | 33 |
These results should be interpreted in the context of the small dataset size and the academic nature of the experiment.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo_id = "cristian-untaru/roberta-medical-triage"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)
text = "I have chest pain, shortness of breath, and I feel dizzy."
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
padding=True,
max_length=128
)
with torch.no_grad():
outputs = model(**inputs)
probabilities = torch.softmax(outputs.logits, dim=-1)
predicted_class_id = torch.argmax(probabilities, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_id]
confidence = probabilities[0][predicted_class_id].item()
print("Predicted label:", predicted_label)
print("Confidence:", round(confidence, 4))
This model loads with the standard Transformers API and does not require trust_remote_code=True.
To verify the label mapping:
print(model.config.id2label)
Expected output:
{0: "self_monitor", 1: "consult_gp", 2: "urgent"}
| File | Description |
|---|---|
config.json | Model architecture, label mapping, and classification configuration. |
model.safetensors | Model weights in SafeTensors format. |
tokenizer.json | Tokenizer vocabulary and processing pipeline. |
tokenizer_config.json | Tokenizer configuration. |
training_args.bin | Hugging Face Trainer arguments saved during training. |
training_config.json | Human-readable training configuration. |
label_map.json | Mapping between numeric class IDs and triage labels. |
README.md | Model card documentation. |
.gitattributes | Git LFS configuration for large model files. |
This model has several important limitations:
Medical pre-triage systems can influence user decisions in sensitive healthcare situations. This model should therefore be used only with clear disclaimers and with safeguards that encourage users to seek professional medical care when appropriate.
Any real-world deployment would require:
This model is intended only for academic, research, and prototype development purposes. It is not a substitute for professional medical advice, diagnosis, treatment, or emergency care.
If symptoms are severe, sudden, worsening, or potentially life-threatening, users should contact emergency services or a qualified healthcare professional immediately.
cristian-untaru/distilbert-medical-triagecristian-untaru/biobert-medical-triagecristian-untaru/roberta-medical-triagecristian-untaru/biomedbert-medical-triagecristian-untaru/lora-distilbert-medical-triagecristian-untaru/lora-biobert-medical-triagecristian-untaru/lora-roberta-medical-triagecristian-untaru/lora-biomedbert-medical-triagecristian-untaru/bottleneck-mlp-distilbert-medical-triagecristian-untaru/bottleneck-mlp-biobert-medical-triagecristian-untaru/bottleneck-mlp-roberta-medical-triagecristian-untaru/bottleneck-mlp-biomedbert-medical-triage