Downloads · 30 days
32
54% of all-time downloads
alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026
marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026 is a token classification model from alighabusaleh. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as cc-by-4.0.
🚀 Try it live: Dialectal Arabic demos runs this model in your browser.
Downloads · 30 days
32
54% of all-time downloads
All-time downloads
59
Public
Parameters
162M
649 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors649 MB · 100%
From the Hugging Face model README
🚀 Try it live: Dialectal Arabic demos runs this model in your browser.
A fine-tuned MARBERTv2 token classifier that detects character-level error spans in English→Arabic-dialect machine translations and assigns each span an LQM/MQM-style error category. It is TTLab's system for AlexandriaX-2026 Subtask 3 and is described in TTLab at AlexandriaX-2026: A Fine-Tuned Surface Tagger for Arabic Machine-Translation Error-Span Detection and Classification (Abusaleh, Verma & Mehler, ArabicNLP 2026).
This is the exact checkpoint of our official leaderboard submission (focal loss, rare categories collapsed into other), which ranked 3rd in AlexandriaX-2026 Subtask 3 with an official test Overall Score of 40.91. Running the bundled inference.py on the released test set reproduces the submitted predictions exactly (145/145 sentences).
A revised variant without category collapsing, which scored higher post-hoc, is available at alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026-nocollapse.
UBC-NLP/AlexandriaX_Subtask_3 (1,125 train / 138 dev sentences)ENG_EGY (Egyptian), ENG_MAU (Mauritanian), ENG_MOR (Moroccan), ENG_PAL (Palestinian), ENG_UAE (Emirati)The model tags each sub-word token of the Arabic MT output only (the English source is not an input) over the labels
O, morphosyntax, semantics, sociolinguistics, other. At inference, a token is flagged as an error when 1 - P(O) reaches a dialect-specific threshold
τ_d, and it takes the most probable error category. Contiguous same-category tokens are merged, mapped back to
character offsets with the tokenizer's offset mapping, trimmed of whitespace and punctuation, and spans shorter than
2 characters are dropped.
The head predicts O, morphosyntax, semantics, sociolinguistics and other. other is the three rarest categories (orthography, pragmatics, graphetics) merged during training, and it is mapped back to orthography_writing_conventions (the most frequent of the three) at decoding time, via label_map in span_decoding.json. As a result, pragmatics and graphetics are never predicted.
The thresholds are stored in span_decoding.json:
| Direction | τ_d |
|---|---|
ENG_EGY | 0.225 |
ENG_MAU | 0.4 |
ENG_MOR | 0.4 |
ENG_PAL | 0.25 |
ENG_UAE | 0.3 |
The span decoding (thresholds + merging) lives in inference.py, which ships in this repo:
from huggingface_hub import hf_hub_download
import importlib.util, sys
spec = importlib.util.spec_from_file_location("inference", hf_hub_download("alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026", "inference.py"))
inference = importlib.util.module_from_spec(spec); spec.loader.exec_module(inference)
tagger = inference.ErrorSpanTagger("alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026")
mt = "يلا خلّك وياها، هذا خرابيط. انت ما تدري إذا هي تأن ولا لا، وإذا هي تأن يسمونه أنين ليلي. نحنا بعدنا وايد بدري."
print(tagger.predict(mt, direction="ENG_UAE"))
# [{'text': ..., 'start': ..., 'end': ..., 'category': ...}, ...]
Batch tagging of a JSONL file (id, direction, source, model_prediction per line), writing the
Codabench LQM_prediction_tagged_errors format:
python inference.py alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026 test.jsonl predictions.jsonl
To get raw per-token probabilities, the checkpoint loads as a standard BertForTokenClassification:
from transformers import AutoTokenizer, AutoModelForTokenClassification
tok = AutoTokenizer.from_pretrained("alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026")
model = AutoModelForTokenClassification.from_pretrained("alighabusaleh/marbertv2-arabic-dialect-mt-error-span-detection-alexandriax2026")
For an unseen direction, the decoder falls back to τ = 0.4.
| Backbone | UBC-NLP/MARBERTv2 (fine-tuned end-to-end, linear head, dropout 0.1) |
| Data | full AlexandriaX Subtask 3 training set (1,125 sentences) |
| Loss | focal loss, γ = 2, O class weight α = 0.3 |
| Optimiser | AdamW, lr 2e-5, batch 16, 12 epochs, grad-clip 1.0 |
| Max length | 192 sub-word tokens (longer outputs are truncated) |
| Seed | 42 |
| Thresholds | per-direction, tuned on 5-fold out-of-fold predictions over the grid 0.20 to 0.70 in steps of 0.025 |
Overall = (overlap-span F1 + category F1) / 2, in percent. The official Codabench metric uses macro averages over directions. Our dev "proxy" uses character-overlap F1 + category micro-F1 and is not directly comparable.
| Split | Overall | Notes |
|---|---|---|
| Official test (Codabench) | 40.91 | official metric; rank 3 |
| Dev (138 sents, our proxy scorer) | 37.5 | overlap F1 44.3, category micro-F1 30.8 |
The paper's dev number for this system (40.8) comes from the model-selection run in the development notebook. This checkpoint is the one retrained on the full training set for the test submission, so its dev score differs.
sociolinguistics accounts for 58% of spans and graphetics has
2 training examples. Localisation is reasonable (overlap F1 ≈ 46–48), but category assignment is the bottleneck:
morphosyntax, pragmatics and graphetics are rarely or never recovered.If you use this model, please cite:
@inproceedings{Abusaleh:et:al:2026:mt,
title = {TTLab at AlexandriaX-2026: A Fine-Tuned Surface Tagger for Arabic
Machine-Translation Error-Span Detection and Classification},
author = {Ali Abusaleh and Bhuvanesh Verma and Alexander Mehler},
booktitle = {SIGARAB ArabicNLP 2026 AlexandriaX Shared Task},
year = {2026},
address = {Budapest, Hungary},
note = {accepted}
}
The model builds on MARBERTv2 (Abdul-Mageed et al., ACL 2021) and the AlexandriaX-2026 shared-task data; please cite those as well where appropriate.