Artificial Intelligence for Sentiment Analysis of Persian Poetry

This study demonstrates that modern large language models, particularly GPT-4o, can effectively analyze the sentiment and metrical structures of Persian poetry by two prominent poets, revealing that Rumi's works generally convey happier sentiments and utilize meters more diversely than Parvin E'tesami's, thereby validating the use of AI for bias-reduced semantic literary analysis.

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

Published 2026-03-13
📖 4 min read☕ Coffee break read

Imagine you have two giant libraries. One is filled with the ancient, mystical poems of Rumi, a 13th-century Persian master who wrote about love, God, and the soul. The other is filled with the works of Parvin E'tesami, a brilliant 20th-century poet who often wrote about social justice, sorrow, and the struggles of life.

For centuries, humans have read these poems to understand their feelings. But what if we could ask a super-smart robot to read them all at once and tell us: "Is this poem happy or sad?" and "Does the rhythm of the poem change how it feels?"

That is exactly what this paper does. The authors used Artificial Intelligence (AI)—specifically advanced "Large Language Models" (like the brains behind modern chatbots)—to act as a digital literary critic.

Here is the story of their experiment, explained simply:

1. The Experiment: Teaching Robots to Feel

The researchers gave the AI a massive task: read thousands of poems from both Rumi and Parvin. They asked the AI to rate every single poem on a scale of 1 to 5:

  • 1 = Deeply Sad (like a rainy Tuesday).
  • 3 = Neutral (like a cloudy day).
  • 5 = Joyful (like a sunny festival).

They used four different types of AI "brains" to do this. Some were generalists (trained on many languages), and some were specialists (trained specifically on modern Persian).

2. The Big Surprise: The "Modern" Robot Failed

The researchers had a hunch that the AI trained specifically on modern Persian (like news articles and social media comments) would be the best at understanding the old, complex poetry.

They were wrong.
It's like hiring a mechanic who only knows how to fix 2024 electric cars to restore a 17th-century wooden carriage. The "modern" AI got confused by the old-fashioned words and metaphors.

The winner was GPT-4o, a massive, general-purpose AI. It didn't know every single ancient word perfectly, but it was smart enough to understand the vibe and the emotion of the poems better than the specialized ones. It was the closest match to what human scholars felt.

3. The Verdict: Rumi is the "Party Poet," Parvin is the "Deep Thinker"

Once the AI analyzed the poems, a clear pattern emerged:

  • Rumi's poems generally scored higher on the happiness scale. They felt more energetic, hopeful, and joyful.
  • Parvin's poems generally scored lower. They felt more serious, melancholic, and grounded in reality.

The AI confirmed what humans have suspected for years: Rumi's work is often a celebration of the soul, while Parvin's work often reflects the weight of the world.

4. The Rhythm Connection: The "Musical Instrument" Analogy

This is the most fascinating part. Persian poetry isn't just about words; it's about meter (the rhythm, like a drumbeat). The researchers asked: "Does a specific rhythm always make a poem happy or sad?"

  • Parvin's Approach: She used her rhythms like a steady drum. She mostly used the same beats to express similar, serious emotions. Her poems were consistent.
  • Rumi's Approach: He used rhythms like a jazz musician. He could take the same drumbeat and make it sound like a joyful dance one minute and a sorrowful lament the next.

The AI measured this using a concept called Entropy (which is just a fancy word for "variety").

  • Rumi had high entropy: He could use one rhythm to express everything from deep sadness to wild joy.
  • Parvin had lower entropy: Her rhythms were more predictable in their emotional tone.

5. Why This Matters

Before this study, analyzing poetry required a human expert to sit down, read, and interpret. It was slow and subjective (two people might disagree).

This paper proves that AI can now do this heavy lifting.

  • It can read thousands of poems in seconds.
  • It can spot patterns humans might miss (like how Rumi uses rhythm to trick our emotions).
  • It reduces human bias.

The Bottom Line

The study is like handing a magnifying glass to a robot and asking it to look at a painting. The robot couldn't explain the philosophy of the painting perfectly, but it could accurately tell us: "This painting is mostly blue and sad," and "That painting is mostly red and energetic."

It shows that while AI isn't a replacement for human poets or scholars, it is a powerful new tool that can help us understand the emotional landscape of literature in ways we never could before. It bridges the gap between ancient art and modern technology, proving that even a robot can appreciate the joy in Rumi's verses.