File size: 1,185 Bytes
da458d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import datasets

from .wmt_utils import Wmt, WmtConfig


_URL = "http://www.statmt.org/wmt22/translation-task.html"
# TODO: Update with citation of overview paper once it is published.
_CITATION = """
@ONLINE {wmt22translate,
    author = {Wikimedia Foundation},
    title  = {EMNLP 2022 Seventh Conference on Machine Translation (WMT22), Shared Task: General Machine Translation},
    url    = {http://www.statmt.org/wmt22/translation-task.html}
}
"""


_LANGUAGE_PAIRS = (
    {(src, "en") for src in ["cs", "de", "ha", "ig", "is", "ja", "ps", "ru", "zh"]}
    | {("ca", "es"), ("de", "fr"), ("bn", "hi")}
    | {(src, "pt") for src in ["ca", "es"]}
    | {(src, "ro") for src in ["ca", "es", "pt"]}
    | {("xh", "zu")}
)


class Wikititles(Wmt):

    BUILDER_CONFIGS = [
        WmtConfig(
            description="Wikititles v3 {0}-{1} translation dataset".format(*language_pair),
            url=_URL,
            citation=_CITATION,
            language_pair=language_pair,
            version=datasets.Version("3.0.0"),
        )
        for language_pair in _LANGUAGE_PAIRS
    ]

    @property
    def _subsets(self):
        return {datasets.Split.TRAIN: ["wikititles_v3"]}