Artificial Intelligence for Sentiment Analysis of Persian Poetry
Organizations: Department of Mechanical & Industrial Engineering; Vector Institute for Artificial Intelligence; University of Toronto; Toronto, Canada · Department of Near & Middle Eastern Civilizations; University of Toronto; Toronto, Canada · Independent Researcher · Department of Medical Imaging and Institute of Medical Science; Department of Mechanical & Industrial Engineering; Department of Computer Science; Vector Institute for Artificial Intelligence; University of Toronto; Toronto, Canada
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.
Figures & tables
| BERT Multilingual | Pars-Bert | GPT 4o-mini | GPT 4o | |
|---|---|---|---|---|
| Rumi | 1.0 | 1.0 | 0.9481 | 0.9578 |
| Parvin | 1.0 | 1.0 | 0.9882 | 0.9316 |
| Sentiment evaluator | Human annotator 1 | Human annotator 2 | Human annotator 3 | Human annotator 4 | Pars-Bert | Bert Multilingual | GPT 4o-mini | GPT 4o |
|---|---|---|---|---|---|---|---|---|
| Quadratic Weighted Kappa score | 0.8017 | 0.8025 | 0.7969 | 0.7206 | 0.0006 | 0.0467 | 0.5024 | 0.6003 |
| Absolute Prediction Accuracy (%) | 48 | 47 | 61 | 51 | 6 | 7 | 25 | 33 |
Computational Literary Studies
Computational Literary Studies uses data analysis and language technologies to examine literary style, themes, narratives, influence, and change.
See all 48 papers