File size: 2,165 Bytes
5f1eac3 7450f66 77bb26a 5f1eac3 7450f66 5c8f3c6 7450f66 5f1eac3 7450f66 34c5f10 7450f66 34c5f10 7450f66 34c5f10 5f1eac3 eaa55a7 687aa5f eaa55a7 dbed8ae eaa55a7 34c5f10 |
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 60 |
---
title: RougeRu
emoji: 🌖
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 3.19.1
app_file: app.py
pinned: false
tags:
- evaluate
- metric
description: >-
ROUGE RU is russian language variant of ROUGE with stemmer and stop words but
without synonymas. It is case insensitive, meaning that upper case letters are
treated the same way as lower case letters.
This metrics is a wrapper around Google Research reimplementation of ROUGE: https://github.com/google-research/google-research/tree/master/rouge
---
# Metric Card for RougeRu
## Metric Description
RougeRu is a russian language variant of ROUGE with stemmer and stop words but
without synonymas. It is case insensitive, meaning that upper case letters are
treated the same way as lower case letters.
This metrics is a wrapper around Google Research reimplementation of ROUGE: https://github.com/google-research/google-research/tree/master/rouge
## How to Use
```python
import evaluate
import nltk
nltk.download("stopwords")
nltk.download("punkt")
nltk.download("punkt_tab")
rouge_ru = evaluate.load('Remeris/rouge_ru')
predictions = ["ну, привет!", "адмирал кеноби!"]
references = ["Ну, привет!", "Генерал Кеноби!"]
results = rouge_ru.compute(predictions=predictions, references=references)
print(results)
{'rouge1': {'recall': 0.75, 'precision': 0.75, 'fmeasure': 0.75},
'rouge2': {'recall': 0.0, 'precision': 0.0, 'fmeasure': 0.0},
'rougeL': {'recall': 0.75, 'precision': 0.75, 'fmeasure': 0.75},
'rougeLsum': {'recall': 0.75, 'precision': 0.75, 'fmeasure': 0.75}}
```
### Inputs
- **predictions** (`list`): list of predictions to evaluate. Each prediction should be a string with tokens separated by spaces and punctuation.
- **references** (`list` or `list[list]`): list of reference for each prediction. Each reference should be a string with tokens separated by spaces and punctuation.
### Output Values
This metric outputs a dictionary, containing the scores.
There are precision, recall, F1 values for rouge1, rouge2 and rougeL.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference |