This repository contains two key AI tools for legal assistance:
- Legal Chatbot – An intelligent assistant for answering legal queries based on Indian law.
- Legal Summarizer – A summarization tool for compressing lengthy legal judgments using a fine-tuned BART model.
📁 legal_chatbot.ipynb # Chatbot using Retrieval-Augmented Generation (RAG)
📁 bartseq2seq.ipynb # Seq2Seq fine-tuning of BART for summarization
📁 Legal_summarizer_final.ipynb # Final pipeline for summarizing legal documents
- 🔍 Retrieval-Augmented Generation using FAISS
- 📚 Trained on Indian Constitution, IPC, CrPC, etc.
- 🤖 Answers questions across major legal domains
- 📄 Supports document-based Q&A
- 🔄 Fine-tuned BART model on Indian Legal Case Law
- 🧾 Extractive + Abstractive summary support
- 🧠 Trained on
d0r1h/ILC
dataset from HuggingFace
- Clone the repo:
git clone https://github.com/Anshul-ydv/Legal-ai.git
cd legal-ai-assistant
- Install required packages:
pip install -r requirements.txt
# Open the notebook
legal_chatbot.ipynb
# Follow the cells to ingest legal docs and start querying
# Open the notebook
Legal_summarizer_final.ipynb
# Run cells to load model and summarize documents
- 📦 Summarizer Dataset: d0r1h/ILC
- 📚 Chatbot Corpus: Structured QA pairs from Indian law
- Python · HuggingFace Transformers · FAISS · PyTorch · Google Colab · NLTK · Sklearn · Streamlit (optional UI)
- Add support for multilingual legal queries
- Deploy chatbot as a web app (FastAPI + Streamlit)
- Extend summarization to multi-modal court documents
- Indian Legal Corpus by ILC on HuggingFace
- HuggingFace Transformers and Datasets
- OpenAI & FAISS for vector retrieval
This project is open-source under the MIT License.
“This AI has read more Indian laws than most lawyers.” ⚖️🤖