abisee/cnn_dailymail
Viewer • Updated • 936k • 172k • 344
This is a text summarization model built using a Seq2Seq architecture.
It was trained on the CNN/DailyMail dataset (3.0.0) and is capable of generating concise summaries of news articles or other long-form texts.
Intended Use:
Limitations & Biases:
| Metric | Score (%) |
|---|---|
| ROUGE-1 | 83.3 |
| ROUGE-2 | 60.0 |
| ROUGE-L | 83.3 |
| ROUGE-Lsum | 83.3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("your-username/your-model-name")
model = AutoModelForSeq2SeqLM.from_pretrained("your-username/your-model-name")
text = "The stock market saw a significant drop today due to rising inflation concerns. Investors are cautious ahead of the Federal Reserve's upcoming decision."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
summary_ids = model.generate(**inputs, max_length=150, num_beams=4, early_stopping=True)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))