|
--- |
|
datasets: |
|
- abisee/cnn_dailymail |
|
language: |
|
- en |
|
base_model: |
|
- google-t5/t5-small |
|
pipeline_tag: summarization |
|
--- |
|
|
|
|
|
# AML Text Summarization T5 Model |
|
|
|
This is a text summarization model based on the T5-Small architecture, developed as part of the Advanced Machine Learning course at the University of Bremen. |
|
|
|
## Model Description |
|
|
|
This model is fine-tuned on the CNN/Daily Mail dataset for abstractive text summarization. It uses the T5-Small (Text-To-Text Transfer Transformer) architecture. |
|
|
|
## Usage |
|
|
|
``` |
|
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("s0urin/aml-text-summarization-t5") |
|
model = AutoModelForSeq2SeqLM.from_pretrained("s0urin/aml-text-summarization-t5") |
|
|
|
text = "Your long text here..." |
|
inputs = tokenizer("summarize: " + text, return_tensors="pt", max_length=512, truncation=True) |
|
outputs = model.generate(inputs.input_ids, max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True) |
|
summary = tokenizer.decode(outputs, skip_special_tokens=True) |
|
|
|
print(summary) |
|
``` |
|
|
|
|
|
## Authors |
|
|
|
- Sourin Kumar Pal |
|
- Jassim Hameed Ayobkhan |