Downloads · 30 days
2
5% of all-time downloads
mahmoodulhassan23/medical-question-classifier
medical-question-classifier is a text classification model from mahmoodulhassan23. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of distilbert-base-uncased trained to classify medical and health-related questions into 20 distinct medical specialties (e.g., Cardiology, Pediatrics, Psychiatry, Surgery).
Downloads · 30 days
2
5% of all-time downloads
All-time downloads
40
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-uncased trained to classify medical and health-related questions into 20 distinct medical specialties (e.g., Cardiology, Pediatrics, Psychiatry, Surgery).
openlifescienceai/medmcqadistilbert-base-uncasedfrom transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "mahmoodulhassan23/medical-question-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
question = "Child presenting with high grade fever, rash, and cough."
inputs = tokenizer(question, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
pred_class = torch.argmax(outputs.logits, dim=-1).item()
print(f"Predicted Class ID: {pred_class}")