Datasets:
Delete loading script
Browse files
wmt14.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
| 3 |
-
#
|
| 4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
-
# you may not use this file except in compliance with the License.
|
| 6 |
-
# You may obtain a copy of the License at
|
| 7 |
-
#
|
| 8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
-
#
|
| 10 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
-
# See the License for the specific language governing permissions and
|
| 14 |
-
# limitations under the License.
|
| 15 |
-
|
| 16 |
-
# Lint as: python3
|
| 17 |
-
"""WMT14: Translate dataset."""
|
| 18 |
-
|
| 19 |
-
import datasets
|
| 20 |
-
|
| 21 |
-
from .wmt_utils import Wmt, WmtConfig
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
_URL = "http://www.statmt.org/wmt14/translation-task.html"
|
| 25 |
-
_CITATION = """
|
| 26 |
-
@InProceedings{bojar-EtAl:2014:W14-33,
|
| 27 |
-
author = {Bojar, Ondrej and Buck, Christian and Federmann, Christian and Haddow, Barry and Koehn, Philipp and Leveling, Johannes and Monz, Christof and Pecina, Pavel and Post, Matt and Saint-Amand, Herve and Soricut, Radu and Specia, Lucia and Tamchyna, Ale\v{s}},
|
| 28 |
-
title = {Findings of the 2014 Workshop on Statistical Machine Translation},
|
| 29 |
-
booktitle = {Proceedings of the Ninth Workshop on Statistical Machine Translation},
|
| 30 |
-
month = {June},
|
| 31 |
-
year = {2014},
|
| 32 |
-
address = {Baltimore, Maryland, USA},
|
| 33 |
-
publisher = {Association for Computational Linguistics},
|
| 34 |
-
pages = {12--58},
|
| 35 |
-
url = {http://www.aclweb.org/anthology/W/W14/W14-3302}
|
| 36 |
-
}
|
| 37 |
-
"""
|
| 38 |
-
|
| 39 |
-
_LANGUAGE_PAIRS = [(lang, "en") for lang in ["cs", "de", "fr", "hi", "ru"]]
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
class Wmt14(Wmt):
|
| 43 |
-
"""WMT 14 translation datasets for all {xx, "en"} language pairs."""
|
| 44 |
-
|
| 45 |
-
# Version history:
|
| 46 |
-
# 1.0.0: S3 (new shuffling, sharding and slicing mechanism).
|
| 47 |
-
BUILDER_CONFIGS = [
|
| 48 |
-
WmtConfig( # pylint:disable=g-complex-comprehension
|
| 49 |
-
description="WMT 2014 %s-%s translation task dataset." % (l1, l2),
|
| 50 |
-
url=_URL,
|
| 51 |
-
citation=_CITATION,
|
| 52 |
-
language_pair=(l1, l2),
|
| 53 |
-
version=datasets.Version("1.0.0"),
|
| 54 |
-
)
|
| 55 |
-
for l1, l2 in _LANGUAGE_PAIRS
|
| 56 |
-
]
|
| 57 |
-
|
| 58 |
-
@property
|
| 59 |
-
def manual_download_instructions(self):
|
| 60 |
-
if self.config.language_pair[1] in ["cs", "hi", "ru"]:
|
| 61 |
-
return "Please download the data manually as explained. TODO(PVP)"
|
| 62 |
-
return None
|
| 63 |
-
|
| 64 |
-
@property
|
| 65 |
-
def _subsets(self):
|
| 66 |
-
return {
|
| 67 |
-
datasets.Split.TRAIN: [
|
| 68 |
-
"europarl_v7",
|
| 69 |
-
"commoncrawl",
|
| 70 |
-
"multiun",
|
| 71 |
-
"newscommentary_v9",
|
| 72 |
-
"gigafren",
|
| 73 |
-
"czeng_10",
|
| 74 |
-
"yandexcorpus",
|
| 75 |
-
"wikiheadlines_hi",
|
| 76 |
-
"wikiheadlines_ru",
|
| 77 |
-
"hindencorp_01",
|
| 78 |
-
],
|
| 79 |
-
datasets.Split.VALIDATION: ["newsdev2014", "newstest2013"],
|
| 80 |
-
datasets.Split.TEST: ["newstest2014"],
|
| 81 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|