Views
No views yet
google/mt5-small для упрощения сложных узбекских текстов
(юридические документы, официальные новости, гос. инструкции) в текст,
понятный обычному читателю.1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3tokenizer = AutoTokenizer.from_pretrained("username/uz-text-simplifier")
4model = AutoModelForSeq2SeqLM.from_pretrained("username/uz-text-simplifier")
5
6text = "Oʻzbekiston Respublikasi Vazirlar Mahkamasining qarori bilan..."
7inputs = tokenizer("simplify: " + text, return_tensors="pt", truncation=True, max_length=256)
8out = model.generate(**inputs, max_new_tokens=256, num_beams=4)
9print(tokenizer.decode(out[0], skip_special_tokens=True))"simplify: " — модель обучена под этот task-prefix.google/mt5-smalllaw, ~59%)