Downloads · 30 days
21
17% of all-time downloads
Izziemirg/medsentinel-adr-deberta
medsentinel-adr-deberta is a text classification model from Izziemirg. Use it when you need a label for a piece of text. The card lists the license as mit.
MedSentinel is a fine-tuned DeBERTa-v3-Base model for classifying the severity of Adverse Drug Reactions (ADRs) from patient-reported narrative text. It is the core AI component of the MedSentinel ADR Intelligence Pla…
Downloads · 30 days
21
17% of all-time downloads
All-time downloads
127
Public
Parameters
184M
740 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors738 MB · 99%
From the Hugging Face model README
MedSentinel is a fine-tuned DeBERTa-v3-Base model for classifying the severity of Adverse Drug Reactions (ADRs) from patient-reported narrative text. It is the core AI component of the MedSentinel ADR Intelligence Platform, designed to assist clinical practitioners in triaging pharmacovigilance signals.
| Property | Value |
|---|---|
| Base model | microsoft/deberta-v3-base |
| Architecture | DeBERTa-v3 (12 layers, 768 hidden, ~86M params) |
| Task | Binary text classification (Severe / Non-Severe) |
| Training strategy | 5-fold stratified cross-validation ensemble |
| Kaggle score | 0.92720 (ensemble) · 0.91544 (single model) |
| Tokenizer | SentencePiece (max length 256) |
This model is intended for research and clinical decision support in the context of pharmacovigilance. It classifies free-text patient ADR reports as either severe or non-severe to help clinicians prioritize signals requiring immediate attention.
Intended users: Clinical practitioners, pharmacovigilance researchers, healthcare data scientists.
Out-of-scope uses: This model should not be used as a sole basis for clinical decisions. It is a decision-support tool and should always be reviewed by a qualified healthcare professional.
The model was trained on a dataset of 8,153 patient-reported drug experience narratives sourced from drug review platforms. Labels indicate ADR severity:
0 — Non-severe adverse drug reaction1 — Severe adverse drug reactionClass distribution: 53.4% severe · 46.6% non-severe (near-balanced)
# Key hyperparameters
learning_rate = 2e-5
optimizer = "adafactor"
batch_size = 16 # effective 64 with gradient accumulation
gradient_accumulation = 4
epochs = 8 # with early stopping (patience=3)
warmup_ratio = 0.1
lr_scheduler = "cosine"
weight_decay = 0.01
max_seq_length = 256
fp16 = False # DeBERTa-v3 incompatibility
cv_folds = 5
| Metric | Score |
|---|---|
| Kaggle F1 (ensemble) | 0.92720 |
| Kaggle F1 (single model) | 0.91544 |
| Validation F1 (macro) | 0.9050 |
| Validation accuracy | 94.4% |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
from scipy.special import softmax
model_id = "Izziemirg/medsentinel-adr-deberta"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
def classify_adr(text):
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
max_length=256,
padding=True
)
with torch.no_grad():
logits = model(**inputs).logits.numpy()
probs = softmax(logits, axis=-1)[0]
label = "Severe" if probs[1] > 0.5 else "Non-Severe"
return {"label": label, "confidence": round(float(probs.max()), 4)}
# Example
text = "I experienced severe insomnia, heart palpitations, and extreme anxiety
after taking this medication for two weeks."
print(classify_adr(text))
# {'label': 'Severe', 'confidence': 0.9731}
If you use this model in your research, please cite:
@misc{mirghani2025medsentinel,
title = {MedSentinel: ADR Severity Classification with DeBERTa-v3},
author = {Mirghani, Izzie},
year = {2026},
howpublished = {HuggingFace Hub},
url = {https://huggingface.co/Izziemirg/medsentinel-adr-deberta}
}
Izzie Mirghani MS Business Analytics, UVA Darden
Part of the MedSentinel ADR Intelligence Platform project.