Skip to content

reddychaithu26/LegalAI

Repository files navigation

⚖️ LegalAI – Intelligent Legal Assistance Platform

📌 Overview

LegalAI is a machine learning-powered web application that helps users understand legal issues by automatically classifying legal complaints into different case categories and recommending the appropriate court. The application uses Natural Language Processing (NLP) with TF-IDF vectorization and a Naive Bayes classifier to analyze user-entered legal complaints and provide relevant legal guidance.

The system is designed to simplify access to legal information by assisting users in identifying the nature of their legal issues and providing appropriate recommendations.


✨ Features

  • User Registration and Login
  • Legal Complaint Classification using Machine Learning
  • TF-IDF Text Vectorization
  • Naive Bayes Classification Model
  • Court Recommendation
  • Display of Applicable Legal Sections
  • Required Documents for Case Filing
  • Lawyer Recommendation
  • SQLite Database Integration
  • Responsive Web Interface using Flask

🛠️ Technologies Used

Frontend

  • HTML5
  • CSS3
  • JavaScript
  • Bootstrap

Backend

  • Python
  • Flask

Machine Learning

  • Scikit-learn
  • TF-IDF Vectorization
  • Multinomial Naive Bayes

Database

  • SQLite

Libraries

  • Pandas
  • NumPy
  • Pickle

📂 Project Structure

LegalAI/
│
├── app.py
├── requirements.txt
├── database.db
├── model.pkl
├── train_model.py
├── generate_dataset.py
├── cases.csv
├── README.md
│
├── data/
│
├── static/
│   ├── css/
│   ├── js/
│   └── images/
│
└── templates/
    ├── index.html
    ├── login.html
    ├── register.html
    ├── dashboard.html
    ├── prediction.html
    └── base.html

🧠 Machine Learning Workflow

  1. User enters a legal complaint.

  2. The input text is preprocessed.

  3. TF-IDF converts the text into numerical feature vectors.

  4. The trained Naive Bayes model predicts the legal case category.

  5. The application displays:

    • Predicted Case Category
    • Recommended Court
    • Applicable Legal Sections
    • Required Documents
    • Lawyer Recommendations

📊 Supported Case Categories

  • Civil Cases
  • Criminal Cases
  • Family Cases
  • Consumer Cases
  • Labour Cases
  • Cyber Crime Cases

⚙️ Installation

Clone the repository

git clone https://github.com/reddychaithu26/LegalAI.git

Navigate to the project folder

cd LegalAI

Create a virtual environment

python -m venv .venv

Activate the virtual environment

Windows

.venv\Scripts\activate

Linux / macOS

source .venv/bin/activate

Install dependencies

pip install -r requirements.txt

Run the application

python app.py

Open your browser and visit:

http://127.0.0.1:5000

👨‍💻 Author

Chaithu Reddy

GitHub: https://github.com/reddychaithu26

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors