albertvillanova HF staff commited on
Commit
eb0b4a7
1 Parent(s): 0f9f475

Add loading script

Browse files
Files changed (1) hide show
  1. wikititles.py +41 -0
wikititles.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import datasets
2
+
3
+ from .wmt_utils import Wmt, WmtConfig
4
+
5
+
6
+ _URL = "http://www.statmt.org/wmt22/translation-task.html"
7
+ # TODO: Update with citation of overview paper once it is published.
8
+ _CITATION = """
9
+ @ONLINE {wmt22translate,
10
+ author = {Wikimedia Foundation},
11
+ title = {EMNLP 2022 Seventh Conference on Machine Translation (WMT22), Shared Task: General Machine Translation},
12
+ url = {http://www.statmt.org/wmt22/translation-task.html}
13
+ }
14
+ """
15
+
16
+
17
+ _LANGUAGE_PAIRS = (
18
+ {(src, "en") for src in ["cs", "de", "ha", "ig", "is", "ja", "ps", "ru", "zh"]}
19
+ | {("ca", "es"), ("de", "fr"), ("bn", "hi")}
20
+ | {(src, "pt") for src in ["ca", "es"]}
21
+ | {(src, "ro") for src in ["ca", "es", "pt"]}
22
+ | {("xh", "zu")}
23
+ )
24
+
25
+
26
+ class Wikititles(Wmt):
27
+
28
+ BUILDER_CONFIGS = [
29
+ WmtConfig(
30
+ description="Wikititles v3 {0}-{1} translation dataset".format(*language_pair),
31
+ url=_URL,
32
+ citation=_CITATION,
33
+ language_pair=language_pair,
34
+ version=datasets.Version("3.0.0"),
35
+ )
36
+ for language_pair in _LANGUAGE_PAIRS
37
+ ]
38
+
39
+ @property
40
+ def _subsets(self):
41
+ return {datasets.Split.TRAIN: ["wikititles_v3"]}