Highly Effective Arabic Diacritization using Sequence to Sequence Modeling

Hamdy Mubarak, Ahmed Abdelali, Hassan Sajjad, Younes Samih, Kareem Darwish

Introduction

Arabic orthography typically omits short vowels (diacritics), which are essential for resolving lexical and grammatical ambiguities. For example, the undiacritized string "AlElm" can be interpreted as AaloEalam ("the flag") or AaloEilom ("the science"). Accurate diacritization involves predicting both core-word (CW) diacritics, which determine lexical meaning, and case endings (CE), which reflect grammatical roles. While previous state-of-the-art systems relied on complex feature engineering and linguistic rules, this work proposes a data-driven approach using character-level sequence-to-sequence (seq2seq) modeling.

Methodology

The researchers framed diacritization as a sequence transformation task, akin to neural machine translation. To address common seq2seq issues like hallucinations and word skipping in long sequences, they introduced several key architectural innovations:

  • Character-Level Modeling: By operating on characters rather than words, the model effectively handles Arabic's rich morphology and eliminates the Out-Of-Vocabulary (OOV) problem.
  • Sliding Window Context: The model processes text in fixed-size windows (e.g., 7 words). This provides sufficient local context for disambiguation while maintaining model stability.
  • Multi-Window Voting: As windows overlap, each word is diacritized multiple times. A voting mechanism selects the most frequent prediction, serving as an inherent error-correction step.
Illustration of the sliding window mechanism with window size c=3.

The final system utilizes an ensemble of LSTM and Transformer architectures to leverage the strengths of both sequential and attention-based modeling.

Experimental Setup

The models were trained on a comprehensive modern Arabic corpus containing 4.5 million tokens. Evaluation was conducted on the WikiNews benchmark (18.3k words), allowing for direct comparison with existing literature. The dataset covers diverse domains including politics, sports, and health.

Key Results

The proposed system achieved a new state-of-the-art Word Error Rate (WER) of 4.49%, representing a 63.3% relative reduction in error compared to the previous best system (12.25%).

Detailed performance metrics across various experimental setups, showing the progression from baseline models to the final combined system (Exp 12).

As shown in the experimental results, the character-level models with overlapping windows and voting (Exp 07-11) significantly outperformed word-level baselines. The final combination (Exp 12) achieved:

  • Core WER: 1.89% (lexical accuracy)
  • CE WER: 2.89% (grammatical accuracy)
  • OOV Rate: 0.00% (complete coverage)

Analysis of remaining errors indicates that 24% of case ending mistakes are due to long-distance dependencies exceeding the 7-word window, while 32% of core-word errors involve rare named entities.

Conclusion

This work demonstrates that treating Arabic diacritization as a character-level seq2seq task with localized windowing and voting is highly effective. The system sets a new benchmark for the field, significantly reducing the "missing vowel" mystery in Arabic NLP. Future research will explore larger context windows and the integration of gazetteers to address long-distance dependencies and named entity recognition.

Summary updated

BibTeX
@inproceedings{mubarak2019highly,
  author = {Hamdy Mubarak and Ahmed Abdelali and Hassan Sajjad and Younes Samih and Kareem Darwish},
  title = {{Highly Effective Arabic Diacritization using Sequence to Sequence Modeling}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1248},
}
Figure