Ahmed-Selem/Shifaa_Arabic_Medical_Consultations
Viewer • Updated • 84.4k • 837 • 13
Run aya99ma/shifaa-bert-classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/aya99ma/shifaa-bert-classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/aya99ma/shifaa-bert-classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use aya99ma/shifaa-bert-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="aya99ma/shifaa-bert-classifier") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("aya99ma/shifaa-bert-classifier")
model = AutoModelForSequenceClassification.from_pretrained("aya99ma/shifaa-bert-classifier", device_map="auto")هذا الموديل يقوم بتصنيف الأسئلة الطبية العربية إلى 16 فئة (تخصص/قسم طبي متوقع) باستخدام AraBERT بعد Fine-tuning على بيانات منصة شفاء.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
MODEL_ID = "aya99ma/shifaa-bert-classifier"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
model.eval()
text = "لدي صداع شديد منذ يومين"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.inference_mode():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)[0]
pred_id = int(torch.argmax(probs))
label = model.config.id2label[pred_id]
confidence = float(probs[pred_id])
print(label, confidence)
Base model
aubmindlab/bert-base-arabertv02