Table of Contents
Fetching ...

Artificial Intelligence for Sentiment Analysis of Persian Poetry

Arash Zargar, Abolfazl Moshiri, Mitra Shafaei, Shabnam Rahimi-Golkhandan, Mohamad Tavakoli-Targhi, Farzad Khalvati

Abstract

Recent advancements of the Artificial Intelligence (AI) have led to the development of large language models (LLMs) that are capable of understanding, analysing, and creating textual data. These language models open a significant opportunity in analyzing the literature and more specifically poetry. In the present work, we employ multiple Bidirectional encoder representations from transformers (BERT) and Generative Pre-trained Transformer (GPT) based language models to analyze the works of two prominent Persian poets: Jalal al-Din Muhammad Rumi (Rumi) and Parvin E'tesami. The main objective of this research is to investigate the capability of the modern language models in grasping complexities of the Persian poetry and explore potential correlations between the poems' sentiment and their meters. Our findings in this study indicates that GPT4o language model can reliably be used in analysis of Persian poetry. Furthermore, the results of our sentiment analysis revealed that in general, Rumi's poems express happier sentiments compared to Parvin E'tesami's poems. Furthermore, comparing the utilization of poetic meters highlighted Rumi's poems superiority in using meters to express a wider variety of sentiments. These findings are significant as they confirm that LLMs can be effectively applied in conducting computer-based semantic studies, where human interpretations are not required, and thereby significantly reducing potential biases in the analysis.

Artificial Intelligence for Sentiment Analysis of Persian Poetry

Abstract

Recent advancements of the Artificial Intelligence (AI) have led to the development of large language models (LLMs) that are capable of understanding, analysing, and creating textual data. These language models open a significant opportunity in analyzing the literature and more specifically poetry. In the present work, we employ multiple Bidirectional encoder representations from transformers (BERT) and Generative Pre-trained Transformer (GPT) based language models to analyze the works of two prominent Persian poets: Jalal al-Din Muhammad Rumi (Rumi) and Parvin E'tesami. The main objective of this research is to investigate the capability of the modern language models in grasping complexities of the Persian poetry and explore potential correlations between the poems' sentiment and their meters. Our findings in this study indicates that GPT4o language model can reliably be used in analysis of Persian poetry. Furthermore, the results of our sentiment analysis revealed that in general, Rumi's poems express happier sentiments compared to Parvin E'tesami's poems. Furthermore, comparing the utilization of poetic meters highlighted Rumi's poems superiority in using meters to express a wider variety of sentiments. These findings are significant as they confirm that LLMs can be effectively applied in conducting computer-based semantic studies, where human interpretations are not required, and thereby significantly reducing potential biases in the analysis.
Paper Structure (6 sections, 1 equation, 5 figures, 3 tables)

This paper contains 6 sections, 1 equation, 5 figures, 3 tables.

Figures (5)

  • Figure 1: Average Quadratic Weighted Kappa (QWK) of each aggregation method against the individual human annotators. Mean method shows the best performance.
  • Figure 2: Comparison of average sentiment scores assigned by various LLMs to Rumi’s and Parvin E'tesami’s poems. (a) Average sentiment for Rumi’s poems across LLMs. (b) Average sentiment for Parvin E'tesami’s poems across LLMs.(c) Average sentiment for each meter in Rumi’s poems that contain more than 15 poems across LLMs. (d) Average sentiment for each meter in Parvin E'tesami’s poems that contain more than 15 poems across LLMs. The results highlight significant differences in the average sentiment scores returned by different LLMs. Furthermore, it is observed that there is a consistent trend of higher sentiment scores in Rumi’s work regardless of the model used.
  • Figure 3: Identification of poetic meters associated with positive sentiment in Rumi’s and Parvin E'tesami’s poems. (a) Meters (containing more than 15 poems) with the highest average sentiment scores in Rumi’s poems. (b) Percentage of Rumi’s poems with happy sentiments in the identified meters (containing more than 15 poems). (c) Meters (containing more than 15 poems) with the highest average sentiment scores in Parvin E'tesami’s poems. (d) Percentage of Parvin E'tesami’s poems with happy sentiments in the identified meters (containing more than 15 poems). (e) Comparison of common meters used by both poets, showing distinction between utilizing poems in the poets’ artworks.
  • Figure 4: Sentiment entropy across poetic meters in Rumi’s and Parvin E'tesami’s poems. (a) Entropy of sentiment distribution in Rumi’s poems. (b) Entropy of sentiment distribution in Parvin E'tesami’s poems. The results highlight Rumi’s masterful use of meters to convey diverse sentiments.
  • Figure 5: (a) Standard deviation of sentiment scores in Rumi’s and Parvin E'tesami’s poems, illustrating the variability of emotional expression. Rumi’s poems show a wider range of deviations from the average sentiment. (b) Sentiment polarization in Rumi’s and Parvin E'tesami’s poems, distinguishing between neutral and polarized (very sad or very happy) poems.