File size: 1,667 Bytes
94438b0
e107cff
94438b0
e107cff
 
94438b0
e107cff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
language: ru
license: apache-2.0
datasets:
- IlyaGusev/gazeta
---

# RuT5LargeSumGazeta

## Model description

This is the model for abstractive summarization for Russian based on ai-forever/ruT5-large.

## Intended uses & limitations

### How to use

Here is how to use this model in PyTorch:

```python
from transformers import AutoTokenizer, T5ForConditionalGeneration

model_name = "mlenjoyneer/rut5_large_sum_gazeta"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)

article_text = "..."

input_ids = tokenizer(
    [article_text],
    max_length=600,
    add_special_tokens=True,
    padding="max_length",
    truncation=True,
    return_tensors="pt"
)["input_ids"]

output_ids = model.generate(
    input_ids=input_ids,
    no_repeat_ngram_size=4
)[0]

summary = tokenizer.decode(output_ids, skip_special_tokens=True)
print(summary)
```

## Training data

- Dataset: [Gazeta](https://huggingface.co/datasets/IlyaGusev/gazeta)

## Evaluation results

| Model                                        | R-1-f | R-2-f | R-L-f | chrF | BLEU | Avg char length |
| -------------------------------------------- | ----- | ----- | ----- | ---- | ---- | --------------- |
| IlyaGusev/mbart_ru_sum_gazeta                | 28.7  | 11.1  | 24.4  | **37.3** | **9.4**  | 373     |
| IlyaGusev/rut5_base_sum_gazeta               | 28.6  | 11.1  | 24.5  | 37.2 | **9.4**  | 331         |
| IlyaGusev/rugpt3medium_sum_gazeta            | 24.1  | 6.5   | 19.8  | 32.1 | 3.6  | 242             |
| rut5-large_sum_gazeta                        | **29.6**  | **11.7**  | **25.2**  | **37.3** | **9.4**  | 304 |