Views
No views yet
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).⚠️ Not legal advice. A research/educational tool. It can be wrong or incomplete. Consult a qualified advocate before acting on anything it produces.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tok = AutoTokenizer.from_pretrained("<HF_NAMESPACE>/legally-ai-predex-classifier", revision="v1")
5model = AutoModelForSequenceClassification.from_pretrained(
6 "<HF_NAMESPACE>/legally-ai-predex-classifier", revision="v1"
7).eval()
8
9enc = tok(situation_text, truncation=True, max_length=512, return_tensors="pt")
10with torch.no_grad():
11 prob_win = torch.softmax(model(**enc).logits, dim=-1)[0, 1].item() # class 1 == applicant wins1 = applicant prevailed, index 0 = did not.law-ai/InLegalBERT (12-layer BERT encoder, 768-dim, 512-token max).BertForSequenceClassification, 2 classes).| Metric | Value |
|---|---|
| Macro F1 | 0.605 |
| Accuracy | 0.610 |
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).