---
title: "Machine Learning-Based Approach for Arabic Dialect Identification"
description: "The paper describes a team's entry to NADI 2021, the second shared task on fine-grained Arabic… 12 references, cited by 5 papers here."
authors: ["Hamada Nayel", "Ahmed Hassan", "Mahmoud Sobhi", "Ahmed El-Sawy"]
year: 2021
venue: "Proceedings of the Sixth Arabic Natural Language Processing Workshop"
source: "https://aclanthology.org/2021.wanlp-1.34/"
licence: "CC BY 4.0 (ACL Anthology)"
licence_url: "https://creativecommons.org/licenses/by/4.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/nayel-2021-machine-learning-based-approach-arabic/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/nayel-2021-machine-learning-based-approach-arabic/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/page/7/) / Machine Learning-Based Approach for Arabic Dialect Identification

# Machine Learning-Based Approach for Arabic Dialect Identification

**Authors:** [Hamada Nayel](https://md.research.elamur.ai/free/en/authors/hamada-nayel/), Ahmed Hassan, Mahmoud Sobhi and Ahmed El-Sawy · **Year:** 2021 · **Venue:** [Proceedings of the Sixth Arabic Natural Language Processing Workshop](https://md.research.elamur.ai/free/en/venues/wanlp/) ([WANLP 2021](https://md.research.elamur.ai/free/en/venues/wanlp/2021/)) · **Publisher:** [Association for Computational Linguistics](https://md.research.elamur.ai/free/en/publishers/association-for-computational-linguistics/) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

**Links:** [Publisher's page](https://aclanthology.org/2021.wanlp-1.34/) · [PDF](https://aclanthology.org/2021.wanlp-1.34.pdf) · [OpenAlex](https://openalex.org/W3152748020)

**Citations:** 8 citations (OpenAlex, 2026-10-14) · [5](https://md.research.elamur.ai/free/en/papers/nayel-2021-machine-learning-based-approach-arabic/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## Summary
The paper describes a team's entry to NADI 2021, the second shared task on fine-grained Arabic dialect identification from tweets. The task has four subtasks. Each tweet is assigned to one of 21 countries or one of 100 provinces, and tweets in dialectal Arabic (DA) and in Modern Standard Arabic (MSA) are handled in separate tracks. For each variety, the organizers provide 21,000 training tweets, 5,000 development tweets and 5,000 unlabelled test tweets, with a strongly skewed class distribution.

The authors use a classical pipeline:
- **Cleaning:** non-Arabic material is stripped, letter variants are normalized and elongated spellings are shortened.
- **Balancing:** minority classes are randomly up-sampled.
- **Features:** tweets are represented as TF/IDF word unigrams.
- **Classifiers:** five are compared, namely Complement Naïve Bayes, Decision Tree, Logistic Regression, Random Forest and SVM.

Complement Naïve Bayes produced the best development scores on most subtasks. Absolute macro-F1 stayed low, especially at province level, where it was around 4%. Even so, the system placed between 3rd and 8th on the test leaderboards. The work shows how far a cheap, transparent baseline can go on a heavily confusable, many-class task.

## Key points
- **Data:** NADI 2021 Twitter corpus with MSA and DA portions, labelled at two levels (21 countries, 100 provinces). The Egyptian class dominates, and all other classes were up-sampled at random to match its size.
- **Features:** word-unigram TF/IDF with a smoothed IDF term, log((N+1)/(df+1)).
- **Preprocessing:**
  - URLs, mentions, emojis, numbers, Latin characters and punctuation are removed.
  - Arabic hashtags are retained.
  - Yaa variants are unified, and the "al" determiner, kashida (tatweel) and diacritics are stripped.
  - Any letter occurring more than twice in a row is collapsed.
- **Development macro-F1 for CNB:**

  | Subtask | Level, variety | Macro-F1 |
  |---|---|---|
  | 1.1 | Country, MSA | 14.06 |
  | 1.2 | Country, DA | 21.34 |
  | 2.1 | Province, MSA | 4.16 |
  | 2.2 | Province, DA | 4.39 |

  The text says CNB won everywhere. However, in the table SVM (4.73) and LR (4.51) beat it on DA province level.
- **Test results:**

  | Subtask | Macro-F1 | Accuracy | Rank |
  |---|---|---|---|
  | 1.1 | 12.99 | 23.24 | 5th |
  | 1.2 | 18.72 | 37.16 | 8th |
  | 2.1 | 3.51 | 3.38 | 4th |
  | 2.2 | 4.55 | 4.80 | 3rd |

## Interesting ideas
- Collapsing runs of a repeated letter (more than two in a row) shrinks the vocabulary of noisy social-media text without hurting real words, a cheap normalization usable in any informal-text pipeline.
- Up-sampling every minority class to the size of the largest one is a simple guard against a classifier collapsing onto the dominant label in skewed data.
- Complement Naïve Bayes, which estimates each class from the data of all other classes, was a strong, fast choice under heavy imbalance and many classes. That makes it a good sanity baseline before heavier models.
- The error analysis notes that identical strings can legitimately belong to several classes, and that location is an imperfect stand-in for the true label. In other words, part of the low score comes from the labels and data rather than the model.
- Provinces sometimes resemble a neighbouring country more than their own, so an administrative hierarchy does not mirror linguistic similarity.

## For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

- **I1** (tokens): Add a reversible elongation normalizer ("soooo" → "so") before lemma lookup, keeping the original surface form and recording the rewrite so the step remains explainable.
- **I2** (learn): When assembling silver training data, rebalance rare constructions or labels so the parser and taggers do not just learn the frequent cases, and report results with and without balancing.
- **I3** (learn): Use a bag-of-words CNB model as a negative control in evaluations, so a structured component must clearly beat it to show it uses real structure.
- **I4** (learn): Tag evaluation items that are inherently ambiguous or labelled via a proxy, and score them separately so true model errors are not mixed with unanswerable cases.
- **I5** (world): When placing dialect or region facts in the ontology, store linguistic closeness as its own relation instead of inferring it from part-of links in the geographic hierarchy.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

📚 Shelves (4): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 16,667 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 16,194 works · [🎭 Arts and Humanities](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/) · 16,039 works · [🗣️ Language and Linguistics](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/language-and-linguistics/) · 15,891 works

🧭 Topics (1): [Semitic languages](https://md.research.elamur.ai/free/en/topics/semitic-languages/) · 2,908 works

## Cite

Cite as: Hamada Nayel, Ahmed Hassan, Mahmoud Sobhi and Ahmed El-Sawy. 2021. Machine Learning-Based Approach for Arabic Dialect Identification. Proceedings of the Sixth Arabic Natural Language Processing Workshop.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{nayel2021machine,
  title = {{Machine Learning-Based Approach for Arabic Dialect Identification}},
  author = {Hamada Nayel, Ahmed Hassan, Mahmoud Sobhi and Ahmed El-Sawy},
  booktitle = {Proceedings of the Sixth Arabic Natural Language Processing Workshop},
  year = {2021},
  url = {https://aclanthology.org/2021.wanlp-1.34/}
}
```

- [← previous AequeVox: Automated Fairness Testing of Speech Recognition Systems](https://md.research.elamur.ai/free/en/papers/rajan-2021-aequevox-automated-fairness-testing-speech/)
- [next → Maintaining Common Ground in Dynamic Environments](https://md.research.elamur.ai/free/en/papers/udagawa-2021-maintaining-common-ground-dynamic-environments/)
- [↑ back to papers of 2021](https://md.research.elamur.ai/free/en/papers/2021/page/7/)

## References

12 references, 8 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. Muhammad Abdul-Mageed, Chiyu Zhang, Houda Bouamor, and Nizar Habash. 2020. [NADI 2020: The first nuanced Arabic dialect identification shared task](https://md.research.elamur.ai/free/en/papers/mageed-2020-nadi-2020-first-nuanced-arabic/). In Proceedings of the Fifth Arabic Natural Language Processing Workshop (WANLP 2020), pages 97–110, Barcelona, Spain (Online). Association for Computational Linguistics. [↗](https://doi.org/10.48550/arxiv.2010.11334)
2. Muhammad Abdul-Mageed, Chiyu Zhang, Abdel-Rahim Elmadany, Houda Bouamor, and Nizar Habash. 2021. [NADI 2021: The Second Nuanced Arabic Dialect Identification Shared Task](https://md.research.elamur.ai/free/en/papers/mageed-2021-nadi-2021-second-nuanced-arabic/). In Proceedings of the Sixth Arabic Natural Language Processing Workshop (WANLP 2021). [↗](https://doi.org/10.48550/arxiv.2103.08466)
3. Ahmed Aliwy, Hawraa Taher, and Zena AboAltaheen. 2020. [Arabic dialects identification for all Arabic countries](https://md.research.elamur.ai/free/en/papers/aliwy-2020-arabic-dialects-identification-all-arabic/). In Proceedings of the Fifth Arabic Natural Language Processing Workshop, pages 302–307, Barcelona, Spain (Online). Association for Computational Linguistics.
4. Haritha Ananthakrishnan, Akshaya Ranganathan, D. Thenmozhi, and Chandrabose Aravindan. 2019. Arabic author profiling and deception detection using traditional learning methodologies with word embedding. In Working Notes of FIRE 2019 - Forum for Information Retrieval Evaluation, Kolkata, India, December 12-15, 2019, volume 2517 of CEUR Workshop Proceedings, pages 100–104. CEUR-WS.org. [find](https://scholar.google.com/scholar?q=Haritha+Ananthakrishnan%2C+Akshaya+Ranganathan%2C+D%2E+Thenmozhi%2C+and+Chandrabose+Aravindan%2E+2019%2E+Arabic+author+profiling+and+deception+detection+using+traditional+learning+methodologies+with+word+embeddin)
5. Houda Bouamor, Sabit Hassan, and Nizar Habash. 2019. [The madar shared task on arabic fine-grained dialect identification](https://md.research.elamur.ai/free/en/papers/bouamor-2019-madar-shared-task-arabic-fine/). In Proceedings of the Fourth Arabic Natural Language Processing Workshop, pages 199–207.
6. Moataz Mansour, Moustafa Tohamy, Zeyad Ezzat, and Marwan Torki. 2020. [Arabic dialect identification using BERT fine-tuning](https://md.research.elamur.ai/free/en/papers/mansour-2020-arabic-dialect-identification-bert-fine/). In Proceedings of the Fifth Arabic Natural Language Processing Workshop, pages 308–312, Barcelona, Spain (Online). Association for Computational Linguistics.
7. Hamada Nayel. 2020. [NAYEL at SemEval-2020 task 12: TF/IDF-based approach for automatic offensive language detection in Arabic tweets](https://md.research.elamur.ai/free/en/papers/nayel-2020-nayel-semeval-2020-task-12/). In Proceedings of the Fourteenth Workshop on Semantic Evaluation, pages 2086–2089, Barcelona (online). International Committee for Computational Linguistics.
8. Hamada A. Nayel. 2019. NAYEL@APDA: Machine Learning Approach for Author Profiling and Deception Detection in Arabic Texts. In Working Notes of FIRE 2019 - Forum for Information Retrieval Evaluation, Kolkata, India, December 12-15, 2019, volume 2517 of CEUR Workshop Proceedings, pages 92–99. CEUR-WS.org. [find](https://scholar.google.com/scholar?q=Hamada+A%2E+Nayel%2E+2019%2E+NAYEL%40APDA%3A+Machine+Learning+Approach+for+Author+Profiling+and+Deception+Detection+in+Arabic+Texts%2E+In+Working+Notes+of+FIRE+2019+%2D+Forum+for+Information+Retrieval+Evaluation%2C+K)
9. Hamada A. Nayel, Walaa Medhat, and Metwally Rashad. 2019. BENHA@IDAT: Improving Irony Detection in Arabic Tweets using Ensemble Approach. In Working Notes of FIRE 2019 - Forum for Information Retrieval Evaluation, Kolkata, India, December 12-15, 2019, volume 2517 of CEUR Workshop Proceedings, pages 401–408. CEUR-WS.org. [find](https://scholar.google.com/scholar?q=Hamada+A%2E+Nayel%2C+Walaa+Medhat%2C+and+Metwally+Rashad%2E+2019%2E+BENHA%40IDAT%3A+Improving+Irony+Detection+in+Arabic+Tweets+using+Ensemble+Approach%2E+In+Working+Notes+of+FIRE+2019+%2D+Forum+for+Information+Retrieva)
10. Mohammad Salameh, Houda Bouamor, and Nizar Habash. 2018. [Fine-grained arabic dialect identification](https://md.research.elamur.ai/free/en/papers/salameh-2018-fine-grained-arabic-dialect-identification/). In Proceedings of the 27th International Conference on Computational Linguistics, pages 1332– 1344.
11. Yutong Sun, Hui Ning, Kaisheng Chen, Leilei Kong, Yunpeng Yang, Jiexi Wang, and Haoliang Qi. 2019. Author profiling in arabic tweets: An approach based on multi-classification with word and character features. In Working Notes of FIRE 2019 - Forum for Information Retrieval Evaluation, Kolkata, India, December 12-15, 2019, volume 2517 of CEUR Workshop Proceedings, pages 105–109. CEUR-WS.org. [find](https://scholar.google.com/scholar?q=Yutong+Sun%2C+Hui+Ning%2C+Kaisheng+Chen%2C+Leilei+Kong%2C+Yunpeng+Yang%2C+Jiexi+Wang%2C+and+Haoliang+Qi%2E+2019%2E+Author+profiling+in+arabic+tweets%3A+An+approach+based+on+multi%2Dclassification+with+word+and+character+)
12. Samia Touileb. 2020. [LTG-ST at NADI shared task 1: Arabic dialect identification using a stacking classifier](https://md.research.elamur.ai/free/en/papers/touileb-2020-ltg-st-nadi-shared-task/). In Proceedings of the Fifth Arabic Natural Language Processing Workshop, pages 313–319, Barcelona, Spain (Online). Association for Computational Linguistics.

*Updated 1 November 2026*
