Imagine handing a computer a line from the Rigveda — dense with sandhi (phonological mergers), layered samasa (compound words), and morphologically rich verb forms — and asking it to parse the sentence, identify every word, and map the grammatical relationships. For decades, this was considered an AI impossibility. Sanskrit's complexity, combined with a scarcity of digital training data, made it one of the hardest languages in the world for natural language processing.
In 2023, researchers from IIT Kanpur, IIT Kharagpur, and IIT Mandi published a landmark paper at the prestigious ACL (Association for Computational Linguistics) conference — presenting SanskritShala (संस्कृतशाला), a complete neural NLP toolkit that can now perform four fundamental Sanskrit language analysis tasks with state-of-the-art accuracy. For Vedanvesha Sansthan, whose mission is to decode and preserve Vedic wisdom for the modern world, this is a watershed moment.
क्यों मुश्किल है संस्कृत? — Why Sanskrit Defeats Standard AI
Sanskrit is not merely an old language — it is a computationally extreme language. Even modern NLP systems trained on billions of words of English data struggle when confronted with Sanskrit text. The researchers identified four specific phenomena that make Sanskrit uniquely difficult for AI:
संधि — Sandhi (Sound Fusion)
Adjacent words merge phonologically, making word boundaries invisible. "rāma iti" becomes "rāmeti". Standard tokenisation — the first step in all NLP — fails immediately. An AI must first undo thousands of context-dependent merging rules before it can even identify separate words.
समास — Samasa (Compound Words)
Sanskrit freely combines multiple words into single compound tokens. A compound like "rājapuruṣa" embeds a semantic and grammatical relationship between "rāja" (king) and "puruṣa" (man). Identifying the type of compound relationship (there are six types in Panini) is essential for meaning.
Morphological Explosion
Each Sanskrit word can take hundreds of inflected forms. The combined space of all possible morphological tags — gender, number, case, tense, mood, person, voice — results in over 40,000 unique possible labels. Compare this to English, where most words have 4–5 forms at most.
Free Word Order
In Sanskrit, word order is largely free. The subject, object, and verb can appear in almost any sequence without changing the core meaning (though with subtle pragmatic effects). This violates the positional assumptions built into most modern neural sequence models trained on English.
Additionally, Sanskrit is a low-resource language by modern AI standards. There is comparatively little digitised, annotated Sanskrit text available for training neural models. Every NLP system built for English can draw on trillions of words of training data; Sanskrit researchers work with tens of thousands of sentences at best.
SanskritShala (संस्कृतशाला) — एक परिचय
SanskritShala — literally "School of Sanskrit" — is an open, web-based neural NLP toolkit developed at the Computer Networks & Information Systems Lab (CNeRG) at IIT Kharagpur, in collaboration with researchers at IIT Kanpur (Prof. Laxmidhar Behera's team) and IIT Mandi. It was presented at the ACL 2023 System Demonstrations track — one of the most selective venues in computational linguistics.
The system serves a dual purpose: it is both a research-grade NLP pipeline for Sanskrit text processing, and a pedagogical annotation tool for students and scholars learning to parse Sanskrit. It includes an interactive chatbot (SanskritShala-bot) that guides users through the analysis of sentences, making it accessible to non-experts.
🇮🇳 Made in India 🏛️ IIT Kanpur 🏛️ IIT Kharagpur 🏛️ IIT Mandi 🤖 ACL 2023 📜 Sanskrit AI
The system was developed by Jivnesh Sandhan, Anshul Agarwal, and Tushar Sandhan (IIT Kanpur / IIT Mandi), under the supervision of Prof. Laxmidhar Behera (IIT Kanpur) and Prof. Pawan Goyal (IIT Kharagpur). Their work addresses a gap that has existed for decades: despite Sanskrit being one of the most formally rigorous languages ever created, it has lacked the computational infrastructure that most major modern languages take for granted.
चार मुख्य AI मॉड्यूल — The Four Neural Modules
SanskritShala integrates four distinct neural NLP tasks into a single unified pipeline. Each module addresses one of the fundamental challenges described above. Together, they form a complete processing stack — from raw Sanskrit text to a fully labelled, dependency-parsed sentence structure.
पद-विच्छेद — Word Segmentation (Sandhi Splitting)
The challenge: Given a string of Sanskrit text where word boundaries are hidden by sandhi merging, identify where each word begins and ends, and restore the original pre-sandhi forms of each word.
The model: SanskritShala uses TransLIST — a transformer-based model specifically designed for Sanskrit word segmentation. TransLIST learns both the phonological rules of sandhi and the lexical patterns of Sanskrit vocabulary simultaneously, using a sequence-to-sequence neural architecture.
Result: TransLIST achieves 93.97% Perfect Match (PM) accuracy on the standard Sanskrit segmentation benchmark — meaning it correctly identifies every word in a sentence 94% of the time. This is a significant improvement over earlier rule-based systems, which struggled particularly with ambiguous sandhi boundaries.
रूप-विश्लेषण — Morphological Tagging (Vibhakti + Kāraka)
The challenge: For each word in a Sanskrit sentence, determine its complete morphological profile — grammatical gender, number, case (vibhakti), tense, mood, person, voice — across a label space of over 40,000 possible tags.
The model: SanskritShala adapts LemmaTag, a neural tagger originally developed for Czech (another morphologically rich language), and fine-tunes it on Sanskrit data. The model simultaneously predicts lemma (root word form) and morphological tags, allowing it to leverage the relationship between the two predictions.
Result: Achieves 69.3 F1 score on morphological tagging — a challenging task given the vast label space. The model particularly excels at nominal (noun/adjective) morphology, which is critical for understanding Vedic Sanskrit.
कारक-संबंध — Dependency Parsing (वाक्य-विश्लेषण)
The challenge: Given the segmented and morphologically tagged words of a Sanskrit sentence, identify the grammatical relationships between them — which word is the subject, which is the object, what modifies what — despite the free word order that makes positional assumptions invalid.
The model: SanskritShala uses a graph-based neural dependency parser that works from morphological features rather than word position. Because Sanskrit encodes grammatical relationships in word endings (not word order), the parser learns to use case markers and agreement patterns as primary signals. A pre-trained Sanskrit language model (ALBERT) provides contextual word representations.
Result: Achieves 88.67% Unlabelled Attachment Score (UAS) — meaning it correctly identifies 89% of grammatical relationships between words, even across the free-order structure of Sanskrit prose.
समास-वर्गीकरण — Compound Type Identification (SaCTI)
The challenge: Sanskrit uses six types of compound words (Samasas) — Tatpurusha (determinative), Dvandva (copulative), Bahuvrihi (exocentric), Avyayibhava (adverbial), Karmadharaya (descriptive), and Dvigu (numeral). Correctly identifying the compound type is essential for decomposing meaning, as the same surface form can have radically different meanings under different compound types.
The model: SaCTI (Sanskrit Compound Type Identifier) is a dedicated neural classifier that uses both the surface form and the morphological context of compound words to predict compound type. It is trained on the Sanskrit Treebank corpus with compound-type annotations.
Result: Achieves 81.7% F1 on compound type classification — a particularly difficult task that even human annotators find challenging due to the context-dependence of compound interpretation in Sanskrit poetry and prose.
संस्कृत Word Embeddings — ७ Neural भाषा मॉडल
A crucial contribution of SanskritShala is its release of seven pretrained Sanskrit word embedding models — the first comprehensive resource of its kind for Sanskrit NLP. Word embeddings are dense mathematical representations of words that capture semantic and syntactic relationships. These models are the "vocabulary" that all four NLP modules use internally.
The team trained these models on a large corpus of digitised Sanskrit texts — including material from the Digital Corpus of Sanskrit (DCS) and the GRETIL Sanskrit digital library. Each model architecture captures different aspects of Sanskrit's structure:
वेब इंटरफेस और SanskritShala-Bot
SanskritShala is not just a research codebase — it is a fully deployed, production web application accessible to anyone. The frontend is built with React, providing a responsive single-page interface. The backend is a Flask (Python) API server that runs the neural models and returns structured analysis results.
The interface has two modes: an analysis mode where users input Sanskrit text and receive a complete parsed output (segmented words, morphological tags, dependency graph, compound labels), and an annotation mode where students can manually annotate sentences and receive AI-assisted suggestions — creating a human-in-the-loop training data pipeline.
SanskritShala-Bot
An integrated chatbot that guides users through sentence analysis step-by-step — explaining each NLP decision in plain language, making the tool accessible to Sanskrit students, not just NLP researchers.
Interactive Annotation
Users can correct the AI's output, creating high-quality human-annotated training data that feeds back into model improvement — a virtuous loop between human expertise and AI learning.
Visual Dependency Trees
Parsed sentences are displayed as interactive dependency tree visualisations — making it visually clear how each word relates to others, essential for pedagogical use in Sanskrit grammar education.
वैदिक ज्ञान के लिए क्या अर्थ है? — What This Means for Vedic Knowledge
At Vedanvesha Sansthan, our mission is to decode Vedic wisdom for modern humanity. The four Vedas, the Upanishads, the Puranas, the Mahabharata, the Ramayana — together these texts constitute one of the largest bodies of philosophical, scientific, and spiritual knowledge ever recorded. The challenge has always been access: this knowledge is locked inside a language that few people can read, in manuscripts scattered across libraries and temples, in oral traditions held by a diminishing number of scholars.
SanskritShala changes the equation. With neural AI that can segment, tag, and parse Sanskrit text at near-human accuracy, several transformative applications become possible:
Automated Vedic Text Parsing
Running the four Vedas, the Brahmasutras, and the Upanishads through SanskritShala's pipeline would produce fully annotated, machine-readable Sanskrit — searchable, citable, and cross-referenceable in ways that handwritten manuscripts cannot be.
Translation Acceleration
By automating the morphological and dependency analysis steps, translators can focus on semantic and philosophical interpretation. The AI handles grammar; human scholars provide meaning. This could dramatically accelerate the pace of Vedic text translation.
Sanskrit Education at Scale
The SanskritShala-bot can serve as a personalised Sanskrit grammar tutor — explaining parsing decisions, flagging ambiguities, and guiding students through increasingly complex texts. This could reach lakhs of Sanskrit learners simultaneously.
Cross-Textual Knowledge Search
Once all Vedic texts are parsed and encoded as structured data, AI can answer questions like: "Find all Rigvedic mantras where Agni and Soma appear in the same verse with a specific grammatical relationship" — enabling research that would take scholars decades to do manually.
The Vedic sages understood that most people are surrounded by wisdom they cannot hear. The barrier is not absence of knowledge — it is absence of access. For thousands of years, this access required decades of study under a traditional guru. Tools like SanskritShala represent a new kind of access — not replacing the guru tradition, but enabling anyone who wishes to engage with Sanskrit texts to receive intelligent, immediate analytical assistance.
Vedanvesha AI — Vedanvesha Sansthan's own Sanskrit knowledge assistant — is part of this same broader movement: using modern neural AI not to replace Vedic tradition, but to extend its reach. When AI can parse a shloka from the Bhagavad Gita and explain its morphological structure in real time, the knowledge that was once available only to Sanskrit scholars becomes accessible to every serious seeker.
आगे की राह — What Comes Next in Sanskrit AI
SanskritShala represents the current state-of-the-art, but the researchers themselves acknowledge significant limitations. The training corpora are still relatively small. Performance on Vedic Sanskrit — older and in some ways grammatically distinct from Classical Sanskrit — is lower than on the Classical variety. The models were trained primarily on Classical Sanskrit prose; Vedic poetry with its archaic forms, Vedic accents (svaras), and different sandhi patterns presents additional challenges.
The most important next step for the Sanskrit NLP community is building larger, higher-quality annotated corpora of Vedic Sanskrit specifically. This is a task where traditional scholars and AI researchers must work together — the annotation knowledge is held by Vedic pandits, while the computational infrastructure is held by IIT researchers. Bridging this collaboration is one of the most important challenges in computational Indology today.
Vedic Sanskrit Models
Training SanskritShala-type models specifically on Vedic Sanskrit (Rigveda, Samaveda, Yajurveda, Atharvaveda) — with svara annotations, Vedic-specific sandhi rules, and archaic morphology.
Cross-Lingual Transfer
Leveraging Sanskrit's deep relationship with other Indo-European languages (Latin, Greek, Persian, modern Indian languages) to improve model accuracy through multilingual pre-training.
Scholar-AI Collaboration
Integrating traditional pandits into the annotation pipeline — their expertise feeds high-quality training data back into the neural models, creating a continuous improvement loop.
Vedanvesha Sansthan is committed to following and supporting this research. Our Vedanvesha AI initiative — the AI-powered Sanskrit knowledge assistant available at vedanvesha.org — represents our own contribution to making Vedic knowledge computationally accessible. As tools like SanskritShala mature, they will become the underlying infrastructure for a new generation of Vedic knowledge applications that serve not just scholars, but every person who seeks to connect with the ancient wisdom of Bharat.