IHLawRecommender: Deep Semantic Modelling for IPC Case
Recommendation with Legal Domain Constraints
Gautham Praveen Ramalingam1,* Dharini Devi Ramalingam2 A. Afrin Farhan3
1 Research Scholar, Syed Ammal Engineering College, Ramanathapuram – 623502, Tamilnadu, India
2 Graduate, Government Law College, Madurai – 625020, Tamilnadu, India
3 Student, Syed Ammal Engineering College, Ramanathapuram – 623502, Tamilnadu, India
Emails: gauthams_ralli@hotmail.com · dharinideviramalingam@gmail.com · afrinfarhan1111@gmail.com
Received: January 17, 2026 Revised: February 25, 2026 Accepted: March 20, 2026 ⋆ Corresponding author
ABSTRACT
Efficient retrieval of relevant legal cases is critical for judicial decision-making, particularly for high-severity
crimes where timely reference to precedents can influence outcomes. Our work presents IHLawRecommender,
i.e., Intelligent Hybrid Law Recommender, a hybrid framework for recommending Indian Penal Code (IPC) cases
based on textual descriptions provided by users. The system operates through a multi-stage workflow: first, case
descriptions are normalized to remove inconsistencies and embedded into semantic vectors using a Bi-directional
Long Short-Term Memory (BiLSTM) network. These embeddings are compared with the user query to measure
semantic similarity. In parallel, an IPC-specific keyword map evaluates the relevance of each case, while legal-aware
filters distinguish between sexual and non-sexual violent crimes to ensure contextually appropriate recommendations.
The outputs from these stages are integrated using a weighted payoff function that considers semantic similarity,
keyword relevance, and crime severity to produce a ranked list of top-k cases. The system also provides interpretable
visualizations, including heatmaps that illustrate correlations between similarity, keyword score, severity, and payoff.
Evaluation on a curated IPC dataset demonstrates that IHLawRecommender consistently prioritizes legally critical
cases, reduces irrelevant matches, and offers a practical, workflow-driven tool for legal professionals to efficiently
navigate case law while maintaining adherence to judicial priorities.
Keywords: Legal Case Recommendation Bi-directional Long Short-Term Memory (BiLSTM) Semantic Embedding
Keyword-Based Scoring Hybrid Recommendation System
1. INTRODUCTION
In contemporary judicial systems, managing the growing
volume and complexity of legal case records has become a
significant challenge. Accurate and timely legal decisions
require systems that can reason under uncertainty, understand
contextual nuances, and prioritize cases based on offense
severity. Traditional rule-based or deterministic legal support
tools, while effective in static scenarios, often lack the flexibility
to accommodate real-world legal ambiguity and variability
across cases. Rule-based methods provide a mechanism to
assess relevance by mapping query terms to offense-specific
keywords. They have been employed in numerous applications
such as legal information retrieval, precedent analysis,
and case ranking, where domain-specific terminology can
replace simplistic exact-match searches [1, 2]. However, rulebased
approaches alone are limited in capturing semantic similarity,
contextual relationships, and long-term dependencies
across multiple case descriptions. In contrast, semantic similarity
measures, derived from statistical and embedding-based