README.md 824 Bytes
Newer Older
Adalberto's avatar
Adalberto committed
1
---
2
language: pt
Adalberto's avatar
Adalberto committed
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
---

# PTT5-SMALL-SUM

## Model description

This model was trained to summarize texts in portuguese


based on ```unicamp-dl/ptt5-small-portuguese-vocab```

#### How to use

```python
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained('adalbertojunior/PTT5-SMALL-SUM')

t5 = T5ForConditionalGeneration.from_pretrained('adalbertojunior/PTT5-SMALL-SUM')

text="Esse 茅 um exemplo de sumariza莽茫o."

input_ids = tokenizer.encode(text, return_tensors="pt", add_special_tokens=True)

generated_ids = t5.generate(
        input_ids=input_ids,
        num_beams=1,
        max_length=40,
        #repetition_penalty=2.5
    ).squeeze()
    
predicted_span = tokenizer.decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True)


```