โš–๏ธ 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
Safetensors
Model size
67M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train Baps24/lexai-legal-clause-classifier

Evaluation results