Downloads · 30 days
24
17% of all-time downloads
AbdullahAlnemr1/flan-t5-summarizer
flan-t5-summarizer is a summarization model from AbdullahAlnemr1. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of google/flan-t5-base on the CNN/DailyMail dataset using the Hugging Face Transformers library.
Downloads · 30 days
24
17% of all-time downloads
All-time downloads
143
Public
Parameters
248M
991 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of google/flan-t5-base on the CNN/DailyMail dataset using the Hugging Face Transformers library.
Abstractive Summarization: Given a news article, generate a concise summary.
The model was fine-tuned on 20,000 training samples and validated/tested on 2,000 samples. Evaluation was performed using ROUGE metrics:
| Metric | Score |
|---|---|
| ROUGE-1 | 25.33 |
| ROUGE-2 | 11.96 |
| ROUGE-L | 20.68 |
| ROUGE-Lsum | 23.81 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
model = T5ForConditionalGeneration.from_pretrained("AbdullahAlnemr1/flan-t5-summarizer")
tokenizer = T5Tokenizer.from_pretrained("AbdullahAlnemr1/flan-t5-summarizer")
input_text = "summarize: The US president met with the Senate to discuss..."
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
summary_ids = model.generate(inputs["input_ids"], max_length=128, num_beams=4, early_stopping=True)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))