Downloads · 30 days
10
10% of all-time downloads
ounachad/arabert-medical-mlm-ahqad
arabert-medical-mlm-ahqad is a machine learning model from ounachad. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository releases a domain-adapted AraBERT checkpoint continued with masked language modeling (DAPT-MLM) on the AHQAD/AHD Arabic health question–answer corpus. The model is intended for constrained clinical que…
Downloads · 30 days
10
10% of all-time downloads
All-time downloads
96
Public
Parameters
135M
541 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors541 MB · 100%
From the Hugging Face model README
This repository releases a domain-adapted AraBERT checkpoint continued with masked language modeling (DAPT-MLM) on the AHQAD/AHD Arabic health question–answer corpus.
The model is intended for constrained clinical question reformulation via mask filling (e.g., replacing a placeholder with one or more [MASK] tokens and predicting only the masked positions).
USERNAME/REPO_NAME
from transformers import AutoTokenizer, AutoModelForMaskedLM
import torch
repo_id = "USERNAME/REPO_NAME"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForMaskedLM.from_pretrained(repo_id)
text = "عندي ألم في ___ منذ أسبوع؟"
masked = text.replace("___", tokenizer.mask_token)
inputs = tokenizer(masked, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
mask_index = (inputs["input_ids"][0] == tokenizer.mask_token_id).nonzero(as_tuple=True)[0][0].item()
pred_id = logits[0, mask_index].argmax(-1).item()
print("Prediction:", tokenizer.decode([pred_id]))