MARBERTv2 — Arabic Dialect Identification (18 countries)
Fine-tuned MARBERTv2 for country-level Arabic dialect classification on the QADI tweet dataset.
Test macro-F1: 0.614 (baseline TF-IDF + LinearSVC: 0.582; original QADI paper: 0.606).
Labels: OM, SD, SA, KW, QA, LB, JO, SY, IQ, MA, EG, PL, YE, BH, DZ, AE, TN, LY.
Usage
from transformers import pipeline
clf = pipeline("text-classification", model="zoro6u/marbert-arabic-dialect-id")
clf("شنو الاخبار يا زول كيفك")
# [{'label': 'SD', 'score': 0.99}]
Preprocessing used in training (apply the same before inference): remove @mentions and URLs, strip #, remove diacritics, collapse whitespace.
Training
- Data: QADI, 440k train tweets, 18 balanced country labels (auto-labeled from author profiles, ~91.5% label accuracy per the paper)
- 2 epochs, lr 2e-5, batch 128, max_len 64, fp16, warmup 400 steps, weight decay 0.01
- ~1h40 on 2×T4 (Kaggle)
Per-dialect F1 (test)
| OM | SD | SA | KW | QA | LB | JO | SY | IQ | MA | EG | PL | YE | BH | DZ | AE | TN | LY |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| .52 | .72 | .54 | .65 | .55 | .73 | .49 | .51 | .68 | .71 | .85 | .63 | .41 | .46 | .66 | .51 | .66 | .78 |
Strongest: EG, LY, LB, SD, MA. Weakest: the Gulf cluster and YE, where dialects are close and tweets are short.
Limitations
- Labels are author-level, not text-level: noisy by construction.
- Trained on tweets; expect lower accuracy on formal text or other domains.
- Per-dialect scores have wide error bars (test set 181–1130 samples per class).
Code and baseline: github.com/zoro6u/arabic-dialect-id