---
title: "A System for Diacritizing Four Varieties of Arabic — Mubarak 2019"
description: "This demo paper presents a deployed system that adds diacritics back for four varieties: Classical… 24 references, cited by 7 papers here."
authors: ["Hamdy Mubarak", "Ahmed Abdelali", "Kareem Darwish", "Mohamed Eldesouki", "Younes Samih", "Hassan Sajjad"]
year: 2019
venue: "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations"
source: "https://aclanthology.org/D19-3037/"
doi: "10.18653/v1/d19-3037"
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/mubarak-2019-system-diacritizing-four-varieties-arabic/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/mubarak-2019-system-diacritizing-four-varieties-arabic/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/page/6/) / A System for Diacritizing Four Varieties of Arabic

# A System for Diacritizing Four Varieties of Arabic

**Authors:** [Hamdy Mubarak](https://md.research.elamur.ai/free/en/authors/hamdy-mubarak/), [Ahmed Abdelali](https://md.research.elamur.ai/free/en/authors/ahmed-abdelali/), [Kareem Darwish](https://md.research.elamur.ai/free/en/authors/kareem-darwish/), [Mohamed Eldesouki](https://md.research.elamur.ai/free/en/authors/mohamed-eldesouki/), [Younes Samih](https://md.research.elamur.ai/free/en/authors/younes-samih/) and [Hassan Sajjad](https://md.research.elamur.ai/free/en/authors/hassan-sajjad/) · **Year:** 2019 · **Venue:** [Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations](https://md.research.elamur.ai/free/en/venues/emnlp/) ([EMNLP 2019](https://md.research.elamur.ai/free/en/venues/emnlp/2019/)) · **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/D19-3037/) · [PDF](https://aclanthology.org/D19-3037.pdf) · [DOI 10.18653/v1/d19-3037](https://doi.org/10.18653/v1/d19-3037) · [OpenAlex](https://openalex.org/W2970515934)

**Citations:** 10 citations (OpenAlex, 2026-10-14) · [7](https://md.research.elamur.ai/free/en/papers/mubarak-2019-system-diacritizing-four-varieties-arabic/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## Summary
Arabic is usually written without short vowels (diacritics). Readers must infer them to pronounce words, so automatic diacritic restoration matters for text-to-speech and language learning. This demo paper presents a deployed system that adds diacritics back for four varieties: Classical Arabic (CA), Modern Standard Arabic (MSA), and two dialects, Moroccan (DA-MA) and Tunisian (DA-TN).

The approach treats diacritization as character-level translation. An OpenNMT seq2seq model maps undiacritized character sequences to diacritized ones and needs no hand-built features, segmenters or POS taggers. To keep word order fixed, the model works on overlapping 7-word windows, and votes across windows pick each word's final form. Around the model sit:
- Farasa-based cleaning,
- a fastText character-n-gram classifier that guesses the variety,
- a Flask/Gunicorn/NGINX web service with a REST API.

The authors also built a large CA corpus and release a CA test set. Word error rates drop substantially below every compared system for all four varieties, showing that one feature-free architecture transfers across standard and dialectal Arabic.

## Key points
- WER: MSA 4.5% (best prior, Microsoft ATKS, 12.3%); CA 3.7% (Farasa 12.8%); DA-MA 1.4% (Bi-LSTM 2.7%); DA-TN 2.5% (Bi-LSTM 3.6%). This is a 25–60% error reduction over earlier neural systems.
- Data:
  - MSA: 4.5m-word training corpus, tested on WikiNews (18.3k words).
  - CA: a publisher's 65m-word corpus, with a released test set of 5,000 sentences (~400k words).
  - DA: diacritized New Testament translations (166k Moroccan and 157k Tunisian words), split 70/10/20.
- Model: OpenNMT-tf with two RNN layers of 500 units and 300-dimensional embeddings. Inputs are 7-word sliding windows, combined by majority voting; ties go to the window where the word sits in the centre.
- Variety identification: fastText on character 3–6-grams. Accuracy rises with input length, from 93.8% at 5 words to 99.1% at 20 words.
- Deployment: a 4-core, 16 GB Azure VM with no GPU handles about 672 requests per second, averaging 149 ms per request.

## Interesting ideas
- Overlapping fixed-size windows let one token get several predictions, which are then voted on, with the most central context breaking ties; this bounds input length while still giving each token full context.
- Manual error analysis found that in 7% of CA "errors" both the gold and the system output were valid alternatives, so raw WER overstates the error rate.
- The seq2seq model sometimes produced output unrelated to the input, and the authors propose forcing output letters to match input letters exactly.
- A cheap character-level classifier first detects the language variety and routes the text to a dedicated model, with its accuracy reported against input length.

## For Mova

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

- **I1** (tree): Very long sentences could be parsed as overlapping chunks, voting on each token's head and relation and trusting the chunk where the token is most central.
- **I2** (learn): Evaluation could add an explicit "both acceptable" category when sampling disagreements, so models are not penalised for legitimate variant analyses.
- **I3** (back): Generation and the text → graph → text compressor could include a hard check that required content tokens survive the round trip, flagging hallucinated material.
- **I4** (tokens): A similar router could detect register or genre (e.g. informal web text vs. edited prose) before tagging, and log confidence by input length to know when routing is unreliable.

*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: Hamdy Mubarak, Ahmed Abdelali, Kareem Darwish, Mohamed Eldesouki, Younes Samih and Hassan Sajjad. 2019. A System for Diacritizing Four Varieties of Arabic. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations.

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

```bibtex
@inproceedings{mubarak2019system,
  title = {{A System for Diacritizing Four Varieties of Arabic}},
  author = {Hamdy Mubarak, Ahmed Abdelali, Kareem Darwish, Mohamed Eldesouki, Younes Samih and Hassan Sajjad},
  booktitle = {Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations},
  year = {2019},
  doi = {10.18653/v1/d19-3037},
  url = {https://doi.org/10.18653/v1/d19-3037}
}
```

- [← previous The ERG at MRP 2019: Radically Compositional Semantic Dependencies](https://md.research.elamur.ai/free/en/papers/oepen-2019-erg-mrp-2019-radically-compositional/)
- [next → Floating quantifiers are autonomous phrases: A movement analysis](https://md.research.elamur.ai/free/en/papers/khalaf-2019-floating-quantifiers-are-autonomous-phrases/)
- [↑ back to papers of 2019](https://md.research.elamur.ai/free/en/papers/2019/page/6/)

## References

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

1. Nizar Habash, Ramy Eskander, and Abdelati Hawwari. 2012. [A morphological analyzer for egyptian arabic](https://md.research.elamur.ai/free/en/papers/habash-2012-morphological-analyzer-egyptian-arabic/). In SIGMORPHON 2012, pages 1–9. ACL.
2. Gheith A. Abandah, Alex Graves, Balkees Al-Shagoor, Alaa Arabiyat, Fuad Jamour, and Majid Al-Taee. 2015. Automatic diacritization of arabic text using recurrent neural networks. International Journal on Document Analysis and Recognition (IJDAR), 18(2):183–197. [↗](https://doi.org/10.1007/s10032-015-0242-2)
3. Nizar Habash and Owen Rambow. 2007. [Arabic diacritization through full morphological tagging](https://md.research.elamur.ai/free/en/papers/habash-2007-arabic-diacritization-through-full-morphological/). In HLT-NAACL, pages 53–56.
4. Mustafa Jarrar, Nizar Habash, Faeq Alrimawi, Diyam Akra, and Nasser Zalmout. 2017. Curras: an annotated corpus for the palestinian arabic dialect. Language Resources and Evaluation, 51(3):745–775. [↗](https://doi.org/10.1007/s10579-016-9370-7)
5. Ahmed Abdelali, Mohammed Attia, Younes Samih, Kareem Darwish, and Hamdy Mubarak. 2018. [Diacritization of maghrebi arabic sub-dialects](https://md.research.elamur.ai/free/en/papers/abdelali-2018-diacritization-maghrebi-arabic-sub-dialects/). arXiv preprint arXiv:1810.06619. [↗](https://arxiv.org/abs/1810.06619)
6. Armand Joulin, Edouard Grave, Piotr Bojanowski, Matthijs Douze, Hérve Jégou, and Tomas Mikolov. 2016. [Fasttext.zip: Compressing text classification models](https://md.research.elamur.ai/free/en/papers/joulin-2016-fasttext-zip-compressing-text-classification/). arXiv preprint arXiv:1612.03651. [↗](https://arxiv.org/abs/1612.03651)
7. Ahmed Abdelali, Kareem Darwish, Nadir Durrani, and Hamdy Mubarak. 2016. [Farasa: A fast and furious segmenter for arabic](https://md.research.elamur.ai/free/en/papers/abdelali-2016-farasa-fast-furious-segmenter-arabic/). In Proceedings of NAACL-HLT 2016 (Demonstrations), pages 11–16. Association for Computational Linguistics.
8. Salam Khalifa, Sara Hassan, and Nizar Habash. 2017. [A morphological analyzer for gulf arabic verbs](https://md.research.elamur.ai/free/en/papers/khalifa-2017-morphological-analyzer-gulf-arabic-verbs/). WANLP 2017, page 35.
9. Ibrahim A. Asadi. 2017. Reading arabic with the diacritics for short vowels: vowelised but not necessarily easy to read. Writing Systems Research, 9(2):137–147. [↗](https://doi.org/10.1080/17586801.2017.1400493)
10. G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. 2017. [OpenNMT: Open-Source Toolkit for Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/klein-2017-opennmt-open-source-toolkit-neural/). ArXiv e-prints.
11. Oleksii Kuchaiev, Boris Ginsburg, Igor Gitman, Vitaly Lavrukhin, Carl Case, and Paulius Micikevicius. 2018. Openseq2seq: extensible toolkit for distributed and mixed precision training of sequence-to-sequence models. arXiv preprint arXiv:1805.10387. [↗](https://arxiv.org/abs/1805.10387)
12. Yonatan Belinkov and James Glass. 2015. [Arabic diacritization with recurrent neural networks](https://md.research.elamur.ai/free/en/papers/belinkov-2015-arabic-diacritization-recurrent-neural-networks/). In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2281– 2285, Lisbon, Portugal.
13. Denny Britz, Anna Goldie, Thang Luong, and Quoc Le. 2017. [Massive Exploration of Neural Machine Translation Architectures](https://md.research.elamur.ai/free/en/papers/britz-2017-massive-exploration-neural-machine-translation/). ArXiv e-prints.
14. Hamdy Mubarak, Ahmed Abdelali, Hassan Sajjad, Younes Samih, and Kareem Darwish. 2019. [Highly effective arabic diacritization using sequence to sequence modeling](https://md.research.elamur.ai/free/en/papers/mubarak-2019-highly-effective-arabic-diacritization-sequence/). In Proceedings of NAACL-HLT 2019.
15. Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. [Learning phrase representations using rnn encoder-decoder for statistical machine translation](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/). arXiv preprint arXiv:1406.1078. [↗](https://arxiv.org/abs/1406.1078)
16. Arfath Pasha, Mohamed Al-Badrashiny, Mona Diab, Ahmed El Kholy, Ramy Eskander, Nizar Habash, Manoj Pooleery, Owen Rambow, and Ryan M Roth. 2014. [Madamira: A fast, comprehensive tool for morphological analysis and disambiguation of arabic](https://md.research.elamur.ai/free/en/papers/pasha-2014-madamira-fast-comprehensive-tool-morphological/). In LREC-2014, Reykjavik, Iceland.
17. Kareem Darwish, Ahmed Abdelali, Hamdy Mubarak, Younes Samih, and Mohammed Attia. 2018. Diacritization of moroccan and tunisian arabic dialects: A CRF approach. In OSACT 3: The 3rd Workshop on Open-Source Arabic Corpora and Processing Tools, page 62. [find](https://scholar.google.com/scholar?q=Kareem+Darwish%2C+Ahmed+Abdelali%2C+Hamdy+Mubarak%2C+Younes+Samih%2C+and+Mohammed+Attia%2E+2018%2E+Diacritization+of+moroccan+and+tunisian+arabic+dialects%3A+A+CRF+approach%2E+In+OSACT+3%3A+The+3rd+Workshop+on+Open%2DSou)
18. Mohsen Rashwan, Ahmad Al Sallab, M. Raafat, and Ahmed Rafea. 2015. Deep learning framework with confused sub-set resolution architecture for automatic arabic diacritization. In IEEE Transactions on Audio, Speech, and Language Processing, pages 505–516. [↗](https://doi.org/10.1109/taslp.2015.2395255)
19. Kareem Darwish, Hamdy Mubarak, and Ahmed Abdelali. 2017. [Arabic diacritization: Stats, rules, and hacks](https://md.research.elamur.ai/free/en/papers/darwish-2017-arabic-diacritization-stats-rules-hacks/). In Proceedings of the Third Arabic Natural Language Processing Workshop, pages 9–17.
20. Ahmed Said, Mohamed El-Sharqwi, Achraf Chalabi, and Eslam Kamal. 2013. A hybrid approach for arabic diacritization. In Natural Language Processing and Information Systems, pages 53–64, Berlin, Heidelberg. [find](https://scholar.google.com/scholar?q=Ahmed+Said%2C+Mohamed+El%2DSharqwi%2C+Achraf+Chalabi%2C+and+Eslam+Kamal%2E+2013%2E+A+hybrid+approach+for+arabic+diacritization%2E+In+Natural+Language+Processing+and+Information+Systems%2C+pages+53%E2%80%9364%2C+Berlin%2C+Heidelb)
21. Moustafa Elshafei, Husni Al-Muhtaseb, and Mansour Alghamdi. 2006. Statistical methods for automatic diacritization of arabic text. In The Saudi 18th National Computer Conference. Riyadh, volume 18, pages 301–306. [find](https://scholar.google.com/scholar?q=Moustafa+Elshafei%2C+Husni+Al%2DMuhtaseb%2C+and+Mansour+Alghamdi%2E+2006%2E+Statistical+methods+for+automatic+diacritization+of+arabic+text%2E+In+The+Saudi+18th+National+Computer+Conference%2E+Riyadh%2C+volume+18%2C+pa)
22. Youssef Sherif. 2018. Arabic tacotron text to speech. [find](https://scholar.google.com/scholar?q=Youssef+Sherif%2E+2018%2E+Arabic+tacotron+text+to+speech%2E)
23. Dimitra Vergyri and Katrin Kirchhoff. 2004. [Automatic diacritization of arabic for acoustic modeling in speech recognition](https://md.research.elamur.ai/free/en/papers/vergyri-2004-automatic-diacritization-arabic-acoustic-modeling/). In Proceedings of the workshop on computational approaches to Arabic script-based languages, COLING’04, pages 66–73, Geneva, Switzerland. [↗](https://doi.org/10.21236/ada457846)
24. Ya’akov Gal. 2002. [An HMM approach to vowel restoration in arabic and hebrew](https://md.research.elamur.ai/free/en/papers/gal-2002-hmm-approach-vowel-restoration-arabic/). In Proceedings of the ACL-02 workshop on Computational approaches to Semitic languages, pages 1–7. Association for Computational Linguistics.

*Updated 1 November 2026*
