Downloads · 30 days
8
6% of all-time downloads
ManasDubey/legally-ai-predex-classifier
legally-ai-predex-classifier is a text classification model from ManasDubey. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned law-ai/InLegalBERT that predicts, for an Indian appeal-shaped legal situation, a single binary outcome for the applicant (appellant / petitioner): 1 = applicant prevails, 0 = does not. It outputs a calibr…
Downloads · 30 days
8
6% of all-time downloads
All-time downloads
135
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
A fine-tuned law-ai/InLegalBERT that predicts,
for an Indian appeal-shaped legal situation, a single binary outcome for the applicant
(appellant / petitioner): 1 = applicant prevails, 0 = does not. It outputs a calibrated
probability P(applicant wins).
This is one of three signals in the Legally AI win/lose ensemble — it is deliberately the weakest, most conservative signal, and the application only trusts it when it agrees with the other two (a precedent vote over real retrieved outcomes, and a reasoning-LLM forecast).
⚠️ Not legal advice. A research/educational tool. It can be wrong or incomplete. Consult a qualified advocate before acting on anything it produces.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tok = AutoTokenizer.from_pretrained("<HF_NAMESPACE>/legally-ai-predex-classifier", revision="v1")
model = AutoModelForSequenceClassification.from_pretrained(
"<HF_NAMESPACE>/legally-ai-predex-classifier", revision="v1"
).eval()
enc = tok(situation_text, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
prob_win = torch.softmax(model(**enc).logits, dim=-1)[0, 1].item() # class 1 == applicant wins
Label convention: index 1 = applicant prevailed, index 0 = did not.
law-ai/InLegalBERT (12-layer BERT encoder, 768-dim, 512-token max).BertForSequenceClassification, 2 classes).On the held-out PredEx test split:
| Metric | Value |
|---|---|
| Macro F1 | 0.605 |
| Accuracy | 0.610 |
Retraining on NyayaAnumana (20k balanced) did not beat this on the PredEx benchmark (0.525 cross-domain; 0.636 in-domain), so the PredEx-trained checkpoint was kept.
Released under the Apache-2.0 license. This is compatible with both upstream sources — the base model is MIT and the training dataset is Apache-2.0, both permissive and with no non-commercial restriction. Apache-2.0 is chosen because it honors both (it satisfies MIT's notice requirement and matches the dataset's license). Credit to both:
law-ai/InLegalBERT — Law-AI
(IIT Kharagpur), MIT license.L-NLProc/PredEx —
Apache-2.0 license. Cite: Nigam et al., "Legal Judgment Reimagined: PredEx and the Rise
of Intelligent AI Interpretation in Indian Courts", Findings of ACL 2024 (arXiv:2406.04136).