Create discevalmt.py
Browse files- discevalmt.py +56 -0
discevalmt.py
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
'''DiscEvalMT: DiscEvalMT: Contrastive test sets for the evaluation of discourse in machine translation (v2)'''
|
3 |
+
|
4 |
+
import json
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
logger = datasets.logging.get_logger(__name__)
|
8 |
+
|
9 |
+
_CITATION = '''\
|
10 |
+
@inproceedings{bawden-etal-2018-evaluating,
|
11 |
+
title = "Evaluating Discourse Phenomena in Neural Machine Translation",
|
12 |
+
author = "Bawden, Rachel and Sennrich, Rico and Birch, Alexandra and Haddow, Barry",
|
13 |
+
booktitle = {{Proceedings of the 2018 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers)}},
|
14 |
+
month = jun,
|
15 |
+
year = "2018",
|
16 |
+
address = "New Orleans, Louisiana",
|
17 |
+
publisher = "Association for Computational Linguistics",
|
18 |
+
url = "https://www.aclweb.org/anthology/N18-1118",
|
19 |
+
doi = "10.18653/v1/N18-1118",
|
20 |
+
pages = "1304--1313"
|
21 |
+
}
|
22 |
+
'''
|
23 |
+
|
24 |
+
_DESCRIPTION = '''\
|
25 |
+
English-French hand-crafted contrastive test set to test anaphora and lexical choice
|
26 |
+
'''
|
27 |
+
|
28 |
+
_URLS = {
|
29 |
+
'test-lexical_choice': 'lexical_choice.json',
|
30 |
+
'test-anaphora': 'anaphora.json'
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
class DiscEvalMTConfig(datasets.BuilderConfig):
|
35 |
+
'''BuilderConfig for DiscEvalMT.'''
|
36 |
+
|
37 |
+
def __init__(self, **kwargs):
|
38 |
+
"""BuilderConfig for DiscEvalMT.
|
39 |
+
|
40 |
+
Args:
|
41 |
+
**kwargs: keyword arguments forwarded to super.
|
42 |
+
"""
|
43 |
+
super(DiscEvalMT, self).__init__(**kwargs)
|
44 |
+
|
45 |
+
|
46 |
+
class DiscEvalMT(datasets.GeneratorBasedBuilder):
|
47 |
+
'''DiscEvalMT: English-French contrastive test set for 2 discourse phenomena (anaphora and lexical cohesion)'''
|
48 |
+
|
49 |
+
BUILDER_CONFIGS = [
|
50 |
+
DiscEvalMTConfig(
|
51 |
+
name='plain_text',
|
52 |
+
version=datasets.Version('2.0.0', ''),
|
53 |
+
description='Plain text',
|
54 |
+
),
|
55 |
+
]
|
56 |
+
|