File size: 1,611 Bytes
6d929b2
 
a99c932
 
 
 
 
 
 
 
6d929b2
a99c932
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
---
license: mit
datasets:
- inkoziev/incomplete_utterance_restoration
language:
- ru
widget:
- text: '- Как тебя зовут?\n- Иван #'
- text: '- А живешь где?\n- В Москве #'
pipeline_tag: text2text-generation
---
# Den4ikAI/ruT5-small-interpreter
Модель для восстановления фразы с помощью контекста диалога (анафора, эллипсисы, гэппинг), проверки орфографии и нормализации текста диалоговых реплик.

Больше о задаче [тут](https://huggingface.co/inkoziev/rugpt_interpreter).
# Пример использования
```python
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
model_name = 'Den4ikAI/ruT5-small-interpreter'
tokenizer = T5Tokenizer.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 = '''- Ты собак любишь?
- Не люблю я их  #'''
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)
```
# Citation
```
@MISC{Den4ikAI/ruT5-small-interpreter,
    author  = {Denis Petrov, Ilya Koziev},
    title   = {Russian conversations interpreter and normalizer},
    url     = {https://huggingface.co/Den4ikAI/ruT5-small-interpreter},
    year    = 2023
}
```