system HF staff commited on
Commit
bb7c4b5
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"plain_text": {"description": "Massively multilingual (60 language) data set derived from TED Talk transcripts.\nEach record consists of parallel arrays of language and text. Missing and\nincomplete translations will be filtered out.\n", "citation": "@InProceedings{qi-EtAl:2018:N18-2,\n author = {Qi, Ye and Sachan, Devendra and Felix, Matthieu and Padmanabhan, Sarguna and Neubig, Graham},\n title = {When and Why Are Pre-Trained Word Embeddings Useful for Neural Machine Translation?},\n booktitle = {Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)},\n month = {June},\n year = {2018},\n address = {New Orleans, Louisiana},\n publisher = {Association for Computational Linguistics},\n pages = {529--535},\n abstract = {The performance of Neural Machine Translation (NMT) systems often suffers in low-resource scenarios where sufficiently large-scale parallel corpora cannot be obtained. Pre-trained word embeddings have proven to be invaluable for improving performance in natural language analysis tasks, which often suffer from paucity of data. However, their utility for NMT has not been extensively explored. In this work, we perform five sets of experiments that analyze when we can expect pre-trained word embeddings to help in NMT tasks. We show that such embeddings can be surprisingly effective in some cases -- providing gains of up to 20 BLEU points in the most favorable setting.},\n url = {http://www.aclweb.org/anthology/N18-2084}\n}\n", "homepage": "https://github.com/neulab/word-embeddings-for-nmt", "license": "", "features": {"translations": {"languages": ["ar", "az", "be", "bg", "bn", "bs", "calv", "cs", "da", "de", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fr", "fr-ca", "gl", "he", "hi", "hr", "hu", "hy", "id", "it", "ja", "ka", "kk", "ko", "ku", "lt", "mk", "mn", "mr", "ms", "my", "nb", "nl", "pl", "pt", "pt-br", "ro", "ru", "sk", "sl", "sq", "sr", "sv", "ta", "th", "tr", "uk", "ur", "vi", "zh", "zh-cn", "zh-tw"], "num_languages": 60, "id": null, "_type": "TranslationVariableLanguages"}, "talk_name": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "ted_multi_translate", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 23364983, "num_examples": 7213, "dataset_name": "ted_multi_translate"}, "train": {"name": "train", "num_bytes": 748209995, "num_examples": 258098, "dataset_name": "ted_multi_translate"}, "validation": {"name": "validation", "num_bytes": 19435383, "num_examples": 6049, "dataset_name": "ted_multi_translate"}}, "download_checksums": {"http://phontron.com/data/ted_talks.tar.gz": {"num_bytes": 352222045, "checksum": "03457b9ebc6d60839f1a48c5a03c940266aff78b81fcda4c6d9e2a5a7fb670ae"}}, "download_size": 352222045, "dataset_size": 791010361, "size_in_bytes": 1143232406}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4db77ea7f9e9e777cf213a61e8a4c4075f8c88552274d661b5d791e6cdfba435
3
+ size 34964
dummy/plain_text/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4db77ea7f9e9e777cf213a61e8a4c4075f8c88552274d661b5d791e6cdfba435
3
+ size 34964
ted_multi.py ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """TED talk multilingual data set."""
18
+ from __future__ import absolute_import, division, print_function
19
+
20
+ import csv
21
+ import os
22
+
23
+ import six
24
+
25
+ import datasets
26
+
27
+
28
+ _DESCRIPTION = """\
29
+ Massively multilingual (60 language) data set derived from TED Talk transcripts.
30
+ Each record consists of parallel arrays of language and text. Missing and
31
+ incomplete translations will be filtered out.
32
+ """
33
+
34
+ _CITATION = """\
35
+ @InProceedings{qi-EtAl:2018:N18-2,
36
+ author = {Qi, Ye and Sachan, Devendra and Felix, Matthieu and Padmanabhan, Sarguna and Neubig, Graham},
37
+ title = {When and Why Are Pre-Trained Word Embeddings Useful for Neural Machine Translation?},
38
+ booktitle = {Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)},
39
+ month = {June},
40
+ year = {2018},
41
+ address = {New Orleans, Louisiana},
42
+ publisher = {Association for Computational Linguistics},
43
+ pages = {529--535},
44
+ abstract = {The performance of Neural Machine Translation (NMT) systems often suffers in low-resource scenarios where sufficiently large-scale parallel corpora cannot be obtained. Pre-trained word embeddings have proven to be invaluable for improving performance in natural language analysis tasks, which often suffer from paucity of data. However, their utility for NMT has not been extensively explored. In this work, we perform five sets of experiments that analyze when we can expect pre-trained word embeddings to help in NMT tasks. We show that such embeddings can be surprisingly effective in some cases -- providing gains of up to 20 BLEU points in the most favorable setting.},
45
+ url = {http://www.aclweb.org/anthology/N18-2084}
46
+ }
47
+ """
48
+
49
+ _DATA_URL = "http://phontron.com/data/ted_talks.tar.gz"
50
+
51
+ _LANGUAGES = (
52
+ "en",
53
+ "es",
54
+ "pt-br",
55
+ "fr",
56
+ "ru",
57
+ "he",
58
+ "ar",
59
+ "ko",
60
+ "zh-cn",
61
+ "it",
62
+ "ja",
63
+ "zh-tw",
64
+ "nl",
65
+ "ro",
66
+ "tr",
67
+ "de",
68
+ "vi",
69
+ "pl",
70
+ "pt",
71
+ "bg",
72
+ "el",
73
+ "fa",
74
+ "sr",
75
+ "hu",
76
+ "hr",
77
+ "uk",
78
+ "cs",
79
+ "id",
80
+ "th",
81
+ "sv",
82
+ "sk",
83
+ "sq",
84
+ "lt",
85
+ "da",
86
+ "calv",
87
+ "my",
88
+ "sl",
89
+ "mk",
90
+ "fr-ca",
91
+ "fi",
92
+ "hy",
93
+ "hi",
94
+ "nb",
95
+ "ka",
96
+ "mn",
97
+ "et",
98
+ "ku",
99
+ "gl",
100
+ "mr",
101
+ "zh",
102
+ "ur",
103
+ "eo",
104
+ "ms",
105
+ "az",
106
+ "ta",
107
+ "bn",
108
+ "kk",
109
+ "be",
110
+ "eu",
111
+ "bs",
112
+ )
113
+
114
+
115
+ class TedMultiTranslate(datasets.GeneratorBasedBuilder):
116
+ """TED talk multilingual data set."""
117
+
118
+ BUILDER_CONFIGS = [
119
+ datasets.BuilderConfig(
120
+ name="plain_text",
121
+ version=datasets.Version("1.0.0", ""),
122
+ description="Plain text import of multilingual TED talk translations",
123
+ )
124
+ ]
125
+
126
+ def _info(self):
127
+ return datasets.DatasetInfo(
128
+ description=_DESCRIPTION,
129
+ features=datasets.Features(
130
+ {
131
+ "translations": datasets.features.TranslationVariableLanguages(languages=_LANGUAGES),
132
+ "talk_name": datasets.Value("string"),
133
+ }
134
+ ),
135
+ homepage="https://github.com/neulab/word-embeddings-for-nmt",
136
+ citation=_CITATION,
137
+ )
138
+
139
+ def _split_generators(self, dl_manager):
140
+ dl_dir = dl_manager.download_and_extract(_DATA_URL)
141
+
142
+ return [
143
+ datasets.SplitGenerator(
144
+ name=datasets.Split.TRAIN, gen_kwargs={"data_file": os.path.join(dl_dir, "all_talks_train.tsv")}
145
+ ),
146
+ datasets.SplitGenerator(
147
+ name=datasets.Split.VALIDATION, gen_kwargs={"data_file": os.path.join(dl_dir, "all_talks_dev.tsv")}
148
+ ),
149
+ datasets.SplitGenerator(
150
+ name=datasets.Split.TEST, gen_kwargs={"data_file": os.path.join(dl_dir, "all_talks_test.tsv")}
151
+ ),
152
+ ]
153
+
154
+ def _generate_examples(self, data_file):
155
+ """This function returns the examples in the raw (text) form."""
156
+ with open(data_file, encoding="utf-8") as f:
157
+ reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
158
+ for idx, row in enumerate(reader):
159
+ # Everything in the row except for 'talk_name' will be a translation.
160
+ # Missing/incomplete translations will contain the string "__NULL__" or
161
+ # "_ _ NULL _ _".
162
+ yield idx, {
163
+ "translations": {
164
+ lang: text
165
+ for lang, text in six.iteritems(row)
166
+ if lang != "talk_name" and _is_translation_complete(text)
167
+ },
168
+ "talk_name": row["talk_name"],
169
+ }
170
+
171
+
172
+ def _is_translation_complete(text):
173
+ return text and "__NULL__" not in text and "_ _ NULL _ _" not in text