Downloads · 30 days
0
ounachad/araelectra-mlm-dapt-ahqad
araelectra-mlm-dapt-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 AraELECTRA generator checkpoint continued with masked language modeling (DAPT-MLM) on the AHQAD/AHD Arabic health question–answer corpus. The model is intended for constrained…
Downloads · 30 days
0
Access
Public
Updated Jan 28, 2026
Parameters
135M
1.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt1.1 GB · 67%
From the Hugging Face model README
This repository releases a domain-adapted AraELECTRA generator checkpoint continued with masked language modeling (DAPT-MLM) on the AHQAD/AHD Arabic health question–answer corpus.
The model is intended for constrained 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 = "عندي ألم في ___ منذ أسبوع؟"
# example: replace the placeholder with one or more [MASK]
masked = text.replace("___", tokenizer.mask_token)
inputs = tokenizer(masked, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
# get the top prediction for the first mask position
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]))