PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization
Paper
•
1912.08777
•
Published
•
2
This is a TensorFlow version of the google/pegasus-cnn_dailymail model, converted from PyTorch weights.
PEGASUS is a pre-training approach for abstractive text summarization. This model was fine-tuned on the CNN/DailyMail dataset for news summarization tasks.
Key Features:
from transformers import TFAutoModelForSeq2SeqLM, AutoTokenizer
# Load model and tokenizer
model = TFAutoModelForSeq2SeqLM.from_pretrained("your-username/pegasus-cnn-dailymail-tf")
tokenizer = AutoTokenizer.from_pretrained("your-username/pegasus-cnn-dailymail-tf")
# Example usage
article = "Your news article text here..."
inputs = tokenizer(article, max_length=1024, return_tensors="tf", truncation=True)
summary_ids = model.generate(inputs["input_ids"], max_length=150, min_length=30, length_penalty=2.0, num_beams=4, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)
This model was originally trained on the CNN/DailyMail dataset, which contains news articles paired with human-written summaries.
This TensorFlow model should perform identically to the original PyTorch version, as it was converted directly from the same weights.
@misc{zhang2019pegasus,
title={PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization},
author={Jingqing Zhang and Yao Zhao and Mohammad Saleh and Peter J. Liu},
year={2019},
eprint={1912.08777},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
This model was converted from PyTorch to TensorFlow using the from_pt=True parameter in the Transformers library, ensuring weight preservation and identical performance.