  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}.
