Downloads · 30 days
0
mia-project-2025/T5-base-finetuned-Xsum
T5-base-finetuned-Xsum is a machine learning model from mia-project-2025. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository provides a T5-base model fine-tuned on the XSum dataset for abstractive summarization. Given a document, the model generates a concise one-sentence summary.
Downloads · 30 days
0
Access
Public
Updated Aug 22, 2025
Repo size
5.3 GB
Likes
0
Public
Click a slice to open those files.
.pt3.6 GB · 57%
From the Hugging Face model README
This repository provides a T5-base model fine-tuned on the XSum dataset for abstractive summarization.
Given a document, the model generates a concise one-sentence summary.
train: ~204k samplesvalidation: ~11k samplestest: ~11k samplesdocument: news article (input).summary: one-sentence summary (target).id: BBC article ID.flax-community/t5-base-cnn-dmadamw_torch_fused0.1generate during eval./logs)Final evaluation results after 10 epochs:
| Metric | Value |
|---|---|
| Eval Loss | 0.4768 |
| ROUGE-1 | 35.03 |
| ROUGE-2 | 13.59 |
| ROUGE-L | 28.53 |
| ROUGE-Lsum | 28.51 |
| Train Loss | 1.9581 |
| Train Runtime | 111,354 s (~30.9 h) |
| Eval Runtime | 641.3 s |
| Samples/sec (eval) | 17.67 |
| Steps/sec (eval) | 1.106 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "mia-project-2025/T5-base-finetuned-Xsum"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
document = """The 2019 Rugby World Cup final was played in Yokohama, Japan,
where South Africa defeated England 32-12 to win their third title."""
inputs = tokenizer("summarize: " + document, return_tensors="pt", max_length=768, truncation=True)
summary_ids = model.generate(inputs["input_ids"], num_beams=4, max_length=128, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Generated Summary:", summary)