← Latest papers
💻 computer science

BhaRaTa: A Novel Framework for Emotion Analysis of Sanskrit Narratives

This paper introduces BhaRaTa, a novel framework for analyzing emotions in Sanskrit literary narratives by applying the classical Indian aesthetic concepts of *bhāva* and *rasa* from the *Nāṭyaśāstra* to computational emotion analysis.

Original authors: Anagha Pradeep, Sushvin Marimuthu, Radhika Mamidi

Published 2026-08-11
📖 7 min read🧠 Deep dive

Original authors: Anagha Pradeep, Sushvin Marimuthu, Radhika Mamidi

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to understand the mood of a room just by listening to the people talking inside. In the world of computer science, this is called "emotion analysis." Usually, computers are pretty good at spotting the basics: is someone happy or sad? Is a review positive or negative? But real life, and especially great stories, is much more complicated than a simple "thumbs up" or "thumbs down." Humans feel a dizzying mix of feelings at once—like being excited but also a little nervous, or angry but also proud.

For a long time, computers have tried to understand these complex feelings using Western psychological maps, which sort emotions into categories like "joy," "fear," or "anger." But what if there was a different map entirely? One that was drawn thousands of years ago in ancient India? This paper dives into a corner of science called Natural Language Processing (NLP), where researchers teach computers to read and understand human language. The big question here is: Can we teach a computer to understand the deep, nuanced emotions of ancient Sanskrit stories using an ancient Indian theory called Rasa? This theory suggests that stories aren't just about what happens, but about the specific "flavor" or aesthetic experience they create in the reader's mind, built up from tiny emotional clues. If we can crack this code, it could help computers understand literature in a much more human way, respecting the unique cultural history of how stories are told.


The Ancient Recipe for Emotion: BhaRaTa

Meet the team behind BhaRaTa (which stands for Bhāva & Rasa Tagging). They are a group of researchers from IIIT-Hyderabad who decided to tackle a very specific, very tricky puzzle: How do you teach a computer to understand the emotions in Sanskrit plays?

Sanskrit is an ancient language, like a linguistic fossil. It's beautiful, but it's also rare in the digital world. There aren't millions of tweets or Reddit posts in Sanskrit for computers to learn from. Plus, the plays themselves are complex. They aren't just dialogue; they are a mix of poetry and prose, filled with physical actions, whispers, and dramatic pauses. The researchers knew that if they tried to use the standard "Western" emotion tools (which look for simple words like "happy" or "sad"), they would miss the magic. So, they built a new framework based on the Nāṭyaśāstra, an ancient treatise on drama that acts like a recipe book for creating emotional experiences.

The Ingredients: Bhāva and Rasa

To understand their experiment, you have to understand their ingredients. The researchers used two main concepts from the ancient text:

  1. Bhāva (The Ingredients): Think of these as the raw emotional states. In a play, a character might feel longing, fear, joy, or determination. These are the specific, moment-to-moment feelings. The researchers identified 31 of these "flavors" to tag in the text.
  2. Rasa (The Finished Dish): This is the big picture. When you mix all those little bhāvas together in a specific way, they create a dominant mood or aesthetic experience for the whole scene, called Rasa. It's like how mixing flour, sugar, and eggs creates a cake. You don't taste just "flour" anymore; you taste "cake." In Sanskrit drama, a scene might be dominated by Romance, Heroism, Horror, or Comedy.

The team's goal was to see if a computer could learn to taste the "cake" (the scene's mood) by analyzing the "ingredients" (the individual lines of dialogue).

The Experiment: Feeding the Machine

The researchers gathered 18 famous Sanskrit plays, including works by the legendary playwright Kālidāsa. They cleaned up the text (which was surprisingly hard because the old digital versions had missing words and typos) and broke the plays down into 6,947 individual lines of dialogue.

Then, they did the hard work: they manually tagged every single line with the right bhāva (emotion) and every scene with the right sthāyībhāva (the dominant mood). They created a special web tool to help them do this, ensuring that two different people agreed on the tags most of the time. This created a brand-new dataset, a treasure trove of annotated Sanskrit drama that had never existed before.

Once the data was ready, they threw it at the computers. They tried two main approaches:

  1. The Line-by-Line Test: Can the computer look at a single sentence and guess the emotion? (e.g., "Is this line 'Joy' or 'Anxiety'?")
  2. The Scene Test: Can the computer look at a whole scene and guess the overall mood? (e.g., "Is this scene 'Romantic' or 'Heroic'?")

They tested many different types of computer brains, from simple, old-school math models to fancy, modern AI systems that read like humans (called Transformers).

The Results: Old School Beats New School

Here is where the story gets interesting. You might expect the super-smart, modern AI models to win easily. After all, they are trained on massive amounts of data. But in this case, the simple, old-school models actually did a better job.

Why? The researchers suggest it's because the dataset was too small for the giant AI models. The Sanskrit plays only had about 7,000 lines. For a massive AI, that's like trying to learn to play the piano by listening to only three songs. The AI got confused and tried to memorize patterns that didn't work. The simpler models, however, were like a sharp detective who could spot the specific "tells" in the Sanskrit words—certain phrases that always meant "anger" or "joy"—without getting overwhelmed.

The researchers found that the best way to solve the puzzle was to use a hierarchical approach. Instead of asking the computer to guess one of 32 emotions at once (which is like asking a kid to guess a specific card in a deck of 52 without any clues), they asked it to guess the category first (Is it positive, negative, or mixed?) and then the specific emotion. This "two-step" method worked much better, boosting the accuracy significantly.

When it came to guessing the mood of the whole scene, the computer found that looking at the distribution of emotions was the key. If a scene had a lot of "Joy" and "Longing" lines, the computer could correctly guess the scene was "Romantic." Interestingly, trying to guess the mood just by reading the raw text of the scene (without counting the emotions first) was harder and less accurate. It seems that for these ancient plays, the mix of small emotions is a stronger clue than the raw words themselves.

What Didn't Work

The researchers also tried to use the newest, most powerful AI models available (Large Language Models like Llama 3.1). They tried to ask these models to guess the emotions directly. The results were disappointing. The models performed very poorly, often getting it wrong more than right. The researchers suggest that these general-purpose AI models aren't ready for this specific task yet; they need more training on Sanskrit specifically before they can understand the subtle nuances of these ancient plays.

The Takeaway

This paper doesn't claim to have solved the mystery of human emotion. Instead, it lays the foundation. It shows that:

  • We can successfully teach computers to understand ancient Indian emotions using a framework based on 2,000-year-old theory.
  • For low-resource languages like Sanskrit, simpler, smarter models often work better than massive, data-hungry AI.
  • Breaking down a complex problem (guessing 32 emotions) into smaller steps (guessing the category first) makes the computer much more accurate.

The researchers are excited because this is just the beginning. They hope to use this "BhaRaTa" framework to analyze other types of Sanskrit literature, like epics and poetry, and eventually apply these ideas to other Indian languages. They've proven that ancient wisdom and modern technology can mix to create something new, helping us understand the emotional depths of stories that have survived for millennia.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →