File size: 1,116 Bytes
aea8aa6
 
 
 
 
 
 
 
 
949cddb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e01cb8
 
 
 
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
---
license: mit
language:
- it
base_model:
- google/mt5-small
pipeline_tag: text2text-generation
tags:
- legal
---

## Usage
```
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("VerbACxSS/sempl-it-mt5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("VerbACxSS/sempl-it-mt5-small")

model.eval()

text_to_simplify = 'Nella fattispecie, questo documento è di natura prescrittiva'
prompt = f'semplifica: {text_to_simplify}'

x = tokenizer(prompt, max_length=1024, truncation=True, padding=True, return_tensors='pt').input_ids
y = model.generate(x, max_length=1024)[0]
output = tokenizer.decode(y, max_length=1024, truncation=True, skip_special_tokens=True, clean_up_tokenization_spaces=True)

print(output)
```

## Acknowledgements
This contribution is a result of the research conducted within the framework of the PRIN 2020 (Progetti di Rilevante Interesse Nazionale) "VerbACxSS: on analytic verbs, complexity, synthetic verbs, and simplification. For accessibility" (Prot. 2020BJKB9M), funded by the Italian Ministero dell'Università e della Ricerca.