Datasets:
Update files from the datasets library (from 1.4.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.4.0
- README.md +21 -21
- dataset_infos.json +1 -1
- wmt_utils.py +64 -62
README.md
CHANGED
@@ -27,7 +27,7 @@
|
|
27 |
- [Citation Information](#citation-information)
|
28 |
- [Contributions](#contributions)
|
29 |
|
30 |
-
##
|
31 |
|
32 |
- **Homepage:** [http://www.statmt.org/wmt15/translation-task.html](http://www.statmt.org/wmt15/translation-task.html)
|
33 |
- **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
@@ -37,7 +37,7 @@
|
|
37 |
- **Size of the generated dataset:** 271.17 MB
|
38 |
- **Total amount of disk used:** 1930.31 MB
|
39 |
|
40 |
-
###
|
41 |
|
42 |
Translate dataset based on the data from statmt.org.
|
43 |
|
@@ -57,19 +57,19 @@ config = datasets.wmt.WmtConfig(
|
|
57 |
builder = datasets.builder("wmt_translate", config=config)
|
58 |
```
|
59 |
|
60 |
-
###
|
61 |
|
62 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
63 |
|
64 |
-
###
|
65 |
|
66 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
67 |
|
68 |
-
##
|
69 |
|
70 |
We show detailed information for up to 5 configurations of the dataset.
|
71 |
|
72 |
-
###
|
73 |
|
74 |
#### cs-en
|
75 |
|
@@ -82,62 +82,62 @@ An example of 'validation' looks as follows.
|
|
82 |
|
83 |
```
|
84 |
|
85 |
-
###
|
86 |
|
87 |
The data fields are the same among all splits.
|
88 |
|
89 |
#### cs-en
|
90 |
- `translation`: a multilingual `string` variable, with possible languages including `cs`, `en`.
|
91 |
|
92 |
-
###
|
93 |
|
94 |
|name |train |validation|test|
|
95 |
|-----|-----:|---------:|---:|
|
96 |
|cs-en|959768| 3003|2656|
|
97 |
|
98 |
-
##
|
99 |
|
100 |
-
###
|
101 |
|
102 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
103 |
|
104 |
-
###
|
105 |
|
106 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
107 |
|
108 |
-
###
|
109 |
|
110 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
111 |
|
112 |
-
###
|
113 |
|
114 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
115 |
|
116 |
-
##
|
117 |
|
118 |
-
###
|
119 |
|
120 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
121 |
|
122 |
-
###
|
123 |
|
124 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
125 |
|
126 |
-
###
|
127 |
|
128 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
129 |
|
130 |
-
##
|
131 |
|
132 |
-
###
|
133 |
|
134 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
135 |
|
136 |
-
###
|
137 |
|
138 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
139 |
|
140 |
-
###
|
141 |
|
142 |
```
|
143 |
|
|
|
27 |
- [Citation Information](#citation-information)
|
28 |
- [Contributions](#contributions)
|
29 |
|
30 |
+
## Dataset Description
|
31 |
|
32 |
- **Homepage:** [http://www.statmt.org/wmt15/translation-task.html](http://www.statmt.org/wmt15/translation-task.html)
|
33 |
- **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
|
|
37 |
- **Size of the generated dataset:** 271.17 MB
|
38 |
- **Total amount of disk used:** 1930.31 MB
|
39 |
|
40 |
+
### Dataset Summary
|
41 |
|
42 |
Translate dataset based on the data from statmt.org.
|
43 |
|
|
|
57 |
builder = datasets.builder("wmt_translate", config=config)
|
58 |
```
|
59 |
|
60 |
+
### Supported Tasks
|
61 |
|
62 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
63 |
|
64 |
+
### Languages
|
65 |
|
66 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
67 |
|
68 |
+
## Dataset Structure
|
69 |
|
70 |
We show detailed information for up to 5 configurations of the dataset.
|
71 |
|
72 |
+
### Data Instances
|
73 |
|
74 |
#### cs-en
|
75 |
|
|
|
82 |
|
83 |
```
|
84 |
|
85 |
+
### Data Fields
|
86 |
|
87 |
The data fields are the same among all splits.
|
88 |
|
89 |
#### cs-en
|
90 |
- `translation`: a multilingual `string` variable, with possible languages including `cs`, `en`.
|
91 |
|
92 |
+
### Data Splits Sample Size
|
93 |
|
94 |
|name |train |validation|test|
|
95 |
|-----|-----:|---------:|---:|
|
96 |
|cs-en|959768| 3003|2656|
|
97 |
|
98 |
+
## Dataset Creation
|
99 |
|
100 |
+
### Curation Rationale
|
101 |
|
102 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
103 |
|
104 |
+
### Source Data
|
105 |
|
106 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
107 |
|
108 |
+
### Annotations
|
109 |
|
110 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
111 |
|
112 |
+
### Personal and Sensitive Information
|
113 |
|
114 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
115 |
|
116 |
+
## Considerations for Using the Data
|
117 |
|
118 |
+
### Social Impact of Dataset
|
119 |
|
120 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
121 |
|
122 |
+
### Discussion of Biases
|
123 |
|
124 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
125 |
|
126 |
+
### Other Known Limitations
|
127 |
|
128 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
129 |
|
130 |
+
## Additional Information
|
131 |
|
132 |
+
### Dataset Curators
|
133 |
|
134 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
135 |
|
136 |
+
### Licensing Information
|
137 |
|
138 |
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
139 |
|
140 |
+
### Citation Information
|
141 |
|
142 |
```
|
143 |
|
dataset_infos.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"cs-en": {"description": "Translate dataset based on the data from statmt.org.\n\nVersions exists for the different years using a combination of multiple data\nsources. The base `wmt_translate` allows you to create your own config to choose\nyour own data/language pair by creating a custom `datasets.translate.wmt.WmtConfig`.\n\n```\nconfig = datasets.wmt.WmtConfig(\n version=\"0.0.1\",\n language_pair=(\"fr\", \"de\"),\n subsets={\n datasets.Split.TRAIN: [\"commoncrawl_frde\"],\n datasets.Split.VALIDATION: [\"euelections_dev2019\"],\n },\n)\nbuilder = datasets.builder(\"wmt_translate\", config=config)\n```\n\n", "citation": "\n@InProceedings{bojar-EtAl:2015:WMT,\n author = {Bojar, Ond\u000b{r}ej and Chatterjee, Rajen and Federmann, Christian and Haddow, Barry and Huck, Matthias and Hokamp, Chris and Koehn, Philipp and Logacheva, Varvara and Monz, Christof and Negri, Matteo and Post, Matt and Scarton, Carolina and Specia, Lucia and Turchi, Marco},\n title = {Findings of the 2015 Workshop on Statistical Machine Translation},\n booktitle = {Proceedings of the Tenth Workshop on Statistical Machine Translation},\n month = {September},\n year = {2015},\n address = {Lisbon, Portugal},\n publisher = {Association for Computational Linguistics},\n pages = {1--46},\n url = {http://aclweb.org/anthology/W15-3001}\n}\n", "homepage": "http://www.statmt.org/wmt15/translation-task.html", "license": "", "features": {"translation": {"languages": ["cs", "en"], "id": null, "_type": "Translation"}}, "supervised_keys": {"input": "cs", "output": "en"}, "builder_name": "wmt15", "config_name": "cs-en", "version": {"version_str": "1.0.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 572203, "num_examples": 2656, "dataset_name": "wmt15"}, "train": {"name": "train", "num_bytes": 283007221, "num_examples": 959768, "dataset_name": "wmt15"}, "validation": {"name": "validation", "num_bytes": 757817, "num_examples": 3003, "dataset_name": "wmt15"}}, "download_checksums": {"
|
|
|
1 |
+
{"cs-en": {"description": "Translate dataset based on the data from statmt.org.\n\nVersions exists for the different years using a combination of multiple data\nsources. The base `wmt_translate` allows you to create your own config to choose\nyour own data/language pair by creating a custom `datasets.translate.wmt.WmtConfig`.\n\n```\nconfig = datasets.wmt.WmtConfig(\n version=\"0.0.1\",\n language_pair=(\"fr\", \"de\"),\n subsets={\n datasets.Split.TRAIN: [\"commoncrawl_frde\"],\n datasets.Split.VALIDATION: [\"euelections_dev2019\"],\n },\n)\nbuilder = datasets.builder(\"wmt_translate\", config=config)\n```\n\n", "citation": "\n@InProceedings{bojar-EtAl:2015:WMT,\n author = {Bojar, Ond\u000b{r}ej and Chatterjee, Rajen and Federmann, Christian and Haddow, Barry and Huck, Matthias and Hokamp, Chris and Koehn, Philipp and Logacheva, Varvara and Monz, Christof and Negri, Matteo and Post, Matt and Scarton, Carolina and Specia, Lucia and Turchi, Marco},\n title = {Findings of the 2015 Workshop on Statistical Machine Translation},\n booktitle = {Proceedings of the Tenth Workshop on Statistical Machine Translation},\n month = {September},\n year = {2015},\n address = {Lisbon, Portugal},\n publisher = {Association for Computational Linguistics},\n pages = {1--46},\n url = {http://aclweb.org/anthology/W15-3001}\n}\n", "homepage": "http://www.statmt.org/wmt15/translation-task.html", "license": "", "features": {"translation": {"languages": ["cs", "en"], "id": null, "_type": "Translation"}}, "supervised_keys": {"input": "cs", "output": "en"}, "builder_name": "wmt15", "config_name": "cs-en", "version": {"version_str": "1.0.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 572203, "num_examples": 2656, "dataset_name": "wmt15"}, "train": {"name": "train", "num_bytes": 283007221, "num_examples": 959768, "dataset_name": "wmt15"}, "validation": {"name": "validation", "num_bytes": 757817, "num_examples": 3003, "dataset_name": "wmt15"}}, "download_checksums": {"https://huggingface.co/datasets/wmt/wmt13/resolve/main/training-parallel-europarl-v7.tgz": {"num_bytes": 657632379, "checksum": "0224c7c710c8a063dfd893b0cc0830202d61f4c75c17eb8e31836103d27d96e7"}, "https://huggingface.co/datasets/wmt/wmt13/resolve/main/training-parallel-commoncrawl.tgz": {"num_bytes": 918311367, "checksum": "c7a74e2ea01ac6c920123108627e35278d4ccb5701e15428ffa34de86fa3a9e5"}, "https://huggingface.co/datasets/wmt/wmt15/resolve/main/training-parallel-nc-v10.tgz": {"num_bytes": 125136590, "checksum": "11e053e7ea29e87e69a1ad05e61cb559820947ecec144ea8c1d6cf05017c9602"}, "https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz": {"num_bytes": 38654961, "checksum": "7a7deccf82ebb05ba508dba5eb21356492224e8f630ec4f992132b029b4b25e7"}}, "download_size": 1739735297, "dataset_size": 284337241, "size_in_bytes": 2024072538}}
|
wmt_utils.py
CHANGED
@@ -23,7 +23,6 @@ import functools
|
|
23 |
import glob
|
24 |
import gzip
|
25 |
import itertools
|
26 |
-
import logging
|
27 |
import os
|
28 |
import re
|
29 |
import xml.etree.cElementTree as ElementTree
|
@@ -34,6 +33,9 @@ import six
|
|
34 |
import datasets
|
35 |
|
36 |
|
|
|
|
|
|
|
37 |
_DESCRIPTION = """\
|
38 |
Translate dataset based on the data from statmt.org.
|
39 |
|
@@ -128,7 +130,7 @@ _TRAIN_SUBSETS = [
|
|
128 |
name="commoncrawl",
|
129 |
target="en", # fr-de pair in commoncrawl_frde
|
130 |
sources={"cs", "de", "es", "fr", "ru"},
|
131 |
-
url="
|
132 |
path=("commoncrawl.{src}-en.{src}", "commoncrawl.{src}-en.en"),
|
133 |
),
|
134 |
SubDataset(
|
@@ -136,8 +138,8 @@ _TRAIN_SUBSETS = [
|
|
136 |
target="de",
|
137 |
sources={"fr"},
|
138 |
url=(
|
139 |
-
"
|
140 |
-
"
|
141 |
),
|
142 |
path=("", ""),
|
143 |
),
|
@@ -185,14 +187,14 @@ _TRAIN_SUBSETS = [
|
|
185 |
name="dcep_v1",
|
186 |
target="en",
|
187 |
sources={"lv"},
|
188 |
-
url="
|
189 |
path=("dcep.en-lv/dcep.lv", "dcep.en-lv/dcep.en"),
|
190 |
),
|
191 |
SubDataset(
|
192 |
name="europarl_v7",
|
193 |
target="en",
|
194 |
sources={"cs", "de", "es", "fr"},
|
195 |
-
url="
|
196 |
path=("training/europarl-v7.{src}-en.{src}", "training/europarl-v7.{src}-en.en"),
|
197 |
),
|
198 |
SubDataset(
|
@@ -200,8 +202,8 @@ _TRAIN_SUBSETS = [
|
|
200 |
target="de",
|
201 |
sources={"fr"},
|
202 |
url=(
|
203 |
-
"
|
204 |
-
"
|
205 |
),
|
206 |
path=("", ""),
|
207 |
),
|
@@ -209,28 +211,28 @@ _TRAIN_SUBSETS = [
|
|
209 |
name="europarl_v8_18",
|
210 |
target="en",
|
211 |
sources={"et", "fi"},
|
212 |
-
url="
|
213 |
path=("training/europarl-v8.{src}-en.{src}", "training/europarl-v8.{src}-en.en"),
|
214 |
),
|
215 |
SubDataset(
|
216 |
name="europarl_v8_16",
|
217 |
target="en",
|
218 |
sources={"fi", "ro"},
|
219 |
-
url="
|
220 |
path=("training-parallel-ep-v8/europarl-v8.{src}-en.{src}", "training-parallel-ep-v8/europarl-v8.{src}-en.en"),
|
221 |
),
|
222 |
SubDataset(
|
223 |
name="europarl_v9",
|
224 |
target="en",
|
225 |
sources={"cs", "de", "fi", "lt"},
|
226 |
-
url="
|
227 |
path="",
|
228 |
),
|
229 |
SubDataset(
|
230 |
name="gigafren",
|
231 |
target="en",
|
232 |
sources={"fr"},
|
233 |
-
url="
|
234 |
path=("giga-fren.release2.fixed.fr.gz", "giga-fren.release2.fixed.en.gz"),
|
235 |
),
|
236 |
SubDataset(
|
@@ -245,35 +247,35 @@ _TRAIN_SUBSETS = [
|
|
245 |
name="leta_v1",
|
246 |
target="en",
|
247 |
sources={"lv"},
|
248 |
-
url="
|
249 |
path=("LETA-lv-en/leta.lv", "LETA-lv-en/leta.en"),
|
250 |
),
|
251 |
SubDataset(
|
252 |
name="multiun",
|
253 |
target="en",
|
254 |
sources={"es", "fr"},
|
255 |
-
url="
|
256 |
path=("un/undoc.2000.{src}-en.{src}", "un/undoc.2000.{src}-en.en"),
|
257 |
),
|
258 |
SubDataset(
|
259 |
name="newscommentary_v9",
|
260 |
target="en",
|
261 |
sources={"cs", "de", "fr", "ru"},
|
262 |
-
url="
|
263 |
path=("training/news-commentary-v9.{src}-en.{src}", "training/news-commentary-v9.{src}-en.en"),
|
264 |
),
|
265 |
SubDataset(
|
266 |
name="newscommentary_v10",
|
267 |
target="en",
|
268 |
sources={"cs", "de", "fr", "ru"},
|
269 |
-
url="
|
270 |
path=("news-commentary-v10.{src}-en.{src}", "news-commentary-v10.{src}-en.en"),
|
271 |
),
|
272 |
SubDataset(
|
273 |
name="newscommentary_v11",
|
274 |
target="en",
|
275 |
sources={"cs", "de", "ru"},
|
276 |
-
url="
|
277 |
path=(
|
278 |
"training-parallel-nc-v11/news-commentary-v11.{src}-en.{src}",
|
279 |
"training-parallel-nc-v11/news-commentary-v11.{src}-en.en",
|
@@ -283,14 +285,14 @@ _TRAIN_SUBSETS = [
|
|
283 |
name="newscommentary_v12",
|
284 |
target="en",
|
285 |
sources={"cs", "de", "ru", "zh"},
|
286 |
-
url="
|
287 |
path=("training/news-commentary-v12.{src}-en.{src}", "training/news-commentary-v12.{src}-en.en"),
|
288 |
),
|
289 |
SubDataset(
|
290 |
name="newscommentary_v13",
|
291 |
target="en",
|
292 |
sources={"cs", "de", "ru", "zh"},
|
293 |
-
url="
|
294 |
path=(
|
295 |
"training-parallel-nc-v13/news-commentary-v13.{src}-en.{src}",
|
296 |
"training-parallel-nc-v13/news-commentary-v13.{src}-en.en",
|
@@ -314,7 +316,7 @@ _TRAIN_SUBSETS = [
|
|
314 |
name="onlinebooks_v1",
|
315 |
target="en",
|
316 |
sources={"lv"},
|
317 |
-
url="
|
318 |
path=("farewell/farewell.lv", "farewell/farewell.en"),
|
319 |
),
|
320 |
SubDataset(
|
@@ -349,8 +351,8 @@ _TRAIN_SUBSETS = [
|
|
349 |
target="de",
|
350 |
sources={"fr"},
|
351 |
url=(
|
352 |
-
"
|
353 |
-
"
|
354 |
),
|
355 |
path=("", ""),
|
356 |
),
|
@@ -358,7 +360,7 @@ _TRAIN_SUBSETS = [
|
|
358 |
name="rapid_2016",
|
359 |
target="en",
|
360 |
sources={"de", "et", "fi"},
|
361 |
-
url="
|
362 |
path=("rapid2016.{0}-{1}.{src}", "rapid2016.{0}-{1}.en"),
|
363 |
),
|
364 |
SubDataset(
|
@@ -379,28 +381,28 @@ _TRAIN_SUBSETS = [
|
|
379 |
name="setimes_2",
|
380 |
target="en",
|
381 |
sources={"ro", "tr"},
|
382 |
-
url="
|
383 |
path="",
|
384 |
),
|
385 |
SubDataset(
|
386 |
name="uncorpus_v1",
|
387 |
target="en",
|
388 |
sources={"ru", "zh"},
|
389 |
-
url="https://
|
390 |
path=("en-{src}/UNv1.0.en-{src}.{src}", "en-{src}/UNv1.0.en-{src}.en"),
|
391 |
),
|
392 |
SubDataset(
|
393 |
name="wikiheadlines_fi",
|
394 |
target="en",
|
395 |
sources={"fi"},
|
396 |
-
url="
|
397 |
path="wiki/fi-en/titles.fi-en",
|
398 |
),
|
399 |
SubDataset(
|
400 |
name="wikiheadlines_hi",
|
401 |
target="en",
|
402 |
sources={"hi"},
|
403 |
-
url="
|
404 |
path="wiki/hi-en/wiki-titles.hi-en",
|
405 |
),
|
406 |
SubDataset(
|
@@ -408,14 +410,14 @@ _TRAIN_SUBSETS = [
|
|
408 |
name="wikiheadlines_ru",
|
409 |
target="en",
|
410 |
sources={"ru"},
|
411 |
-
url="
|
412 |
path="wiki/ru-en/wiki.ru-en",
|
413 |
),
|
414 |
SubDataset(
|
415 |
name="wikititles_v1",
|
416 |
target="en",
|
417 |
sources={"cs", "de", "fi", "gu", "kk", "lt", "ru", "zh"},
|
418 |
-
url="
|
419 |
path="",
|
420 |
),
|
421 |
SubDataset(
|
@@ -443,175 +445,175 @@ _DEV_SUBSETS = [
|
|
443 |
name="euelections_dev2019",
|
444 |
target="de",
|
445 |
sources={"fr"},
|
446 |
-
url="
|
447 |
path=("dev/euelections_dev2019.fr-de.src.fr", "dev/euelections_dev2019.fr-de.tgt.de"),
|
448 |
),
|
449 |
SubDataset(
|
450 |
name="newsdev2014",
|
451 |
target="en",
|
452 |
sources={"hi"},
|
453 |
-
url="
|
454 |
path=("dev/newsdev2014.hi", "dev/newsdev2014.en"),
|
455 |
),
|
456 |
SubDataset(
|
457 |
name="newsdev2015",
|
458 |
target="en",
|
459 |
sources={"fi"},
|
460 |
-
url="
|
461 |
path=("dev/newsdev2015-fien-src.{src}.sgm", "dev/newsdev2015-fien-ref.en.sgm"),
|
462 |
),
|
463 |
SubDataset(
|
464 |
name="newsdiscussdev2015",
|
465 |
target="en",
|
466 |
sources={"ro", "tr"},
|
467 |
-
url="
|
468 |
path=("dev/newsdiscussdev2015-{src}en-src.{src}.sgm", "dev/newsdiscussdev2015-{src}en-ref.en.sgm"),
|
469 |
),
|
470 |
SubDataset(
|
471 |
name="newsdev2016",
|
472 |
target="en",
|
473 |
sources={"ro", "tr"},
|
474 |
-
url="
|
475 |
path=("dev/newsdev2016-{src}en-src.{src}.sgm", "dev/newsdev2016-{src}en-ref.en.sgm"),
|
476 |
),
|
477 |
SubDataset(
|
478 |
name="newsdev2017",
|
479 |
target="en",
|
480 |
sources={"lv", "zh"},
|
481 |
-
url="
|
482 |
path=("dev/newsdev2017-{src}en-src.{src}.sgm", "dev/newsdev2017-{src}en-ref.en.sgm"),
|
483 |
),
|
484 |
SubDataset(
|
485 |
name="newsdev2018",
|
486 |
target="en",
|
487 |
sources={"et"},
|
488 |
-
url="
|
489 |
path=("dev/newsdev2018-{src}en-src.{src}.sgm", "dev/newsdev2018-{src}en-ref.en.sgm"),
|
490 |
),
|
491 |
SubDataset(
|
492 |
name="newsdev2019",
|
493 |
target="en",
|
494 |
sources={"gu", "kk", "lt"},
|
495 |
-
url="
|
496 |
path=("dev/newsdev2019-{src}en-src.{src}.sgm", "dev/newsdev2019-{src}en-ref.en.sgm"),
|
497 |
),
|
498 |
SubDataset(
|
499 |
name="newsdiscussdev2015",
|
500 |
target="en",
|
501 |
sources={"fr"},
|
502 |
-
url="
|
503 |
path=("dev/newsdiscussdev2015-{src}en-src.{src}.sgm", "dev/newsdiscussdev2015-{src}en-ref.en.sgm"),
|
504 |
),
|
505 |
SubDataset(
|
506 |
name="newsdiscusstest2015",
|
507 |
target="en",
|
508 |
sources={"fr"},
|
509 |
-
url="
|
510 |
path=("dev/newsdiscusstest2015-{src}en-src.{src}.sgm", "dev/newsdiscusstest2015-{src}en-ref.en.sgm"),
|
511 |
),
|
512 |
SubDataset(
|
513 |
name="newssyscomb2009",
|
514 |
target="en",
|
515 |
sources={"cs", "de", "es", "fr"},
|
516 |
-
url="
|
517 |
path=("dev/newssyscomb2009.{src}", "dev/newssyscomb2009.en"),
|
518 |
),
|
519 |
SubDataset(
|
520 |
name="newstest2008",
|
521 |
target="en",
|
522 |
sources={"cs", "de", "es", "fr", "hu"},
|
523 |
-
url="
|
524 |
path=("dev/news-test2008.{src}", "dev/news-test2008.en"),
|
525 |
),
|
526 |
SubDataset(
|
527 |
name="newstest2009",
|
528 |
target="en",
|
529 |
sources={"cs", "de", "es", "fr"},
|
530 |
-
url="
|
531 |
path=("dev/newstest2009.{src}", "dev/newstest2009.en"),
|
532 |
),
|
533 |
SubDataset(
|
534 |
name="newstest2010",
|
535 |
target="en",
|
536 |
sources={"cs", "de", "es", "fr"},
|
537 |
-
url="
|
538 |
path=("dev/newstest2010.{src}", "dev/newstest2010.en"),
|
539 |
),
|
540 |
SubDataset(
|
541 |
name="newstest2011",
|
542 |
target="en",
|
543 |
sources={"cs", "de", "es", "fr"},
|
544 |
-
url="
|
545 |
path=("dev/newstest2011.{src}", "dev/newstest2011.en"),
|
546 |
),
|
547 |
SubDataset(
|
548 |
name="newstest2012",
|
549 |
target="en",
|
550 |
sources={"cs", "de", "es", "fr", "ru"},
|
551 |
-
url="
|
552 |
path=("dev/newstest2012.{src}", "dev/newstest2012.en"),
|
553 |
),
|
554 |
SubDataset(
|
555 |
name="newstest2013",
|
556 |
target="en",
|
557 |
sources={"cs", "de", "es", "fr", "ru"},
|
558 |
-
url="
|
559 |
path=("dev/newstest2013.{src}", "dev/newstest2013.en"),
|
560 |
),
|
561 |
SubDataset(
|
562 |
name="newstest2014",
|
563 |
target="en",
|
564 |
sources={"cs", "de", "es", "fr", "hi", "ru"},
|
565 |
-
url="
|
566 |
path=("dev/newstest2014-{src}en-src.{src}.sgm", "dev/newstest2014-{src}en-ref.en.sgm"),
|
567 |
),
|
568 |
SubDataset(
|
569 |
name="newstest2015",
|
570 |
target="en",
|
571 |
sources={"cs", "de", "fi", "ru"},
|
572 |
-
url="
|
573 |
path=("dev/newstest2015-{src}en-src.{src}.sgm", "dev/newstest2015-{src}en-ref.en.sgm"),
|
574 |
),
|
575 |
SubDataset(
|
576 |
name="newsdiscusstest2015",
|
577 |
target="en",
|
578 |
sources={"fr"},
|
579 |
-
url="
|
580 |
path=("dev/newsdiscusstest2015-{src}en-src.{src}.sgm", "dev/newsdiscusstest2015-{src}en-ref.en.sgm"),
|
581 |
),
|
582 |
SubDataset(
|
583 |
name="newstest2016",
|
584 |
target="en",
|
585 |
sources={"cs", "de", "fi", "ro", "ru", "tr"},
|
586 |
-
url="
|
587 |
path=("dev/newstest2016-{src}en-src.{src}.sgm", "dev/newstest2016-{src}en-ref.en.sgm"),
|
588 |
),
|
589 |
SubDataset(
|
590 |
name="newstestB2016",
|
591 |
target="en",
|
592 |
sources={"fi"},
|
593 |
-
url="
|
594 |
path=("dev/newstestB2016-enfi-ref.{src}.sgm", "dev/newstestB2016-enfi-src.en.sgm"),
|
595 |
),
|
596 |
SubDataset(
|
597 |
name="newstest2017",
|
598 |
target="en",
|
599 |
sources={"cs", "de", "fi", "lv", "ru", "tr", "zh"},
|
600 |
-
url="
|
601 |
path=("dev/newstest2017-{src}en-src.{src}.sgm", "dev/newstest2017-{src}en-ref.en.sgm"),
|
602 |
),
|
603 |
SubDataset(
|
604 |
name="newstestB2017",
|
605 |
target="en",
|
606 |
sources={"fi"},
|
607 |
-
url="
|
608 |
path=("dev/newstestB2017-fien-src.fi.sgm", "dev/newstestB2017-fien-ref.en.sgm"),
|
609 |
),
|
610 |
SubDataset(
|
611 |
name="newstest2018",
|
612 |
target="en",
|
613 |
sources={"cs", "de", "et", "fi", "ru", "tr", "zh"},
|
614 |
-
url="
|
615 |
path=("dev/newstest2018-{src}en-src.{src}.sgm", "dev/newstest2018-{src}en-ref.en.sgm"),
|
616 |
),
|
617 |
]
|
@@ -693,10 +695,10 @@ class Wmt(ABC, datasets.GeneratorBasedBuilder):
|
|
693 |
for ss_name in ss_names:
|
694 |
dataset = DATASET_MAP[ss_name]
|
695 |
if dataset.target != target or source not in dataset.sources:
|
696 |
-
|
697 |
else:
|
698 |
filtered_subsets[split].append(ss_name)
|
699 |
-
|
700 |
return filtered_subsets
|
701 |
|
702 |
def _info(self):
|
@@ -731,7 +733,7 @@ class Wmt(ABC, datasets.GeneratorBasedBuilder):
|
|
731 |
if dataset.get_manual_dl_files(source):
|
732 |
# TODO(PVP): following two lines skip configs that are incomplete for now
|
733 |
# +++++++++++++++++++++
|
734 |
-
|
735 |
continue
|
736 |
# +++++++++++++++++++++
|
737 |
|
@@ -786,11 +788,11 @@ class Wmt(ABC, datasets.GeneratorBasedBuilder):
|
|
786 |
dataset = DATASET_MAP[ss_name]
|
787 |
source, _ = self.config.language_pair
|
788 |
if dataset.get_manual_dl_files(source):
|
789 |
-
|
790 |
continue
|
791 |
# +++++++++++++++++++++
|
792 |
|
793 |
-
|
794 |
dataset = DATASET_MAP[ss_name]
|
795 |
extract_dirs = extraction_map[ss_name]
|
796 |
files = _get_local_paths(dataset, extract_dirs)
|
@@ -962,7 +964,7 @@ def _parse_tsv(path, language_pair=None):
|
|
962 |
for j, line in enumerate(f):
|
963 |
cols = line.split("\t")
|
964 |
if len(cols) != 2:
|
965 |
-
|
966 |
continue
|
967 |
s1, s2 = cols
|
968 |
yield j, {l1: s1.strip(), l2: s2.strip()}
|
@@ -986,7 +988,7 @@ def _parse_czeng(*paths, **kwargs):
|
|
986 |
re_block = re.compile(r"^[^-]+-b(\d+)-\d\d[tde]")
|
987 |
with open(filter_path, encoding="utf-8") as f:
|
988 |
bad_blocks = {blk for blk in re.search(r"qw{([\s\d]*)}", f.read()).groups()[0].split()}
|
989 |
-
|
990 |
|
991 |
for path in paths:
|
992 |
for gz_path in sorted(glob.glob(path)):
|
@@ -1013,6 +1015,6 @@ def _parse_hindencorp(path):
|
|
1013 |
for line_id, line in enumerate(f):
|
1014 |
split_line = line.split("\t")
|
1015 |
if len(split_line) != 5:
|
1016 |
-
|
1017 |
continue
|
1018 |
yield line_id, {"translation": {"en": split_line[3].strip(), "hi": split_line[4].strip()}}
|
|
|
23 |
import glob
|
24 |
import gzip
|
25 |
import itertools
|
|
|
26 |
import os
|
27 |
import re
|
28 |
import xml.etree.cElementTree as ElementTree
|
|
|
33 |
import datasets
|
34 |
|
35 |
|
36 |
+
logger = datasets.logging.get_logger(__name__)
|
37 |
+
|
38 |
+
|
39 |
_DESCRIPTION = """\
|
40 |
Translate dataset based on the data from statmt.org.
|
41 |
|
|
|
130 |
name="commoncrawl",
|
131 |
target="en", # fr-de pair in commoncrawl_frde
|
132 |
sources={"cs", "de", "es", "fr", "ru"},
|
133 |
+
url="https://huggingface.co/datasets/wmt/wmt13/resolve/main/training-parallel-commoncrawl.tgz",
|
134 |
path=("commoncrawl.{src}-en.{src}", "commoncrawl.{src}-en.en"),
|
135 |
),
|
136 |
SubDataset(
|
|
|
138 |
target="de",
|
139 |
sources={"fr"},
|
140 |
url=(
|
141 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/commoncrawl.fr.gz",
|
142 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/commoncrawl.de.gz",
|
143 |
),
|
144 |
path=("", ""),
|
145 |
),
|
|
|
187 |
name="dcep_v1",
|
188 |
target="en",
|
189 |
sources={"lv"},
|
190 |
+
url="https://huggingface.co/datasets/wmt/wmt17/resolve/main/translation-task/dcep.lv-en.v1.tgz",
|
191 |
path=("dcep.en-lv/dcep.lv", "dcep.en-lv/dcep.en"),
|
192 |
),
|
193 |
SubDataset(
|
194 |
name="europarl_v7",
|
195 |
target="en",
|
196 |
sources={"cs", "de", "es", "fr"},
|
197 |
+
url="https://huggingface.co/datasets/wmt/wmt13/resolve/main/training-parallel-europarl-v7.tgz",
|
198 |
path=("training/europarl-v7.{src}-en.{src}", "training/europarl-v7.{src}-en.en"),
|
199 |
),
|
200 |
SubDataset(
|
|
|
202 |
target="de",
|
203 |
sources={"fr"},
|
204 |
url=(
|
205 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/europarl-v7.fr.gz",
|
206 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/europarl-v7.de.gz",
|
207 |
),
|
208 |
path=("", ""),
|
209 |
),
|
|
|
211 |
name="europarl_v8_18",
|
212 |
target="en",
|
213 |
sources={"et", "fi"},
|
214 |
+
url="https://huggingface.co/datasets/wmt/wmt18/resolve/main/translation-task/training-parallel-ep-v8.tgz",
|
215 |
path=("training/europarl-v8.{src}-en.{src}", "training/europarl-v8.{src}-en.en"),
|
216 |
),
|
217 |
SubDataset(
|
218 |
name="europarl_v8_16",
|
219 |
target="en",
|
220 |
sources={"fi", "ro"},
|
221 |
+
url="https://huggingface.co/datasets/wmt/wmt16/resolve/main/translation-task/training-parallel-ep-v8.tgz",
|
222 |
path=("training-parallel-ep-v8/europarl-v8.{src}-en.{src}", "training-parallel-ep-v8/europarl-v8.{src}-en.en"),
|
223 |
),
|
224 |
SubDataset(
|
225 |
name="europarl_v9",
|
226 |
target="en",
|
227 |
sources={"cs", "de", "fi", "lt"},
|
228 |
+
url="https://huggingface.co/datasets/wmt/europarl/resolve/main/v9/training/europarl-v9.{src}-en.tsv.gz",
|
229 |
path="",
|
230 |
),
|
231 |
SubDataset(
|
232 |
name="gigafren",
|
233 |
target="en",
|
234 |
sources={"fr"},
|
235 |
+
url="https://huggingface.co/datasets/wmt/wmt10/resolve/main/training-giga-fren.tar",
|
236 |
path=("giga-fren.release2.fixed.fr.gz", "giga-fren.release2.fixed.en.gz"),
|
237 |
),
|
238 |
SubDataset(
|
|
|
247 |
name="leta_v1",
|
248 |
target="en",
|
249 |
sources={"lv"},
|
250 |
+
url="https://huggingface.co/datasets/wmt/wmt17/resolve/main/translation-task/leta.v1.tgz",
|
251 |
path=("LETA-lv-en/leta.lv", "LETA-lv-en/leta.en"),
|
252 |
),
|
253 |
SubDataset(
|
254 |
name="multiun",
|
255 |
target="en",
|
256 |
sources={"es", "fr"},
|
257 |
+
url="https://huggingface.co/datasets/wmt/wmt13/resolve/main/training-parallel-un.tgz",
|
258 |
path=("un/undoc.2000.{src}-en.{src}", "un/undoc.2000.{src}-en.en"),
|
259 |
),
|
260 |
SubDataset(
|
261 |
name="newscommentary_v9",
|
262 |
target="en",
|
263 |
sources={"cs", "de", "fr", "ru"},
|
264 |
+
url="https://huggingface.co/datasets/wmt/wmt14/resolve/main/training-parallel-nc-v9.tgz",
|
265 |
path=("training/news-commentary-v9.{src}-en.{src}", "training/news-commentary-v9.{src}-en.en"),
|
266 |
),
|
267 |
SubDataset(
|
268 |
name="newscommentary_v10",
|
269 |
target="en",
|
270 |
sources={"cs", "de", "fr", "ru"},
|
271 |
+
url="https://huggingface.co/datasets/wmt/wmt15/resolve/main/training-parallel-nc-v10.tgz",
|
272 |
path=("news-commentary-v10.{src}-en.{src}", "news-commentary-v10.{src}-en.en"),
|
273 |
),
|
274 |
SubDataset(
|
275 |
name="newscommentary_v11",
|
276 |
target="en",
|
277 |
sources={"cs", "de", "ru"},
|
278 |
+
url="https://huggingface.co/datasets/wmt/wmt16/resolve/main/translation-task/training-parallel-nc-v11.tgz",
|
279 |
path=(
|
280 |
"training-parallel-nc-v11/news-commentary-v11.{src}-en.{src}",
|
281 |
"training-parallel-nc-v11/news-commentary-v11.{src}-en.en",
|
|
|
285 |
name="newscommentary_v12",
|
286 |
target="en",
|
287 |
sources={"cs", "de", "ru", "zh"},
|
288 |
+
url="https://huggingface.co/datasets/wmt/wmt17/resolve/main/translation-task/training-parallel-nc-v12.tgz",
|
289 |
path=("training/news-commentary-v12.{src}-en.{src}", "training/news-commentary-v12.{src}-en.en"),
|
290 |
),
|
291 |
SubDataset(
|
292 |
name="newscommentary_v13",
|
293 |
target="en",
|
294 |
sources={"cs", "de", "ru", "zh"},
|
295 |
+
url="https://huggingface.co/datasets/wmt/wmt18/resolve/main/translation-task/training-parallel-nc-v13.tgz",
|
296 |
path=(
|
297 |
"training-parallel-nc-v13/news-commentary-v13.{src}-en.{src}",
|
298 |
"training-parallel-nc-v13/news-commentary-v13.{src}-en.en",
|
|
|
316 |
name="onlinebooks_v1",
|
317 |
target="en",
|
318 |
sources={"lv"},
|
319 |
+
url="https://huggingface.co/datasets/wmt/wmt17/resolve/main/translation-task/books.lv-en.v1.tgz",
|
320 |
path=("farewell/farewell.lv", "farewell/farewell.en"),
|
321 |
),
|
322 |
SubDataset(
|
|
|
351 |
target="de",
|
352 |
sources={"fr"},
|
353 |
url=(
|
354 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/de-fr.bicleaner07.de.gz",
|
355 |
+
"https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/fr-de/bitexts/de-fr.bicleaner07.fr.gz",
|
356 |
),
|
357 |
path=("", ""),
|
358 |
),
|
|
|
360 |
name="rapid_2016",
|
361 |
target="en",
|
362 |
sources={"de", "et", "fi"},
|
363 |
+
url="https://huggingface.co/datasets/wmt/wmt18/resolve/main/translation-task/rapid2016.tgz",
|
364 |
path=("rapid2016.{0}-{1}.{src}", "rapid2016.{0}-{1}.en"),
|
365 |
),
|
366 |
SubDataset(
|
|
|
381 |
name="setimes_2",
|
382 |
target="en",
|
383 |
sources={"ro", "tr"},
|
384 |
+
url="https://opus.nlpl.eu/download.php?f=SETIMES/v2/tmx/en-{src}.tmx.gz",
|
385 |
path="",
|
386 |
),
|
387 |
SubDataset(
|
388 |
name="uncorpus_v1",
|
389 |
target="en",
|
390 |
sources={"ru", "zh"},
|
391 |
+
url="https://huggingface.co/datasets/wmt/uncorpus/resolve/main/UNv1.0.en-{src}.tar.gz",
|
392 |
path=("en-{src}/UNv1.0.en-{src}.{src}", "en-{src}/UNv1.0.en-{src}.en"),
|
393 |
),
|
394 |
SubDataset(
|
395 |
name="wikiheadlines_fi",
|
396 |
target="en",
|
397 |
sources={"fi"},
|
398 |
+
url="https://huggingface.co/datasets/wmt/wmt15/resolve/main/wiki-titles.tgz",
|
399 |
path="wiki/fi-en/titles.fi-en",
|
400 |
),
|
401 |
SubDataset(
|
402 |
name="wikiheadlines_hi",
|
403 |
target="en",
|
404 |
sources={"hi"},
|
405 |
+
url="https://huggingface.co/datasets/wmt/wmt14/resolve/main/wiki-titles.tgz",
|
406 |
path="wiki/hi-en/wiki-titles.hi-en",
|
407 |
),
|
408 |
SubDataset(
|
|
|
410 |
name="wikiheadlines_ru",
|
411 |
target="en",
|
412 |
sources={"ru"},
|
413 |
+
url="https://huggingface.co/datasets/wmt/wmt15/resolve/main/wiki-titles.tgz",
|
414 |
path="wiki/ru-en/wiki.ru-en",
|
415 |
),
|
416 |
SubDataset(
|
417 |
name="wikititles_v1",
|
418 |
target="en",
|
419 |
sources={"cs", "de", "fi", "gu", "kk", "lt", "ru", "zh"},
|
420 |
+
url="https://huggingface.co/datasets/wmt/wikititles/resolve/main/v1/wikititles-v1.{src}-en.tsv.gz",
|
421 |
path="",
|
422 |
),
|
423 |
SubDataset(
|
|
|
445 |
name="euelections_dev2019",
|
446 |
target="de",
|
447 |
sources={"fr"},
|
448 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
449 |
path=("dev/euelections_dev2019.fr-de.src.fr", "dev/euelections_dev2019.fr-de.tgt.de"),
|
450 |
),
|
451 |
SubDataset(
|
452 |
name="newsdev2014",
|
453 |
target="en",
|
454 |
sources={"hi"},
|
455 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
456 |
path=("dev/newsdev2014.hi", "dev/newsdev2014.en"),
|
457 |
),
|
458 |
SubDataset(
|
459 |
name="newsdev2015",
|
460 |
target="en",
|
461 |
sources={"fi"},
|
462 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
463 |
path=("dev/newsdev2015-fien-src.{src}.sgm", "dev/newsdev2015-fien-ref.en.sgm"),
|
464 |
),
|
465 |
SubDataset(
|
466 |
name="newsdiscussdev2015",
|
467 |
target="en",
|
468 |
sources={"ro", "tr"},
|
469 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
470 |
path=("dev/newsdiscussdev2015-{src}en-src.{src}.sgm", "dev/newsdiscussdev2015-{src}en-ref.en.sgm"),
|
471 |
),
|
472 |
SubDataset(
|
473 |
name="newsdev2016",
|
474 |
target="en",
|
475 |
sources={"ro", "tr"},
|
476 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
477 |
path=("dev/newsdev2016-{src}en-src.{src}.sgm", "dev/newsdev2016-{src}en-ref.en.sgm"),
|
478 |
),
|
479 |
SubDataset(
|
480 |
name="newsdev2017",
|
481 |
target="en",
|
482 |
sources={"lv", "zh"},
|
483 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
484 |
path=("dev/newsdev2017-{src}en-src.{src}.sgm", "dev/newsdev2017-{src}en-ref.en.sgm"),
|
485 |
),
|
486 |
SubDataset(
|
487 |
name="newsdev2018",
|
488 |
target="en",
|
489 |
sources={"et"},
|
490 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
491 |
path=("dev/newsdev2018-{src}en-src.{src}.sgm", "dev/newsdev2018-{src}en-ref.en.sgm"),
|
492 |
),
|
493 |
SubDataset(
|
494 |
name="newsdev2019",
|
495 |
target="en",
|
496 |
sources={"gu", "kk", "lt"},
|
497 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
498 |
path=("dev/newsdev2019-{src}en-src.{src}.sgm", "dev/newsdev2019-{src}en-ref.en.sgm"),
|
499 |
),
|
500 |
SubDataset(
|
501 |
name="newsdiscussdev2015",
|
502 |
target="en",
|
503 |
sources={"fr"},
|
504 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
505 |
path=("dev/newsdiscussdev2015-{src}en-src.{src}.sgm", "dev/newsdiscussdev2015-{src}en-ref.en.sgm"),
|
506 |
),
|
507 |
SubDataset(
|
508 |
name="newsdiscusstest2015",
|
509 |
target="en",
|
510 |
sources={"fr"},
|
511 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
512 |
path=("dev/newsdiscusstest2015-{src}en-src.{src}.sgm", "dev/newsdiscusstest2015-{src}en-ref.en.sgm"),
|
513 |
),
|
514 |
SubDataset(
|
515 |
name="newssyscomb2009",
|
516 |
target="en",
|
517 |
sources={"cs", "de", "es", "fr"},
|
518 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
519 |
path=("dev/newssyscomb2009.{src}", "dev/newssyscomb2009.en"),
|
520 |
),
|
521 |
SubDataset(
|
522 |
name="newstest2008",
|
523 |
target="en",
|
524 |
sources={"cs", "de", "es", "fr", "hu"},
|
525 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
526 |
path=("dev/news-test2008.{src}", "dev/news-test2008.en"),
|
527 |
),
|
528 |
SubDataset(
|
529 |
name="newstest2009",
|
530 |
target="en",
|
531 |
sources={"cs", "de", "es", "fr"},
|
532 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
533 |
path=("dev/newstest2009.{src}", "dev/newstest2009.en"),
|
534 |
),
|
535 |
SubDataset(
|
536 |
name="newstest2010",
|
537 |
target="en",
|
538 |
sources={"cs", "de", "es", "fr"},
|
539 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
540 |
path=("dev/newstest2010.{src}", "dev/newstest2010.en"),
|
541 |
),
|
542 |
SubDataset(
|
543 |
name="newstest2011",
|
544 |
target="en",
|
545 |
sources={"cs", "de", "es", "fr"},
|
546 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
547 |
path=("dev/newstest2011.{src}", "dev/newstest2011.en"),
|
548 |
),
|
549 |
SubDataset(
|
550 |
name="newstest2012",
|
551 |
target="en",
|
552 |
sources={"cs", "de", "es", "fr", "ru"},
|
553 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
554 |
path=("dev/newstest2012.{src}", "dev/newstest2012.en"),
|
555 |
),
|
556 |
SubDataset(
|
557 |
name="newstest2013",
|
558 |
target="en",
|
559 |
sources={"cs", "de", "es", "fr", "ru"},
|
560 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
561 |
path=("dev/newstest2013.{src}", "dev/newstest2013.en"),
|
562 |
),
|
563 |
SubDataset(
|
564 |
name="newstest2014",
|
565 |
target="en",
|
566 |
sources={"cs", "de", "es", "fr", "hi", "ru"},
|
567 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
568 |
path=("dev/newstest2014-{src}en-src.{src}.sgm", "dev/newstest2014-{src}en-ref.en.sgm"),
|
569 |
),
|
570 |
SubDataset(
|
571 |
name="newstest2015",
|
572 |
target="en",
|
573 |
sources={"cs", "de", "fi", "ru"},
|
574 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
575 |
path=("dev/newstest2015-{src}en-src.{src}.sgm", "dev/newstest2015-{src}en-ref.en.sgm"),
|
576 |
),
|
577 |
SubDataset(
|
578 |
name="newsdiscusstest2015",
|
579 |
target="en",
|
580 |
sources={"fr"},
|
581 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
582 |
path=("dev/newsdiscusstest2015-{src}en-src.{src}.sgm", "dev/newsdiscusstest2015-{src}en-ref.en.sgm"),
|
583 |
),
|
584 |
SubDataset(
|
585 |
name="newstest2016",
|
586 |
target="en",
|
587 |
sources={"cs", "de", "fi", "ro", "ru", "tr"},
|
588 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
589 |
path=("dev/newstest2016-{src}en-src.{src}.sgm", "dev/newstest2016-{src}en-ref.en.sgm"),
|
590 |
),
|
591 |
SubDataset(
|
592 |
name="newstestB2016",
|
593 |
target="en",
|
594 |
sources={"fi"},
|
595 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
596 |
path=("dev/newstestB2016-enfi-ref.{src}.sgm", "dev/newstestB2016-enfi-src.en.sgm"),
|
597 |
),
|
598 |
SubDataset(
|
599 |
name="newstest2017",
|
600 |
target="en",
|
601 |
sources={"cs", "de", "fi", "lv", "ru", "tr", "zh"},
|
602 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
603 |
path=("dev/newstest2017-{src}en-src.{src}.sgm", "dev/newstest2017-{src}en-ref.en.sgm"),
|
604 |
),
|
605 |
SubDataset(
|
606 |
name="newstestB2017",
|
607 |
target="en",
|
608 |
sources={"fi"},
|
609 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
610 |
path=("dev/newstestB2017-fien-src.fi.sgm", "dev/newstestB2017-fien-ref.en.sgm"),
|
611 |
),
|
612 |
SubDataset(
|
613 |
name="newstest2018",
|
614 |
target="en",
|
615 |
sources={"cs", "de", "et", "fi", "ru", "tr", "zh"},
|
616 |
+
url="https://huggingface.co/datasets/wmt/wmt19/resolve/main/translation-task/dev.tgz",
|
617 |
path=("dev/newstest2018-{src}en-src.{src}.sgm", "dev/newstest2018-{src}en-ref.en.sgm"),
|
618 |
),
|
619 |
]
|
|
|
695 |
for ss_name in ss_names:
|
696 |
dataset = DATASET_MAP[ss_name]
|
697 |
if dataset.target != target or source not in dataset.sources:
|
698 |
+
logger.info("Skipping sub-dataset that does not include language pair: %s", ss_name)
|
699 |
else:
|
700 |
filtered_subsets[split].append(ss_name)
|
701 |
+
logger.info("Using sub-datasets: %s", filtered_subsets)
|
702 |
return filtered_subsets
|
703 |
|
704 |
def _info(self):
|
|
|
733 |
if dataset.get_manual_dl_files(source):
|
734 |
# TODO(PVP): following two lines skip configs that are incomplete for now
|
735 |
# +++++++++++++++++++++
|
736 |
+
logger.info("Skipping {} for now. Incomplete dataset for {}".format(dataset.name, self.config.name))
|
737 |
continue
|
738 |
# +++++++++++++++++++++
|
739 |
|
|
|
788 |
dataset = DATASET_MAP[ss_name]
|
789 |
source, _ = self.config.language_pair
|
790 |
if dataset.get_manual_dl_files(source):
|
791 |
+
logger.info("Skipping {} for now. Incomplete dataset for {}".format(dataset.name, self.config.name))
|
792 |
continue
|
793 |
# +++++++++++++++++++++
|
794 |
|
795 |
+
logger.info("Generating examples from: %s", ss_name)
|
796 |
dataset = DATASET_MAP[ss_name]
|
797 |
extract_dirs = extraction_map[ss_name]
|
798 |
files = _get_local_paths(dataset, extract_dirs)
|
|
|
964 |
for j, line in enumerate(f):
|
965 |
cols = line.split("\t")
|
966 |
if len(cols) != 2:
|
967 |
+
logger.warning("Skipping line %d in TSV (%s) with %d != 2 columns.", j, path, len(cols))
|
968 |
continue
|
969 |
s1, s2 = cols
|
970 |
yield j, {l1: s1.strip(), l2: s2.strip()}
|
|
|
988 |
re_block = re.compile(r"^[^-]+-b(\d+)-\d\d[tde]")
|
989 |
with open(filter_path, encoding="utf-8") as f:
|
990 |
bad_blocks = {blk for blk in re.search(r"qw{([\s\d]*)}", f.read()).groups()[0].split()}
|
991 |
+
logger.info("Loaded %d bad blocks to filter from CzEng v1.6 to make v1.7.", len(bad_blocks))
|
992 |
|
993 |
for path in paths:
|
994 |
for gz_path in sorted(glob.glob(path)):
|
|
|
1015 |
for line_id, line in enumerate(f):
|
1016 |
split_line = line.split("\t")
|
1017 |
if len(split_line) != 5:
|
1018 |
+
logger.warning("Skipping invalid HindEnCorp line: %s", line)
|
1019 |
continue
|
1020 |
yield line_id, {"translation": {"en": split_line[3].strip(), "hi": split_line[4].strip()}}
|