Downloads · 30 days
14
16% of all-time downloads
oddadmix/Emhotob-50M-Tashkil-v2
Emhotob-50M-Tashkil-v2 is a text generation model from oddadmix. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-nc-nd-4.0.
A 51.8M-parameter Llama model fine-tuned to add tashkil (diacritics / harakat) to undiacritized Arabic text. Fine-tuned from oddadmix/50M-2048-Emhotob on the full freococo/arabictashkildataset
Downloads · 30 days
14
16% of all-time downloads
All-time downloads
86
Public
Parameters
51.8M
104 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors104 MB · 97%
From the Hugging Face model README
A 51.8M-parameter Llama model fine-tuned to add tashkil (diacritics / harakat)
to undiacritized Arabic text. Fine-tuned from
oddadmix/50M-2048-Emhotob on
the full freococo/arabic_tashkil_dataset
(~1.5M gold-standard vocalized pages of classical Arabic / Islamic texts).
This is v2 of the series — trained on ~20× more data than
oddadmix/Emhotob-50M-Tashkil-v1
and substantially better at word preservation.
License note: the training data is licensed CC BY-NC-ND 4.0 (non-commercial, no-derivatives). This model is released under the same license to respect the upstream terms. Use accordingly.
Prompt-masked supervised fine-tuning (causal LM). Loss is computed only on the diacritized output span:
شكِّل النص العربي التالي:
{undiacritized text}
### الرد:
{diacritized text}</s> ← loss only here
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "oddadmix/Emhotob-50M-Tashkil-v2"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16).cuda().eval()
text = "ذهب الطالب الى المدرسة"
prompt = f"شكِّل النص العربي التالي:\n{text}\n### الرد:\n"
ids = [tok.bos_token_id] + tok.encode(prompt, add_special_tokens=False)
out = model.generate(
torch.tensor([ids]).cuda(),
max_new_tokens=512, do_sample=False,
eos_token_id=tok.eos_token_id, pad_token_id=tok.pad_token_id,
)
print(tok.decode(out[0][len(ids):], skip_special_tokens=True))
max-chars 2500 pre-filter; ~32% of
pages that would require truncation were dropped rather than corrupt the add-only
training signal). A disjoint 4,000-row validation set was carved with a fixed seed.300 held-out rows, greedy decoding.
In-domain (freococo clean held-out):
| Metric | Value |
|---|---|
| Diacritic Error Rate (DER) ↓ | 1.32% |
| Character accuracy ↑ | 98.68% |
| Exact sentence match ↑ | 32.67% |
| Word preservation — skeleton exact ↑ | 97.33% |
| Word preservation — word-count match ↑ | 98.33% |
| Word preservation — mean word survival ↑ | 98.60% |
Zero-shot on the arbml test split (never seen during training):
| Metric | Value |
|---|---|
| DER ↓ | 2.03% |
| Word preservation — skeleton exact ↑ | 95.33% |
| Word preservation — mean word survival ↑ | 97.98% |
vs v1: in-domain DER improves 1.88% → 1.32%, and the "add-only" word-preservation weak spot is largely fixed (skeleton-exact 89.7% → 97.3%). Even zero-shot on arbml, v2 preserves words far better than v1; its slightly higher DER there reflects domain shift, not a regression.
skeleton exact = strip all diacritics from the output and check it equals the input
character-for-character — the strongest guarantee the model only added marks.
§ and
-[NN]- structural markers preserved). Domain-shifted text may see higher DER.