[Paper Review] AraPoemBERT: A Pretrained Language Model for Arabic Poetry Analysis
AraPoemBERT is a BERT-based language model pre-trained exclusively on 2.09 million Arabic poetry verses, enabling state-of-the-art performance in domain-specific NLP tasks. It achieves 99.34% accuracy in poet gender classification, 97.79% in sub-meter classification, and 99.03% in meter classification, outperforming general-purpose Arabic models on poetry analysis tasks.
Arabic poetry, with its rich linguistic features and profound cultural significance, presents a unique challenge to the Natural Language Processing (NLP) field. The complexity of its structure and context necessitates advanced computational models for accurate analysis. In this paper, we introduce AraPoemBERT, an Arabic language model pretrained exclusively on Arabic poetry text. To demonstrate the effectiveness of the proposed model, we compared AraPoemBERT with 5 different Arabic language models on various NLP tasks related to Arabic poetry. The new model outperformed all other models and achieved state-of-the-art results in most of the downstream tasks. AraPoemBERT achieved unprecedented accuracy in two out of three novel tasks: poet's gender classification (99.34\% accuracy), and poetry sub-meter classification (97.79\% accuracy). In addition, the model achieved an accuracy score in poems' rhyme classification (97.73\% accuracy) which is almost equivalent to the best score reported in this study. Moreover, the proposed model significantly outperformed previous work and other comparative models in the tasks of poems' sentiment analysis, achieving an accuracy of 78.95\%, and poetry meter classification (99.03\% accuracy), while significantly expanding the scope of these two problems. The dataset used in this study, contains more than 2.09 million verses collected from online sources, each associated with various attributes such as meter, sub-meter, poet, rhyme, and topic. The results demonstrate the effectiveness of the proposed model in understanding and analyzing Arabic poetry, achieving state-of-the-art results in several tasks and outperforming previous works and other language models included in the study. AraPoemBERT model is publicly available on \url{https://huggingface.co/faisalq}.
Motivation & Objective
- To develop a specialized Arabic language model tailored for Arabic poetry, addressing the limitations of general-purpose models in capturing poetic linguistic and structural features.
- To create a large-scale, multi-attribute dataset of Arabic poetry with annotations for meter, sub-meter, rhyme, poet, sentiment, and gender for downstream NLP tasks.
- To explore novel NLP tasks in Arabic poetry, including poet gender classification and sub-meter classification, which have not been previously addressed in the literature.
- To demonstrate the superiority of domain-specific pretraining by comparing AraPoemBERT against five existing Arabic language models across multiple poetry analysis tasks.
- To provide publicly available resources—model weights and dataset—for future research in Arabic NLP, linguistics, and cultural studies.
Proposed method
- Pretrained the AraPoemBERT model from scratch on a curated dataset of 2.09 million Arabic poetry verses collected from online sources, focusing exclusively on poetic text to capture linguistic and rhythmic patterns.
- Employed a masked language modeling objective during pretraining, using the BERT architecture to learn contextual representations specific to Arabic poetic structures.
- Fine-tuned the model on five downstream tasks: poet gender classification, poetry meter and sub-meter classification, sentiment analysis, and rhyme detection, using task-specific heads.
- Defined sub-meters as combinations of classical meters and their variants (e.g., Wafer-Majzuu, Rajaz-Complete), enabling fine-grained classification of rhythmic patterns.
- Used a multi-class classification head with cross-entropy loss for all tasks, with model evaluation based on accuracy, F1-score, and macro/weighted averages.
- Conducted ablation studies by comparing AraPoemBERT against five baseline models (including AraBERT and CAMeLBERT-CA) across all tasks to validate performance gains.
Experimental results
Research questions
- RQ1Can a BERT-based language model pre-trained exclusively on Arabic poetry outperform general-purpose Arabic language models in poetry-specific NLP tasks?
- RQ2To what extent can a domain-specific model like AraPoemBERT improve performance in novel tasks such as poet gender classification and sub-meter classification?
- RQ3How effective is AraPoemBERT in capturing and classifying complex poetic features like meter, sub-meter, and rhyme in Arabic poetry?
- RQ4What is the impact of domain-specific pretraining on low-resource poetic attributes such as gender and sentiment in Arabic poetry?
- RQ5Can AraPoemBERT generalize across diverse poetic styles, including classical and non-classical meters, and handle rare rhyme variants like Taa Marbutah and Waw Hamza?
Key findings
- AraPoemBERT achieved a state-of-the-art accuracy of 99.34% in poet gender classification, significantly outperforming other models despite the extreme class imbalance (360 females vs. 5,023 males).
- The model reached 97.79% accuracy in poetry sub-meter classification, demonstrating its ability to distinguish between classical meters and their variants such as Majzuu and Complete.
- In poetry meter classification, AraPoemBERT achieved 99.03% accuracy, outperforming all comparative models and setting a new benchmark for this task.
- For rhyme classification, AraPoemBERT achieved 97.73% accuracy, with the highest performance on standard Arabic letters, though lower accuracy on rare variants like Taa Marbutah and Waw Hamza due to low sample size.
- The model achieved 78.95% accuracy in sentiment analysis, significantly outperforming previous work and expanding the scope of sentiment analysis in Arabic poetry.
- The confusion matrix for rhyme classification revealed that the model most frequently misclassified 'Laa' as 'Lam' (24.5% of cases), highlighting challenges with homophonic and orthographically similar rhyme variants.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.