An AI-powered web application that analyzes Terms & Conditions or legal documents (PDF/TXT) and detects misleading clauses. The system uses SentenceTransformer embeddings, FAISS similarity search, and an optional fine-tuned BERT classifier to identify risky or biased clauses.
š Upload PDF or TXT contracts.
š Detects misleading or biased clauses automatically.
⨠Highlights detected clauses directly inside the document.
š Provides a summary list of misleading clauses.
ā” Uses FAISS + SentenceTransformer for fast similarity search.
š¤ Supports fine-tuned BERT classifier for better accuracy.
š Web app built with Flask + HTML/CSS frontend.
Backend: Python, Flask
NLP Models: Hugging Face Transformers, Sentence-Transformers
Vector Search: FAISS
Frontend: HTML5, CSS3 (custom UI with gradient + animations)
Libraries: PyPDF2, NLTK, NumPy, Pandas
git clone https://github.com/swalhasakeer/AI-Legal-Assistant-for-Detecting-Misleading-Clauses-in-Contracts.git cd AI-Legal-Assistant-for-Detecting-Misleading-Clauses-in-Contracts
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py
http://127.0.0.1:5000/
Upload a .pdf or .txt file.
View results:
š Document text with highlighted misleading clauses.
š Summary list of all detected clauses.
ā Mobile/Cloud deployment.
ā Advanced explanation.
ā Multi-language support.
ā Enterprise integration.
ā Clause recommentation engine