Patient Condition Classifier

A DeBERTa-v3-large model fine-tuned on the UCI Drug Reviews dataset to predict a patient's medical condition from their drug review text.

Accuracy: 82.8% | Weighted F1: 81.0% | 700+ conditions | <50ms inference

Model Description

Given a free-text drug review, this model predicts what medical condition the patient is being treated for across 700+ conditions.

Input Format

The model was trained with drug names prepended:

Drug: <drug_name>. Review: <review_text>

Quick Start

from transformers import AutoTokenizer, AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("noamaanMulla-03/patient-condition-classifier")
tokenizer = AutoTokenizer.from_pretrained("noamaanMulla-03/patient-condition-classifier")

review = "Drug: adderall. Review: Helps me focus at work. My ADHD is finally manageable."
inputs = tokenizer(review, truncation=True, max_length=512, return_tensors="pt")
outputs = model(**inputs)
prediction = model.config.id2label[outputs.logits.argmax(dim=-1).item()]
print(prediction)  # "adhd"

Training

  • Model: microsoft/deberta-v3-large (304M params)
  • GPU: NVIDIA L4 (24 GB, bf16)
  • Loss: Focal Loss (gamma=2) + Label Smoothing (0.1) + Class Weights
  • Dropout: 0.2 hidden, 0.2 attention, 0.3 classifier
  • Epochs: 5, cosine LR schedule
  • Dataset: UCI Drug Reviews (Drugs.com)

Results

Experiment Accuracy F1
Baseline (base, 128 tokens) 67.4% 63.9%
Base, 512 tokens 73.1% 69.4%
Large, full pipeline 82.8% 81.0%

Citation

@misc{patient-condition-classifier,
  author       = {Noamaan Mulla},
  title        = {Patient Condition Classifier},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/noamaanMulla-03/patient-condition-classifier}}
}
Downloads last month
61
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support