File size: 1,130 Bytes
7881983
 
 
 
 
 
 
 
507e0a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
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