Downloads · 30 days
54
1% of all-time downloads
OzzeY72/biobert-medical-specialities2
biobert-medical-specialities2 is a text classification model from OzzeY72. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
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.
Downloads · 30 days
54
1% of all-time downloads
All-time downloads
4.7K
Public
Parameters
108M
433 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors433 MB · 100%
From the Hugging Face model README
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.
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
dmis-lab/biobert-base-cased-v1.1martagm17/testfrom 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}")