sempl-it's models
Collection
3 items
•
Updated
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)
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.
Base model
google/mt5-small