Tafsir Dataset: A Novel Multi-Task Benchmark for Named Entity Recognition and Topic Modeling in Classical Arabic Literature

Sajawel Ahmed, Rob van der Goot, Misbahur Rehman, Carl Kruse, Ömer Özsoy, Alexander Mehler, Gemma Roig

Introduction

While modern Natural Language Processing (NLP) has achieved remarkable success in high-resource languages like English, historical languages—the lingua franca of ancient science and philosophy—remain significantly underserved. Classical Arabic (CA) is a prime example; despite its vast literary heritage, it suffers from a profound "resource poverty" in the machine learning community.

Beyond the scarcity of annotated data, CA presents unique technical hurdles. Ancient texts often lack punctuation, complicating sentence segmentation. Furthermore, the Arabic script has evolved; modern versions utilize vocalization marks (Tashkil) and diacritic dots (I’jam) that were absent in the earliest manuscripts. This evolution creates a "noise" problem for models, where a single word can manifest in numerous surface forms depending on its vocalization, leading to inflated vocabularies and increased memory requirements.

Methodology: Script Compression and Modeling

The researchers addressed these challenges through a combination of expert annotation and a novel preprocessing technique termed "script compression." This process involves gradually stripping away layers of the language to reach its ancient "skeleton" form.

Preprocessing layers from vocalized to skeleton Arabic script.

As illustrated in Figure 1, the text is transformed through three stages:

  1. Vocalized: The modern script including all short vowels and diacritics.
  2. Standard: The removal of short vowels (Tashkil).
  3. Skeleton (Rasm): The removal of diacritic dots (I’jam), which reduces the number of distinct letters from 28 to just 16.

To evaluate the impact of these forms, the authors utilized lightweight BiLSTM-CRF models and transformer-based architectures (via the MaChAmp toolkit). They trained word embeddings from scratch on a massive corpus of 134 million CA sentences, testing whether the simplified "skeleton" script could maintain performance while improving efficiency.

The Tafsir Dataset

The core contribution of this work is the Tafsir Dataset, a large-scale multi-task benchmark manually annotated from the encyclopedic Tafsir Al-Tabari, a 9th-century work on Quranic exegesis. The dataset is significantly larger than existing open-source Arabic NER benchmarks, providing a robust foundation for training and evaluation.

Comparison of Tafsir-2022 with existing Arabic NER datasets.

As shown in Figure 2, the Tafsir-2022 corpus contains 51,704 sentences—nearly ten times the size of the widely used ANERCorp-2007. It includes 176,105 Person (PER) tags, 5,583 Location (LOC) tags, and 22,026 Organization (ORG) tags. Additionally, the text is categorized into 15 specific topics relevant to classical studies, such as jurisprudence (fiqh), linguistics (lugha), and Islamic theology (kalam).

Key Results and Discussion

The experimental results demonstrate both the quality of the dataset and the viability of script compression:

  • State-of-the-Art NER: Utilizing the bert-base-arabertv02 model, the authors achieved a 95.58% F1-score for CA-NER on standard script.
  • The "Skeleton" is Sufficient: Surprisingly, models performed remarkably well on the Rasm script. In BiLSTM tests, the skeleton script achieved an 87.13% F1-score, nearly identical to the standard script's 87.41%. This suggests that neural models can effectively leverage surrounding context to disambiguate the simplified script.
  • Efficiency Gains: Script compression proved to be a practical optimization, reducing Word2vec model size from 1.5 GB to 1.2 GB without a significant loss in accuracy.
  • Topic Modeling Challenges: While NER was highly successful, Topic Modeling (TM) proved difficult, with Macro-F1 scores hovering around 30-40%. This difficulty stems from the unbalanced nature of topics and the complex, normative historical contexts required for accurate labeling.

Conclusion

The Tafsir Dataset establishes a new benchmark for Classical Arabic NLP, proving that large-scale manual annotation can drive significant performance gains. The success of script compression offers a path toward more efficient models for historical languages. While NER for CA is nearing a mature state, Topic Modeling remains a "very hard task" and a primary candidate for future research. Future work will focus on expanding this multi-task approach to other genres, such as scientific and philosophical treatises, to ensure broader generalization across the CA corpus.

Summary updated

BibTeX
@inproceedings{ahmed2022tafsir,
  author = {Sajawel Ahmed and Rob van der Goot and Misbahur Rehman and Carl Kruse and Ömer Özsoy and Alexander Mehler and Gemma Roig},
  title = {{Tafsir Dataset: A Novel Multi-Task Benchmark for Named Entity Recognition and Topic Modeling in Classical Arabic Literature}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2022},
}
Figure