🧠 BioBERT-Medical-Specialities2

BioBERT-Medical-Specialities2 is a fine-tuned BioBERT model for multi-class medical text classification.
It classifies short medical questions or symptom descriptions into one of 35 clinical specialities.

πŸ“Š Labels

This model predicts the following 35 medical specialties:

None, Cardiology, Hematology, Oncology, Endocrinology, Respiratory, Allergy, Dermatology, Nephrology, Gastroenterology, Rheumatology, Otorhinolaryngology, Anesthesiology, Biochemistry, Pharmacology, Psychiatry, Microbiology, Physiology, Pathology, Obstetrics, Gynecology, Surgery, Emergency, Orthopedics, Neurology, Urology, Anatomy, Genetics, Radiology, Ophthalmology, Odontology, Pediatrics, Geriatrics, Nursing, Chemistry, Psychology

πŸ“¦ Model Details


πŸš€ How to Use

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load model and tokenizer
model_name = "your-username/biobert-medical-specialities"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Example input
text = "I have constant chest pain and shortness of breath."

# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
predicted_label = model.config.id2label[predicted_class_id]

print(f"Predicted medical speciality: {predicted_label}")
Downloads last month
7
Safetensors
Model size
108M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for OzzeY72/biobert-medical-specialities2

Finetuned
(1)
this model

Dataset used to train OzzeY72/biobert-medical-specialities2