Commit
·
baa8233
1
Parent(s):
82dfe66
Update sacrebleu_manual.py
Browse files- sacrebleu_manual.py +4 -6
sacrebleu_manual.py
CHANGED
@@ -2,16 +2,14 @@
|
|
2 |
NOTE: This file implements translation tasks using datasets from WMT conferences,
|
3 |
provided by sacrebleu. Traditionally they are evaluated with BLEU scores. TER
|
4 |
and CHRF are other options.
|
5 |
-
|
6 |
We defer citations and descriptions of the many translations tasks used
|
7 |
here to the SacreBLEU repo from which we've obtained the datasets:
|
8 |
https://github.com/mjpost/sacrebleu/blob/master/sacrebleu/dataset.py
|
9 |
-
|
10 |
Homepage: https://github.com/mjpost/sacrebleu/blob/master/sacrebleu/dataset.py
|
11 |
"""
|
12 |
-
import pycountry
|
13 |
from sacrebleu import sacrebleu
|
14 |
import datasets
|
|
|
15 |
|
16 |
|
17 |
_CITATION = """
|
@@ -41,11 +39,11 @@ class SacrebleuManual(datasets.GeneratorBasedBuilder):
|
|
41 |
def _info(self):
|
42 |
features = datasets.Features(
|
43 |
{
|
44 |
-
"translation": datasets.Value("
|
45 |
}
|
46 |
)
|
47 |
return datasets.DatasetInfo(
|
48 |
-
description=f"
|
49 |
features=features,
|
50 |
homepage="",
|
51 |
license="",
|
@@ -64,4 +62,4 @@ class SacrebleuManual(datasets.GeneratorBasedBuilder):
|
|
64 |
def _generate_examples(self):
|
65 |
with open(f"{os.path.join(self.config.name.split('_'))}.jsonl", encoding="utf-8") as f:
|
66 |
for key, row in enumerate(f):
|
67 |
-
yield key, json.loads(row)
|
|
|
2 |
NOTE: This file implements translation tasks using datasets from WMT conferences,
|
3 |
provided by sacrebleu. Traditionally they are evaluated with BLEU scores. TER
|
4 |
and CHRF are other options.
|
|
|
5 |
We defer citations and descriptions of the many translations tasks used
|
6 |
here to the SacreBLEU repo from which we've obtained the datasets:
|
7 |
https://github.com/mjpost/sacrebleu/blob/master/sacrebleu/dataset.py
|
|
|
8 |
Homepage: https://github.com/mjpost/sacrebleu/blob/master/sacrebleu/dataset.py
|
9 |
"""
|
|
|
10 |
from sacrebleu import sacrebleu
|
11 |
import datasets
|
12 |
+
import os
|
13 |
|
14 |
|
15 |
_CITATION = """
|
|
|
39 |
def _info(self):
|
40 |
features = datasets.Features(
|
41 |
{
|
42 |
+
"translation": datasets.Value("string"),
|
43 |
}
|
44 |
)
|
45 |
return datasets.DatasetInfo(
|
46 |
+
description=f"Sacrebleu\n{self.config.description}",
|
47 |
features=features,
|
48 |
homepage="",
|
49 |
license="",
|
|
|
62 |
def _generate_examples(self):
|
63 |
with open(f"{os.path.join(self.config.name.split('_'))}.jsonl", encoding="utf-8") as f:
|
64 |
for key, row in enumerate(f):
|
65 |
+
yield key, json.loads(row)
|