Instructions to use vikas-maurya/justifi-inlegalbert-outcome-predictor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vikas-maurya/justifi-inlegalbert-outcome-predictor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="vikas-maurya/justifi-inlegalbert-outcome-predictor")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("vikas-maurya/justifi-inlegalbert-outcome-predictor") model = AutoModelForSequenceClassification.from_pretrained("vikas-maurya/justifi-inlegalbert-outcome-predictor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- โ๏ธ JustiFi โ InLegalBERT Legal Outcome Predictor
- ๐ Project Overview
- ๐ง Model Information
- ๐ Model Performance
- โ๏ธ Features
- ๐ Labels
- ๐ Usage
- ๐ฌ Training Configuration
- ๐ Evaluation Methods
- ๐ Deployment
- โ Limitations
- ๐ฎ Future Improvements
- ๐จโ๐ป Author
- ๐ Citation
โ๏ธ JustiFi โ InLegalBERT Legal Outcome Predictor
Fine-tuned InLegalBERT model for legal outcome prediction on Indian legal documents.
This model predicts whether a legal case is:
- REJECT (0)
- ACCEPT (1)
The system is designed for long legal documents and uses chunk-based processing to overcome the 512-token limitation of BERT models.
๐ Project Overview
Legal documents are often lengthy and contain complex legal language. Traditional machine learning methods struggle to capture contextual relationships in such texts.
This project fine-tunes InLegalBERT, a legal-domain transformer model, to perform legal outcome prediction using Indian legal datasets.
The workflow includes:
Input Legal Document
โ
PDF/Text Extraction
โ
Tokenization
โ
Chunk Generation (512 tokens)
โ
InLegalBERT Prediction
โ
Chunk Aggregation
โ
Final Outcome
(REJECT / ACCEPT)
๐ง Model Information
| Property | Value |
|---|---|
| Base Model | InLegalBERT |
| Architecture | BertForSequenceClassification |
| Task | Binary Classification |
| Classes | REJECT / ACCEPT |
| Max Tokens | 512 |
| Prediction Method | Chunk Aggregation |
| Domain | Legal NLP |
๐ Model Performance
Evaluation was performed using chunk-based document prediction.
| Metric | Score |
|---|---|
| Accuracy | 0.70 |
| Precision | 0.71 |
| Recall | 0.71 |
| F1 Score | 0.71 |
โ๏ธ Features
โ Legal outcome prediction
โ Fine-tuned InLegalBERT model
โ Long document support
โ Chunk-based inference
โ PDF processing pipeline
โ FastAPI deployment support
โ Confidence scoring
๐ Labels
0 โ REJECT
1 โ ACCEPT
Model mapping:
id2label = {
0: "REJECT",
1: "ACCEPT"
}
๐ Usage
Install dependencies:
pip install transformers torch
Load model:
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="vikas-maurya/justifi-inlegalbert-outcome-predictor"
)
text = """
Legal case description text here
"""
result = classifier(text)
print(result)
Example output:
[
{
'label':'ACCEPT',
'score':0.74
}
]
๐ฌ Training Configuration
| Parameter | Value |
|---|---|
| Learning Rate | 2e-5 |
| Batch Size | 4 |
| Gradient Accumulation | 4 |
| Optimizer | AdamW |
| Loss Function | Cross Entropy |
| Mixed Precision | FP16 |
| Training Steps | ~4500 |
๐ Evaluation Methods
The project includes:
- Accuracy vs Epoch
- PrecisionโRecall Curve
- Confusion Matrix
- Confidence Distribution
- Response Time Analysis
๐ Deployment
The model was integrated into:
- FastAPI backend
- PDF upload pipeline
- Chunk-based prediction system
Output format:
{
"prediction":"ACCEPT",
"confidence":0.64,
"num_chunks":7
}
โ Limitations
- Trained on Indian legal documents only
- Limited generalization to other jurisdictions
- Long documents require chunk aggregation
- Similar case retrieval not included in current version
๐ฎ Future Improvements
- Legal summarization
- Explainability module
- Similar case retrieval
- Legal chatbot
- Multilingual support
- Outcome reasoning
๐จโ๐ป Author
Vikas Maurya
Final Year Computer Engineering Student
Focus Areas:
- NLP
- Legal AI
- Deep Learning
- Transformer Models
- Generative AI
Project:
JustiFi โ AI Powered Legal Intelligence System
๐ Citation
If using this model in academic work:
@misc{justifi_inlegalbert,
title={JustiFi: InLegalBERT Legal Outcome Predictor},
author={Vikas Maurya},
year={2026}
}
- Downloads last month
- 41
Model tree for vikas-maurya/justifi-inlegalbert-outcome-predictor
Base model
law-ai/InLegalBERT