Skip to content

Visshu78/IPC_predictor

Repository files navigation

⚖️ IPC Predictor – Multilingual Legal AI Assistant

📌 Overview

This project is an AI-powered legal assistant that predicts the most relevant Indian Penal Code (IPC) sections from a user-provided crime description.
It supports 10+ Indian languages, automatically translates queries to English, and provides detailed legal information including offense, punishment, cognizability, and bailability.


✨ Key Features

  • 🔍 Hybrid IPC Prediction → Combines Sentence-BERT embeddings + TF-IDF keyword matching
  • 📊 Severity Calibration → Aligns crime severity vs punishment severity for more realistic predictions
  • 🌍 Multilingual Support → Handles queries in English, Hindi, Telugu, Tamil, Malayalam, Kannada, Marathi, Bengali, Gujarati, Punjabi, Odia, Urdu using fastText + Meta NLLB-200
  • Real-Time Predictions → Precomputed embeddings and vector caching for fast results
  • 🖥️ Command-line Interface → Simple CLI to test and explore predictions

🛠️ Tech Stack

  • Programming: Python
  • Libraries: Sentence-BERT, scikit-learn, spaCy, TensorFlow, Hugging Face Transformers, fastText
  • Models:
    • SentenceTransformer: all-mpnet-base-v2
    • Translation: facebook/nllb-200-distilled-600M
    • Language Detection: fastText lid.176.bin

🚀 Usage

1️⃣ Clone the repository

git clone https://github.com/Visshu78/IPC_predictor.git
cd IPC_predictor

pip install -r requirements.txt
python -m spacy download en_core_web_sm

python new.py

python translator.py

📈 Future Enhancements

✅ Web/Streamlit interface for user-friendly demo ✅ Evaluation on labeled dataset for accuracy benchmarks ✅ Expand IPC dataset with more detailed case descriptions

Myself

Vishal Dhawal

  • 🎓 B.Tech CSE @ IIIT Kottayam | Minor @ IIT Mandi
  • 🔬 Interests: Machine Learning, Computer Vision, NLP, Human-Computer Interaction
  • 🌐 GitHub: @Visshu78

My Partner

Soumallya Sarkar

  • 🎓 B.Tech CSE @ IIIT Kottayam
  • 🔬 Interests: Machine Learning, Computer Vision, NLP, Computer Networking, Encryption
  • 🌐 GitHub: @soumallyasarkar

About

This repository gives IPC's imposed based on the crime description

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages