Downloads · 30 days
16
4% of all-time downloads
Anurag33Gaikwad/legal-led-judgment-summarizer-16384
legal-led-judgment-summarizer-16384 is a summarization model from Anurag33Gaikwad. Use it when you need a shorter version of a longer text. The card lists the license as apache-2.0.
Fine-tuned version of NSI’s Legal LED for abstractive summarization of long judicial decisions, case law, and court judgments.
Downloads · 30 days
16
4% of all-time downloads
All-time downloads
399
Public
Parameters
162M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors648 MB · 99%
From the Hugging Face model README
Fine-tuned version of NSI’s Legal LED for abstractive summarization of long judicial decisions, case law, and court judgments.
This model fine-tunes nsi319/legal-led-base-16384, a legally adapted LED with a 16k token context window, using a mix of Indian court judgment data and custom curated summaries.
It is optimized to handle factual background, issues, arguments, legal reasoning, and final orders — producing structured and accurate case summaries.
This model extends:
The original base model is pretrained on large-scale legal corpora including:
Contains Indian Supreme Court & High Court judgments with human-written headnotes.
Includes sections like:
Additional curated summaries cleaned manually.
Judgments ranged from 8,000 to 40,000 tokens, making LED’s long-context attention crucial.
| Setting | Value |
|---|---|
| Base model | nsi319/legal-led-base-16384 |
| Epochs | 4 |
| Batch size | 1 |
| Gradient accumulation | 8 |
| Learning rate | 1e-5 |
| Optimizer | AdamW |
| Weight decay | 0.01 |
| FP16 | Yes |
| Warmup steps | 500 |
| Max input length | 14,000 tokens |
| Max output length | 512 tokens |
| Attention | Global attention on first token |
| Scheduler | Linear |
Training was performed on NVIDIA TESLA P100 GPU (16GB).
| Epoch | Training Loss | Validation Loss |
|---|---|---|
| 1 | 2.25 | 2.32 |
| 2 | 2.03 | 2.11 |
| 3 | 1.85 | 2.03 |
| 4 | 1.79 | 2.01 |
| Metric | F1 |
|---|---|
| ROUGE-1 | 0.4610 |
| ROUGE-2 | 0.2353 |
| ROUGE-L | 0.2584 |
| Metric | Score |
|---|---|
| Precision | ~0.86 |
| Recall | ~0.85 |
| F1 | ~0.86 |
BERTScore shows strong semantic preservation — crucial for legal tasks.
Since judgments exceed 20k–30k tokens, this model uses:
This produces coherent, concise, and semantically accurate summaries.
Designed for:
from transformers import AutoTokenizer, LEDForConditionalGeneration
import torch
model_name = "Anurag33Gaikwad/legal-led-judgment-summarizer-16384"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = LEDForConditionalGeneration.from_pretrained(model_name)
text = """Your long court judgment here..."""
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
max_length=4096
)
global_attention_mask = torch.zeros_like(inputs["input_ids"])
global_attention_mask[:, 0] = 1
summary_ids = model.generate(
inputs["input_ids"],
global_attention_mask=global_attention_mask,
num_beams=5,
max_length=512,
early_stopping=True
)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))