news-summarizer

T5 Base Model Fine-Tuned for News Article Summarization

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.

Model Details

Usage

To use the fine-tuned T5 model for news article summarization, follow the instructions below:

  1. Install the required dependencies: pip install transformers torch
  2. Load the fine-tuned model:
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)