Text Classification
Transformers
Safetensors
English
Hindi
Marathi
legal
ipc
classification
bert
indian-law
multilingual
Instructions to use ri2000/IPC_matcher with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ri2000/IPC_matcher with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ri2000/IPC_matcher")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ri2000/IPC_matcher", device_map="auto") - Notebooks
- Google Colab
- Kaggle
๐ง LawSight โ IPC Section Matcher (BERT-based)
This model is part of LawSight โ an AI-powered legal assistance tool designed to suggest applicable Indian Penal Code (IPC) sections based on user complaints.
It uses BERT embeddings and a fine-tuned classification head to intelligently match free-form complaint descriptions with relevant IPC sections.
๐ Use Cases
- ๐ฎ Law enforcement automation
- โ๏ธ Legal aid applications
- ๐ Legal NLP research
- ๐งพ FIR assistance & section classification
๐ Model Details
- Architecture: BERT (base model) with a custom classification head
- Input: Complaint text in English
- Output: One or more IPC section numbers with confidence scores
- Fine-Tuned On: Custom dataset of IPC-tagged complaints
- Multilingual Support: Input preprocessed using translation for multilingual capabilities
๐ง How to Use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model
model_name = "ri2000/IPC_matcher"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Sample input
complaint = "A man forcefully entered my house and tried to harm me."
# Tokenize
inputs = tokenizer(complaint, return_tensors="pt", truncation=True, padding=True)
# Predict
outputs = model(**inputs)
logits = outputs.logits
predicted = torch.argmax(logits, dim=1)
# Show result
print(f"Predicted IPC Section ID: {predicted.item()}")
๐ฆ Access to Dataset & Model Weights
Access to the full dataset and model training pipeline is available upon request:
๐ Request Access via Google Form
๐ฉโ๐ป Developed By
Riya,Sachi & Tanmay
With support from the LawSight Team
Built with โค๏ธ for societal impact.