Abstract
Arabic text is predominantly written without short vowels (diacritics), leading to significant phonetic and semantic ambiguity. This paper presents a high-performance system for automatic diacritization across four Arabic varieties: Modern Standard (MSA), Classical (CA), Moroccan (DA-MA), and Tunisian (DA-TN). By framing diacritization as a character-level sequence-to-sequence translation task, the proposed system achieves state-of-the-art results, significantly reducing Word Error Rates (WER) compared to existing methods without the need for manual feature engineering.
Introduction
Arabic is an "abjad" language where consonants are written but short vowels are typically omitted. While native speakers use context to resolve ambiguities, the lack of diacritics poses challenges for non-native learners and automated systems like Text-to-Speech (TTS) and Natural Language Processing (NLP). Most research focuses on Modern Standard Arabic (MSA), neglecting Classical Arabic (CA) and regional dialects. This work addresses the diversity of the Arabic language by providing a unified, modular framework for four distinct varieties.
System Architecture
The authors propose a modular pipeline that treats diacritization as a "translation" from undiacritized characters to diacritized ones. The process involves several key stages:
- Variety Identification: Before diacritizing, the system uses a fastText classifier (trained on character n-grams) to identify which variety of Arabic is being used. This ensures the correct specialized model is applied.
- Preprocessing: The system uses the Farasa toolkit for tokenization and text cleaning, such as normalizing non-Arabic characters.
- Neural Machine Translation (NMT): The core engine is a character-based seq2seq model built on OpenNMT. Unlike traditional models that use words or hand-crafted morphological features, this model looks at raw character sequences, bypassing the "out-of-vocabulary" problem.
- Sliding Window & Voting: To handle long sentences while maintaining local context, the system processes text in overlapping 7-word windows. Because a single word might appear in multiple windows, a voting mechanism selects the most frequent diacritization for the final output.
Experimental Setup and Datasets
The study utilizes several large-scale corpora to train and validate the models:
- MSA: 4.5 million words for training; tested on the WikiNews corpus.
- Classical Arabic (CA): A massive 65-million-word corpus. The authors introduced a new, highly consistent test set of 5,000 sentences (400k words), made publicly available to the research community.
- Dialectal Arabic (DA): Diacritized translations of the New Testament into Moroccan (166k words) and Tunisian (157k words).
Results and Discussion
The system established new state-of-the-art (SOTA) benchmarks across the board, measured by Word Error Rate (WER)—where lower is better. As shown in the comparative results, the system significantly outperforms previous models like Microsoft ATKS and Farasa across all tested varieties.
Beyond accuracy, the system is highly efficient. In testing, it processed 10,000 requests in under 15 seconds on a standard 4-core CPU, proving it is viable for real-time web applications. The character-level approach proves superior to word-level modeling, effectively capturing prefix/suffix patterns essential for Arabic grammar without requiring manual feature engineering.
Conclusion
This research demonstrates that treating diacritization as a character-level translation task is a robust and scalable solution for the complexities of the Arabic language. While the system achieves high accuracy, future work will focus on resolving long-distance dependencies and semantic ambiguities like active vs. passive voice, which remain challenging for current seq2seq architectures.
Summary updated