Legal Contract Analyzer

Legal Tech & NLP ยท 2025

Legal Contract Analyzer

An end-to-end NLP/ML pipeline that accepts commercial contracts in PDF or TXT format, segments them into clauses, classifies risk levels, retrieves governing statutory sections from the Indian Contract Act 1872 via hybrid search, and outputs structured risk reports.

The Challenge

Manual contract review is expensive and error-prone, particularly when evaluating compliance against Indian statutory mandates. The challenge was building an explainable, hallucination-free legal intelligence pipeline that surfaces exact statutory cross-references for every high-risk clause.

Data Foundation

CUAD Dataset

9,400+ labeled commercial contract clauses used for primary clause-type pattern detection.

Indian Drafting Corpus

151 hand-crafted Indian legal clauses for jurisdiction-specific training (Arbitration, Indemnity).

ICA 1872 Knowledge Base

185 legal sections parsed, indexed, and vectorized for statute mapping.

Clause risk breakdown and statutory citation engine.
Clause risk breakdown and statutory citation engine.
Click to expand

3-Layer Hybrid Retrieval

Risk explanations are powered by a 3-layer hybrid retriever: explicit statute mapping rules, FAISS dense semantic embeddings using InLegalBERT, and BM25 sparse keyword matching, fused through Reciprocal Rank Fusion (RRF). The pipeline generates plain-English risk assessments backed by exact legal citations without relying on ungrounded generative LLMs.

185sections

Indian Contract Act 1872 indexed

42types

Clause classifications supported

3layers

Hybrid retrieval with RRF fusion

Previous Project
Previous
Portfolio
All Work
Next Project
Next