โ๏ธ 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
from transformers import pipeline
# Load the classifier
classifier = pipeline(
"text-classification",
model="Baps24/lexai-legal-clause-classifier"
)
# Classify any legal clause
result = classifier(
"The company shall keep all information strictly confidential."
)
print(result)
# [{'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. ๐
- Downloads last month
- 1
Dataset used to train Baps24/lexai-legal-clause-classifier
Evaluation results
- accuracy on LEDGAR (lex_glue)validation set self-reported0.994