Downloads · 30 days
22
8% of all-time downloads
Anurag33Gaikwad/legal-pegasus-billsum-summarization
legal-pegasus-billsum-summarization 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 Pegasus for abstractive summarization of legal and legislative documents.
Downloads · 30 days
22
8% of all-time downloads
All-time downloads
266
Public
Parameters
571M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
Fine-tuned version of NSI’s Legal Pegasus for abstractive summarization of legal and legislative documents.
This model fine-tunes nsi319/legal-pegasus, a legally-pretrained Pegasus model, on the BillSum dataset and additional cleaned summaries to generate concise, context-aware, and structured legal summaries.
It improves coherence, domain terminology handling, and section-wise reasoning in long-form legal and policy text.
This model builds on:
👉 nsi319/legal-pegasus
Pretrained on large-scale legal corpora including:
This provides strong legal-domain grounding before fine-tuning.
| Setting | Value |
|---|---|
| Base model | nsi319/legal-pegasus |
| Epochs | 8 |
| Learning rate | 2e-5 |
| Optimizer | AdamW |
| Weight decay | 0.01 |
| Batch size | 1 |
| Gradient accumulation | 4 |
| Max input length | 1024 tokens |
| Max summary length | 256 tokens |
| FP16 | Yes |
| Warmup | 500 steps |
| Logging-steps | 50 steps |
Training was performed on Kaggle P100 GPU (16GB).
| Metric | F1 |
|---|---|
| ROUGE-1 | ~0.5554 |
| ROUGE-2 | ~0.3531 |
| ROUGE-L | ~0.4178 |
| Metric | Score |
|---|---|
| Precision | 0.8841 |
| Recall | 0.8943 |
| F1 | 0.8864 |
BERTScore is emphasized since legal summarization requires semantic preservation rather than lexical overlap.
Pegasus supports ~1024 tokens, so long legal documents (3k–30k tokens) were handled using:
This enables effective summarization far beyond the backbone context limit.
This model is intended for:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "Anurag33Gaikwad/legal-pegasus-billsum-summarization"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
text = """Your long legal or legislative text here…"""
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=1024)
summary_ids = model.generate(
inputs["input_ids"],
num_beams=5,
max_length=256,
early_stopping=True
)
print(tokenizer.decode(summary_ids[0], skip_special_tok_