Downloads · 30 days
11
31% of all-time downloads
abhi-pwr/news-summarizer
news-summarizer is a machine learning model from abhi-pwr. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This repository contains a fine-tuned T5 base model for news article summarization. The model has been trained to generate concise summaries of news articles given their full text.
Downloads · 30 days
11
31% of all-time downloads
All-time downloads
36
Public
Parameters
223M
1.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin892 MB · 50%
From the Hugging Face model README
This repository contains a fine-tuned T5 base model for news article summarization. The model has been trained to generate concise summaries of news articles given their full text.
To use the fine-tuned T5 model for news article summarization, follow the instructions below:
from transformers import T5Tokenizer, T5ForConditionalGeneration
model_name = 'abhi-pwr/news-summarizer'
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
3.Generate summaries:
input_text = "Enter the news article here."
inputs = tokenizer.encode(input_text, return_tensors='pt', max_length=512, truncation=True)
summary_ids = model.generate(inputs, max_length=150, num_beams=4, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)