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

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.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
README.md ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ - hr
9
+ licenses:
10
+ - unknown
11
+ multilinguality:
12
+ - multilingual
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - conditional-text-generation
19
+ task_ids:
20
+ - machine-translation
21
+ ---
22
+
23
+ # Dataset Card Creation Guide
24
+
25
+ ## Table of Contents
26
+ - [Dataset Description](#dataset-description)
27
+ - [Dataset Summary](#dataset-summary)
28
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
29
+ - [Languages](#languages)
30
+ - [Dataset Structure](#dataset-structure)
31
+ - [Data Instances](#data-instances)
32
+ - [Data Fields](#data-instances)
33
+ - [Data Splits](#data-instances)
34
+ - [Dataset Creation](#dataset-creation)
35
+ - [Curation Rationale](#curation-rationale)
36
+ - [Source Data](#source-data)
37
+ - [Annotations](#annotations)
38
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
39
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
40
+ - [Social Impact of Dataset](#social-impact-of-dataset)
41
+ - [Discussion of Biases](#discussion-of-biases)
42
+ - [Other Known Limitations](#other-known-limitations)
43
+ - [Additional Information](#additional-information)
44
+ - [Dataset Curators](#dataset-curators)
45
+ - [Licensing Information](#licensing-information)
46
+ - [Citation Information](#citation-information)
47
+
48
+ ## Dataset Description
49
+
50
+ - **Homepage:** http://opus.nlpl.eu/TedTalks.php
51
+ - **Repository:** None
52
+ - **Paper:** http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf
53
+ - **Leaderboard:** [More Information Needed]
54
+ - **Point of Contact:** [More Information Needed]
55
+
56
+ ### Dataset Summary
57
+
58
+ This is a Croatian-English parallel corpus of transcribed and translated TED talks, originally extracted from https://wit3.fbk.eu. The corpus is compiled by Željko Agić and is taken from http://lt.ffzg.hr/zagic provided under the CC-BY-NC-SA license. This corpus is sentence aligned for both language pairs. The documents were collected and aligned using the Hunalign algorithm.
59
+
60
+
61
+ ### Supported Tasks and Leaderboards
62
+
63
+ [More Information Needed]
64
+
65
+ ### Languages
66
+
67
+ [More Information Needed]
68
+
69
+ ## Dataset Structure
70
+
71
+ ### Data Instances
72
+
73
+ [More Information Needed]
74
+
75
+ ### Data Fields
76
+
77
+ [More Information Needed]
78
+
79
+ ### Data Splits
80
+
81
+ [More Information Needed]
82
+
83
+ ## Dataset Creation
84
+
85
+ ### Curation Rationale
86
+
87
+ [More Information Needed]
88
+
89
+ ### Source Data
90
+
91
+ [More Information Needed]
92
+
93
+ #### Initial Data Collection and Normalization
94
+
95
+ [More Information Needed]
96
+
97
+ #### Who are the source language producers?
98
+
99
+ [More Information Needed]
100
+
101
+ ### Annotations
102
+
103
+ [More Information Needed]
104
+
105
+ #### Annotation process
106
+
107
+ [More Information Needed]
108
+
109
+ #### Who are the annotators?
110
+
111
+ [More Information Needed]
112
+
113
+ ### Personal and Sensitive Information
114
+
115
+ [More Information Needed]
116
+
117
+ ## Considerations for Using the Data
118
+
119
+ ### Social Impact of Dataset
120
+
121
+ [More Information Needed]
122
+
123
+ ### Discussion of Biases
124
+
125
+ [More Information Needed]
126
+
127
+ ### Other Known Limitations
128
+
129
+ [More Information Needed]
130
+
131
+ ## Additional Information
132
+
133
+ ### Dataset Curators
134
+
135
+ [More Information Needed]
136
+
137
+ ### Licensing Information
138
+
139
+ [CC-BY-NC-SA license]<http://creativecommons.org/licenses/by-sa/3.0/>
140
+
141
+ ### Citation Information
142
+
143
+ @InProceedings{TIEDEMANN12.463,
144
+ author = {J{\"o}rg Tiedemann},
145
+ title = {Parallel Data, Tools and Interfaces in OPUS},
146
+ booktitle = {Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)},
147
+ year = {2012},
148
+ month = {may},
149
+ date = {23-25},
150
+ address = {Istanbul, Turkey},
151
+ editor = {Nicoletta Calzolari (Conference Chair) and Khalid Choukri and Thierry Declerck and Mehmet Ugur Dogan and Bente Maegaard and Joseph Mariani and Jan Odijk and Stelios Piperidis},
152
+ publisher = {European Language Resources Association (ELRA)},
153
+ isbn = {978-2-9517408-7-7},
154
+ language = {english}
155
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"en-hr": {"description": "This is a Croatian-English parallel corpus of transcribed and translated TED talks, originally extracted from https://wit3.fbk.eu. The corpus is compiled by \u017deljko Agi\u0107 and is taken from http://lt.ffzg.hr/zagic provided under the CC-BY-NC-SA license.\n2 languages, total number of files: 2\ntotal number of tokens: 2.81M\ntotal number of sentence fragments: 0.17M\n", "citation": "@InProceedings{TIEDEMANN12.463,\n author = {J\ufffdrg Tiedemann},\n title = {Parallel Data, Tools and Interfaces in OPUS},\n booktitle = {Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)},\n year = {2012},\n month = {may},\n date = {23-25},\n address = {Istanbul, Turkey},\n editor = {Nicoletta Calzolari (Conference Chair) and Khalid Choukri and Thierry Declerck and Mehmet Ugur Dogan and Bente Maegaard and Joseph Mariani and Jan Odijk and Stelios Piperidis},\n publisher = {European Language Resources Association (ELRA)},\n isbn = {978-2-9517408-7-7},\n language = {english}\n }\n", "homepage": "http://opus.nlpl.eu/TedTalks.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en", "hr"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "opus_tedtalks", "config_name": "en-hr", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 15249417, "num_examples": 86348, "dataset_name": "opus_tedtalks"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-TedTalks/v1/moses/en-hr.txt.zip": {"num_bytes": 5639306, "checksum": "25f0162632fbd7dcad896b559c82cb12e1d682534213cf78c6d8318145406706"}}, "download_size": 5639306, "post_processing_size": null, "dataset_size": 15249417, "size_in_bytes": 20888723}}
dummy/en-hr/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99122067f3420322a3323ad6c4f63402f7e6bfacb30e99d4ba4b115a7cf2fa75
3
+ size 1443
opus_tedtalks.py ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 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
+ import os
18
+
19
+ import datasets
20
+
21
+
22
+ _DESCRIPTION = """\
23
+ This is a Croatian-English parallel corpus of transcribed and translated TED talks, originally extracted from https://wit3.fbk.eu. The corpus is compiled by Željko Agić and is taken from http://lt.ffzg.hr/zagic provided under the CC-BY-NC-SA license.
24
+ 2 languages, total number of files: 2
25
+ total number of tokens: 2.81M
26
+ total number of sentence fragments: 0.17M
27
+ """
28
+ _HOMEPAGE_URL = "http://opus.nlpl.eu/TedTalks.php"
29
+ _CITATION = """\
30
+ @InProceedings{TIEDEMANN12.463,
31
+ author = {J{\"o}rg Tiedemann},
32
+ title = {Parallel Data, Tools and Interfaces in OPUS},
33
+ booktitle = {Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)},
34
+ year = {2012},
35
+ month = {may},
36
+ date = {23-25},
37
+ address = {Istanbul, Turkey},
38
+ editor = {Nicoletta Calzolari (Conference Chair) and Khalid Choukri and Thierry Declerck and Mehmet Ugur Dogan and Bente Maegaard and Joseph Mariani and Jan Odijk and Stelios Piperidis},
39
+ publisher = {European Language Resources Association (ELRA)},
40
+ isbn = {978-2-9517408-7-7},
41
+ language = {english}
42
+ }
43
+ """
44
+
45
+ _VERSION = "1.0.0"
46
+ _BASE_NAME = "TedTalks.{}.{}"
47
+ _BASE_URL = "https://object.pouta.csc.fi/OPUS-TedTalks/v1/moses/{}-{}.txt.zip"
48
+ _LANGUAGE_PAIRS = [
49
+ ("en", "hr"),
50
+ ]
51
+
52
+
53
+ class TedTalksConfig(datasets.BuilderConfig):
54
+ def __init__(self, *args, lang1=None, lang2=None, **kwargs):
55
+ super().__init__(
56
+ *args,
57
+ name=f"{lang1}-{lang2}",
58
+ **kwargs,
59
+ )
60
+ self.lang1 = lang1
61
+ self.lang2 = lang2
62
+
63
+
64
+ class OpusTedtalks(datasets.GeneratorBasedBuilder):
65
+ BUILDER_CONFIGS = [
66
+ TedTalksConfig(
67
+ lang1=lang1,
68
+ lang2=lang2,
69
+ description=f"Translating {lang1} to {lang2} or vice versa",
70
+ version=datasets.Version(_VERSION),
71
+ )
72
+ for lang1, lang2 in _LANGUAGE_PAIRS
73
+ ]
74
+ BUILDER_CONFIG_CLASS = TedTalksConfig
75
+
76
+ def _info(self):
77
+ return datasets.DatasetInfo(
78
+ description=_DESCRIPTION,
79
+ features=datasets.Features(
80
+ {
81
+ "id": datasets.Value("string"),
82
+ "translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
83
+ },
84
+ ),
85
+ supervised_keys=None,
86
+ homepage=_HOMEPAGE_URL,
87
+ citation=_CITATION,
88
+ )
89
+
90
+ def _split_generators(self, dl_manager):
91
+ def _base_url(lang1, lang2):
92
+ return _BASE_URL.format(lang1, lang2)
93
+
94
+ download_url = _base_url(self.config.lang1, self.config.lang2)
95
+ path = dl_manager.download_and_extract(download_url)
96
+ return [
97
+ datasets.SplitGenerator(
98
+ name=datasets.Split.TRAIN,
99
+ gen_kwargs={"datapath": path},
100
+ )
101
+ ]
102
+
103
+ def _generate_examples(self, datapath):
104
+ l1, l2 = self.config.lang1, self.config.lang2
105
+ folder = l1 + "-" + l2
106
+ l1_file = _BASE_NAME.format(folder, l1)
107
+ l2_file = _BASE_NAME.format(folder, l2)
108
+ l1_path = os.path.join(datapath, l1_file)
109
+ l2_path = os.path.join(datapath, l2_file)
110
+ with open(l1_path, encoding="utf-8") as f1, open(l2_path, encoding="utf-8") as f2:
111
+ for sentence_counter, (x, y) in enumerate(zip(f1, f2)):
112
+ x = x.strip()
113
+ y = y.strip()
114
+ result = (
115
+ sentence_counter,
116
+ {
117
+ "id": str(sentence_counter),
118
+ "translation": {l1: x, l2: y},
119
+ },
120
+ )
121
+ yield result