CoolFace
Modelpublic

data-plumber/pegasus-cnn-dailymail-tf

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes8downloads
Model Card

Pegasus CNN/DailyMail (TensorFlow)

This is a TensorFlow version of the google/pegasus-cnn_dailymail model, converted from PyTorch weights.

Model Description

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:

  • โ€”๐Ÿ”„ Converted from PyTorch to TensorFlow for better TF.js and TensorFlow ecosystem compatibility
  • โ€”๐Ÿ“ฐ Specialized for news article summarization
  • โ€”๐ŸŽฏ Fine-tuned on CNN/DailyMail dataset

Usage

python
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)

Model Details

  • โ€”Model Type: Sequence-to-sequence (Text Summarization)
  • โ€”Language: English
  • โ€”License: Apache 2.0
  • โ€”Framework: TensorFlow
  • โ€”Base Model: google/pegasus-cnn_dailymail

Training Data

This model was originally trained on the CNN/DailyMail dataset, which contains news articles paired with human-written summaries.

Performance

This TensorFlow model should perform identically to the original PyTorch version, as it was converted directly from the same weights.

Citation

bibtex
@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}
}

Conversion Notes

This model was converted from PyTorch to TensorFlow using the from_pt=True parameter in the Transformers library, ensuring weight preservation and identical performance.