Downloads · 30 days
36
1% of all-time downloads
Den4ikAI/FRED-T5-Large-interpreter
FRED-T5-Large-interpreter is a text generation model from Den4ikAI. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Модель для восстановления фразы с помощью контекста диалога (анафора, эллипсисы, гэппинг), проверки орфографии и нормализации текста диалоговых реплик.
Downloads · 30 days
36
1% of all-time downloads
All-time downloads
5.1K
Public
Repo size
3.3 GB
Likes
2
Public
Click a slice to open those files.
.bin1.6 GB · 100%
From the Hugging Face model README
Модель для восстановления фразы с помощью контекста диалога (анафора, эллипсисы, гэппинг), проверки орфографии и нормализации текста диалоговых реплик.
Больше о задаче тут.
import torch
from transformers import T5ForConditionalGeneration, GPT2Tokenizer
model_name = 'Den4ikAI/FRED-T5-Large-interpreter'
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = T5ForConditionalGeneration.from_pretrained(model_name)
model.eval()
t5_input = '''<SC1>- Ты собак любишь?
- Не люблю я их
Развернутый ответ: <extra_id_0>'''
input_ids = tokenizer(t5_input, return_tensors='pt').input_ids
out_ids = model.generate(input_ids=input_ids, max_length=100, eos_token_id=tokenizer.eos_token_id, early_stopping=True)
t5_output = tokenizer.decode(out_ids[0][1:])
print(t5_output)
@MISC{FRED-T5-Large-interpreter,
author = {Denis Petrov, Ilya Koziev},
title = {Russian conversations interpreter and normalizer},
url = {https://huggingface.co/Den4ikAI/FRED-T5-Large-interpreter},
year = 2023
}