LegalSeg: Unlocking the Structure of Indian Legal Judgments Through Rhetorical Role Classification

Shubham Kumar Nigam, Tanmay Dubey, Govind Sharma, Noel Shallum, Kripabandhu Ghosh, Arnab Bhattacharya

Introduction

Legal judgments are notoriously dense, unstructured, and complex documents. For artificial intelligence to effectively assist in legal research, automated summarization, or case analysis, it must first decipher the functional "rhetorical role" of each sentence. Whether a sentence states a foundational fact, identifies a core legal issue, or delivers the final judicial decision, understanding these roles—a task known as Rhetorical Role Classification (RRC)—is essential for downstream legal NLP applications.

Historically, the primary bottleneck in RRC for the Indian judiciary has been the lack of large-scale annotated data. Previous datasets were often limited to fewer than 400 cases, hindering the ability of modern machine learning models to generalize across the diverse landscape of Indian law.

The LegalSeg Dataset

To address this data scarcity, researchers have introduced LegalSeg, the largest annotated corpus to date for Indian legal judgments. LegalSeg comprises 7,120 documents and over 1.4 million sentences, representing an order-of-magnitude increase in scale compared to previous benchmarks.

Comparison of LegalSeg with existing legal corpora across different jurisdictions and sizes.

The dataset covers judgments from the Supreme Court and various High Courts in India. Each sentence is manually labeled with one of seven rhetorical roles: Facts, Issue, Arguments of Petitioner (AoP), Arguments of Respondent (AoR), Reasoning, Decision, or None.

Distribution of rhetorical roles within the LegalSeg dataset, highlighting the prevalence of 'None', 'Reasoning', and 'Facts'.

As shown in the distribution, the dataset exhibits significant class imbalance. The "None" category (often containing procedural text or citations) and "Reasoning" dominate the corpus, while critical labels like "Issue" and "Decision" are relatively sparse.

Benchmarking Methodology

The authors evaluated several architectural paradigms to establish a robust benchmark for LegalSeg:

  • Hierarchical BiLSTM-CRF: This classic architecture utilizes a Bi-directional Long Short-Term Memory network to capture sentence-level semantics, coupled with a Conditional Random Field (CRF) layer to explicitly model the sequential dependencies between roles (e.g., an "Issue" is frequently followed by "Arguments").
  • ToInLegalBERT: A hierarchical transformer model that leverages InLegalBERT—a BERT variant pre-trained specifically on Indian legal corpora—as a base encoder.
  • Graph Neural Networks (GNNs): These models represent sentences as nodes in a graph, using edges to encode semantic similarity and document-order proximity.
  • RhetoricLLaMA: An exploratory model based on LLaMA-2-7B, instruction-tuned to follow specific prompts for legal role classification.

Key Results and Insights

The experimental results highlight several critical findings for the legal NLP domain:

  1. The Superiority of Sequence Modeling: The Hierarchical BiLSTM-CRF emerged as the top performer, achieving an F1-score of 0.77. This significantly outperformed more modern transformer-based models (F1: 0.62) and GNNs (F1: 0.54). The success of the CRF layer underscores that in legal writing, the structural "flow" and transitions between roles are as informative as the textual content itself.
  2. Contextual Awareness: Models that incorporated neighboring sentence context performed substantially better than those looking at sentences in isolation. Legal arguments follow a predictable, albeit complex, structural logic that requires a global view of the document.
  3. LLM Limitations in Specialized Domains: Despite the general-purpose capabilities of large language models, RhetoricLLaMA struggled significantly, yielding an F1-score of only 0.09. This suggests that massive scale alone cannot replace domain-specific architecture and pre-training in highly technical fields like law.
  4. Robustness via Noise: Interestingly, models trained using predicted labels of previous sentences (rather than "gold" ground-truth labels) proved more robust. This "noise injection" helped models learn to recover from their own errors during real-world inference.

Conclusion and Future Work

While LegalSeg provides a transformative resource for legal AI, challenges remain. The linguistic overlap between "Facts" and "Reasoning" often leads to model confusion, and the inherent class imbalance makes high-precision classification of "Issues" and "Decisions" difficult.

Future research will focus on developing sophisticated sampling strategies to mitigate imbalance, refining LLMs through intensive domain-specific pre-training, and exploring cross-jurisdictional transfer learning to determine if models trained on Indian law can be adapted to other legal systems worldwide.

Summary updated

BibTeX
@inproceedings{nigam2025legalseg,
  author = {Shubham Kumar Nigam and Tanmay Dubey and Govind Sharma and Noel Shallum and Kripabandhu Ghosh and Arnab Bhattacharya},
  title = {{LegalSeg: Unlocking the Structure of Indian Legal Judgments Through Rhetorical Role Classification}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.63},
}
Figure