Downloads · 30 days
26
35% of all-time downloads
admin-sauce/t5-summarizer
t5-summarizer is a summarization model from admin-sauce. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
26
35% of all-time downloads
All-time downloads
75
Public
Parameters
60.5M
242 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors242 MB · 99%
From the Hugging Face model README
This variant of the t5-small model, is fine-tuned specifically for the task of text summarization. This model aims to generate concise, coherent, and informative summaries from extensive text documents, leveraging the power of the T5's text-to-text approach.
This model is intended for use in summarizing long-form texts into concise, informative abstracts. It's particularly useful for professionals and researchers who need to quickly grasp the essence of detailed reports, research papers, or articles without reading the entire text.
Install with pip:
pip install transformers
Use in python:
from transformers import pipeline
from transformers import AutoTokenizer
from transformers import AutoModelForSeq2SeqLM
model_name = "admin-sauce/t5-summerizer"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
# Example usage
prefix = "summarize: "
input_text = "Your input text here."
input_ids = tokenizer.encode(prefix + input_text, return_tensors="pt")
summary_ids = model.generate(input_ids)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)
NOTE THAT FOR THE MODEL TO WORK AS INTENDED, YOU NEED TO APPEND THE 'summarize:' PREFIX BEFORE THE INPUT DATA
The model was trained using the Big Patent Dataset, comprising 1.3 million US patent documents and their corresponding human-written summaries. This dataset was chosen for its rich language and complex structure, representative of the challenging nature of document summarization tasks.
Training involved multiple subsets of the dataset to ensure broad coverage and robust model performance across varied document types.
Training was conducted over three rounds, with initial settings including a learning rate of 0.00002, batch size of 8, and 4 epochs. Subsequent rounds adjusted these parameters to refine model performance further, for respectively 0.0003, 8 and 12. As well, a linear decay learning rate schedule was applied to enhance model learning efficiency over time.
Model performance was evaluated using the ROUGE metric, highlighting its capability to generate summaries closely aligned with human-written abstracts.
| Metric | Value |
|---|---|
| Evaluation Loss (Eval Loss) | 1.9984 |
| Rouge-1 | 0.503 |
| Rouge-2 | 0.286 |
| Rouge-L | 0.3813 |
| Rouge-Lsum | 0.3813 |
| Average Generation Length (Gen Len) | 151.918 |
| Runtime (seconds) | 726.3344 |
| Samples per Second | 2.679 |
| Steps per Second | 0.336 |
This model card was written by Thomas Albert Iwin