⚖️ LexAI — Legal Clause Classifier
Dedicated with love and devotion to
🙏 Lord Jagannath, Lord Lingaraj, and Maa Chara Narayani 🙏
May this work serve justice for every Indian citizen.
Jay Jagannath! Jay Lingaraj! Maa Chara Narayani ki Jai!
🇮🇳 Vision — LexAI India
45 crore Indians have no access to legal help.
A lawyer costs ₹2,000–10,000 per hour.
Most citizens don't know their basic rights.
LexAI is being built to change this.
This model is the first brick of LexAI India —
a free, open-source AI legal assistant for every Indian citizen.
Built for the farmer who doesn't know his land rights.
For the worker whose salary was stolen.
For every citizen who deserves justice.
📋 Model Description
LexAI Legal Clause Classifier is a fine-tuned
DistilBERT model
for classifying legal contract clauses into categories.
Trained on the LEDGAR dataset — 60,000+ real commercial
contract clauses from SEC filings.
Supported Clause Types
| Label | Description |
|---|
CONFIDENTIALITY | NDA and confidentiality obligations |
INDEMNITY | Indemnification and hold harmless clauses |
TERMINATIONS | Contract termination conditions |
🎯 Performance
| Metric | Score |
|---|
| Validation Accuracy | 99.36% |
| Validation Loss | 0.0275 |
| Test Examples | 466 |
🚀 How to Use
1from transformers import pipeline
2
3# Load the classifier
4classifier = pipeline(
5 "text-classification",
6 model="Baps24/lexai-legal-clause-classifier"
7)
8
9# Classify any legal clause
10result = classifier(
11 "The company shall keep all information strictly confidential."
12)
13print(result)
14# [{'label': 'CONFIDENTIALITY', 'score': 0.998}]
📊 Training Details
| Parameter | Value |
|---|
| Base Model | distilbert-base-uncased |
| Dataset | LEDGAR (lex_glue) |
| Training Examples | 3,331 |
| Epochs | 3 |
| Batch Size | 16 |
| Learning Rate | 2e-5 |
| Weight Decay | 0.01 |
| GPU | NVIDIA T4 |
| Training Time | ~10 minutes |
| Framework | HuggingFace Transformers |
🗺️ Roadmap — LexAI India
This model is Project 1 of 13 in the LexAI India platform.
| Project | Description | Status |
|---|
| P1 — Clause Classifier | Classify contract clause types | ✅ Done |
| P2 — Audio Transcriber | Voice input for legal documents | 🔜 Next |
| P3 — Legal NER | Extract parties, dates, penalties | 🔜 Soon |
| P4 — Legal QA | Answer questions from contracts | 🔜 Soon |
| P5 — Indian Law Dataset | IPC, CrPC, Constitution corpus | 🔜 Soon |
| P6 — Legal Assistant LoRA | Fast domain-specific LLM | 🔜 Soon |
| P7 — LexAI India LLM | Full Indian legal AI in Hindi+English | 🎯 Goal |
Final vision: Any Indian citizen can ask any legal question
in Hindi or English and get a clear, accurate, cited answer. Free. Forever.
⚠️ Limitations & Disclaimer
- This model classifies clause types only
- Does not provide legal advice
- Always consult a qualified lawyer for legal decisions
- Currently covers 3 clause types — expanding in future versions
- Trained on US commercial contracts — Indian law support coming in P5-P7
👨💻 Author
Built by
Baps24
Part of the
LexAI India open-source legal AI initiative
Building AI for justice. One model at a time. ⚖️🇮🇳
📜 License
Apache 2.0 — Free to use, modify, and distribute.
If you use this model, please cite and star the repo. 🙏