Downloads · 30 days
6
4% of all-time downloads
qwertyqwerty070806/LawSummBart
LawSummBart is a text generation model from qwertyqwerty070806. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
LawSummBart is a domain-adapted abstractive summarization model fine-tuned for Indian legal documents, built using a novel Extract-Then-Assign (ETA) dataset generation pipeline and LoRA parameter-efficient fine-tuning…
Downloads · 30 days
6
4% of all-time downloads
All-time downloads
149
Public
Parameters
406M
1.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
LawSummBart is a domain-adapted abstractive summarization model fine-tuned for Indian legal documents, built using a novel Extract-Then-Assign (ETA) dataset generation pipeline and LoRA parameter-efficient fine-tuning on top of BART-Large CNN.
The model is optimized to handle long court judgments and produce concise, high-quality summaries suitable for downstream legal research applications.
facebook/bart-large-cnnThis model uses an expanded training dataset generated via seven extractive summarization techniques combined with ROUGE & BERTScore-based sentence assignment, enabling improved domain adaptation for lengthy legal text.
Use model outputs as assistive summaries, not authoritative interpretations.
Human verification is essential for professional use.
import warnings
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
warnings.filterwarnings("ignore")
tokenizer = AutoTokenizer.from_pretrained("qwertyqwerty070806/LawSummBart", trust_remote_code=True)
model = AutoModelForSeq2SeqLM.from_pretrained("qwertyqwerty070806/LawSummBart", trust_remote_code=True).to("cuda")
text = """On March 5, 2021, the Securities and Exchange Commission charged AT&T..."""
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512).to("cuda")
summary_ids = model.generate(
**inputs,
max_length=220,
min_length=80,
num_beams=5,
length_penalty=1.0,
no_repeat_ngram_size=3,
early_stopping=True
)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))
| Parameter | Value | Description |
|---|---|---|
max_length | 220 | Maximum summary length |
min_length | 80 | Minimum summary length |
num_beams | 5 | Beam search width |
length_penalty | 1.0 | Penalizes long sequences |
no_repeat_ngram_size | 3 | Prevents repeated phrases |
early_stopping | True | Stops when all beams reach EOS |
Dataset generated using Extract-Then-Assign (ETA):
LoraConfig(
r=16,
lora_alpha=32,
lora_dropout=0.1,
target_modules=["q_proj", "v_proj"],
task_type="SEQ_2_SEQ_LM"
)
TrainingArguments(
num_train_epochs=10,
per_device_train_batch_size=4,
gradient_accumulation_steps=2,
learning_rate=1e-4,
eval_strategy="epoch",
save_strategy="epoch",
fp16=True,
load_best_model_at_end=True,
metric_for_best_model="eval_loss"
)
| Metric | Score |
|---|---|
| ROUGE-1 | 0.5723 |
| ROUGE-2 | 0.3547 |
| ROUGE-L | 0.3169 |
| BERTScore Precision | 0.8453 |
| BERTScore Recall | 0.8535 |
| BERTScore F1 | 0.8493 |
The model achieves strong performance on abstractive summarization of long-form legal text, showing improved coherence and domain fidelity compared to base BART.
q_projv_proj@misc{lawsummbart2024,
title = {LawSummBart: Legal Summarization with Extract-Then-Assign and LoRA Fine-Tuned BART},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/qwertyqwerty070806/LawSummBart}},
note = {Accessed: [DATE]}
}
For issues or questions, please visit: 👉 https://github.com/qwerty070806/LawSummBart