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.
- 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
- HTML5
- CSS3
- JavaScript
- Bootstrap
- Python
- Flask
- Scikit-learn
- TF-IDF Vectorization
- Multinomial Naive Bayes
- SQLite
- Pandas
- NumPy
- Pickle
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
-
User enters a legal complaint.
-
The input text is preprocessed.
-
TF-IDF converts the text into numerical feature vectors.
-
The trained Naive Bayes model predicts the legal case category.
-
The application displays:
- Predicted Case Category
- Recommended Court
- Applicable Legal Sections
- Required Documents
- Lawyer Recommendations
- Civil Cases
- Criminal Cases
- Family Cases
- Consumer Cases
- Labour Cases
- Cyber Crime Cases
git clone https://github.com/reddychaithu26/LegalAI.gitcd LegalAIpython -m venv .venvWindows
.venv\Scripts\activateLinux / macOS
source .venv/bin/activatepip install -r requirements.txtpython app.pyOpen your browser and visit:
http://127.0.0.1:5000
Chaithu Reddy