๐ Text Summarization of News Articles
State-of-the-art lightweight pretrained Transformer-based encoder-decoder model for text summarization.
This model is designed to efficiently summarize news articles, offering a high - performance solution for text summarization tasks.
๐ Quick Start
Input Format
The input for the model should follow the format: prefix + input text. For example: 'summarize: '+ 'Ever noticed how plane seats.....'
โจ Features
- Lightweight: A state - of - the - art lightweight model, which is efficient for text summarization.
- Transformer - based: Built on a Transformer - based encoder - decoder architecture.
- Pretrained: Pretrained on the CNN - DailyMail News dataset, ensuring high - quality summarization.
๐ฆ Installation
The provided README does not contain installation steps, so this section is skipped.
๐ป Usage Examples
Basic Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-finetune-cnndaily-news")
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-finetune-cnndaily-news")
model.cuda()
src = "summarize: Ever noticed how plane seats appear to be getting smaller and smaller? With increasing numbers of people taking to the skies, some experts are questioning if having such packed out planes is putting passengers at risk. They say that the shrinking space on aeroplanes is not only uncomfortable - it's putting our health and safety in danger. More than squabbling over the arm rest, shrinking space on planes putting our health and safety in danger? This week, a U.S consumer advisory group set up by the Department of Transportation said at a public hearing that while the government is happy to set standards for animals flying on planes, it doesn't stipulate a minimum amount of space for humans. 'In a world where animals have more rights to space and food than humans,' said Charlie Leocha, consumer representative on the committee.\xa0'It is time that the DOT and FAA take a stand for humane treatment of passengers.' But could crowding on planes lead to more serious issues than fighting for space in the overhead lockers, crashing elbows and seat back kicking? Tests conducted by the FAA use planes with a 31 inch pitch, a standard which on some airlines has decreased . Many economy seats on United Airlines have 30 inches of room, while some airlines offer as little as 28 inches . Cynthia Corbertt, a human factors researcher with the Federal Aviation Administration, that it conducts tests on how quickly passengers can leave a plane. But these tests are conducted using planes with 31 inches between each row of seats, a standard which on some airlines has decreased, reported the Detroit News. The distance between two seats from one point on a seat to the same point on the seat behind it is known as the pitch. While most airlines stick to a pitch of 31 inches or above, some fall below this. While United Airlines has 30 inches of space, Gulf Air economy seats have between 29 and 32 inches, Air Asia offers 29 inches and Spirit Airlines offers just 28 inches. British Airways has a seat pitch of 31 inches, while easyJet has 29 inches, Thomson's short haul seat pitch is 28 inches, and Virgin Atlantic's is 30-31."
tokenized_text = tokenizer.encode(src, return_tensors="pt").cuda()
model.eval()
summary_ids = model.generate(tokenized_text, max_length=150)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
output
๐ Documentation
Model Training
The model is trained on the CNN - DailyMail News dataset with an input length of 512 and an output length of 150.
Inference Parameters
| Property | Details |
|----------|---------|
| max_length | 150 |
Supported Datasets
Tags
๐ง Technical Details
The provided README does not contain technical details, so this section is skipped.
๐ License
This project is licensed under the MIT license.