Inspiration

The Indian legal system is one of the most complex in the world. For a common citizen or even a first-time police officer, distinguishing between the nuances of the Indian Penal Code (IPC)—like the fine line between Section 302 (Murder) and Section 304 (Culpable Homicide)—is a daunting task. We were inspired to build IPC Legal Advisor to democratize legal intelligence, making it easier for victims and professionals to identify applicable charges based on factual narratives rather than complex jargon.

What it does

IPC Legal Advisor is an intelligent decision-support tool. A user describes a crime incident in plain natural language, and the system instantly: Classifies the incident into one of 49 primary IPC sections using semantic similarity.

Maps the old IPC sections to the new Bharatiya Nyaya Sanhita (BNS) equivalents to ensure future-readiness.

Provides Empirical Data on conviction rates, average trial durations, and city-wise crime trends using a database of over 40,000 records.

Generates AI Analysis to explain the specific legal "ingredients" (like mens rea or intent) that justify the classification.

How we built it

We utilized a hybrid AI architecture to ensure both speed and legal accuracy:

Frontend: Built with a clean, professional UI using HTML5, CSS3, and JavaScript, designed to look like a premium legal dashboard.

Classification Engine: We implemented a TF-IDF vectorization algorithm and Cosine Similarity to compare user input against a curated dataset of legal definitions.

Data Layer: We integrated a structured database containing 40,160 crime records and 1,000 real-world court judgments (2020–2024) to provide users with predictive analytics.

Reasoning: We leveraged AI to act as a "Senior Advocate," providing a concise legal rationale for each classification.

Challenges we ran into

The biggest challenge was handling the "semantic overlap" between similar crimes. For example, "Theft," "Robbery," and "Dacoity" share common elements but differ based on the use of force and the number of people involved. We had to refine our vectorization logic to prioritize "intent" and "violence" keywords to ensure the model didn't misclassify a simple theft as a violent robbery.

Accomplishments that we're proud of We are proud of building a tool that doesn't just give a "result," but actually explains the "Why." By integrating conviction rates and trial timelines, we’ve moved beyond a simple classifier to a system that provides a realistic outlook on the journey through the Indian judicial system.

What we learned

We learned a great deal about the intersection of NLP (Natural Language Processing) and the Indian legal framework. Specifically, we gained insights into how legal "ingredients" can be mathematically modeled to assist in objective decision-making without replacing the subjective human judgment of a magistrate.

What's next for IPC Legal Advisor

Multi-language Support: Expanding the NLP engine to process FIRs written in Hindi and other regional languages.

OCR Integration: Allowing users to upload photos of handwritten police reports for automatic analysis.

BNS Transition: Fully migrating the core logic to the Bharatiya Nyaya Sanhita (BNS) to align with current Indian law.

Built With

Share this project:

Updates