Datasets:

Modalities:
Text
Formats:
parquet
Libraries:
Datasets
pandas
License:

Convert dataset to Parquet

#2
by albertvillanova HF staff - opened
README.md CHANGED
@@ -42,8 +42,18 @@ source_datasets:
42
  task_categories:
43
  - translation
44
  task_ids: []
45
- paperswithcode_id: null
46
  pretty_name: OpusDgt
 
 
 
 
 
 
 
 
 
 
 
47
  dataset_info:
48
  - config_name: bg-ga
49
  features:
@@ -57,10 +67,10 @@ dataset_info:
57
  - ga
58
  splits:
59
  - name: train
60
- num_bytes: 82972428
61
  num_examples: 179142
62
- download_size: 15935979
63
- dataset_size: 82972428
64
  - config_name: bg-hr
65
  features:
66
  - name: id
@@ -73,10 +83,10 @@ dataset_info:
73
  - hr
74
  splits:
75
  - name: train
76
- num_bytes: 239828651
77
  num_examples: 701572
78
- download_size: 46804111
79
- dataset_size: 239828651
80
  - config_name: bg-sh
81
  features:
82
  - name: id
@@ -89,10 +99,26 @@ dataset_info:
89
  - sh
90
  splits:
91
  - name: train
92
- num_bytes: 498884905
93
  num_examples: 1488507
94
- download_size: 97402723
95
- dataset_size: 498884905
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  - config_name: fi-ga
97
  features:
98
  - name: id
@@ -105,11 +131,11 @@ dataset_info:
105
  - ga
106
  splits:
107
  - name: train
108
- num_bytes: 61313136
109
  num_examples: 178619
110
- download_size: 14385114
111
- dataset_size: 61313136
112
- - config_name: es-ga
113
  features:
114
  - name: id
115
  dtype: string
@@ -117,14 +143,14 @@ dataset_info:
117
  dtype:
118
  translation:
119
  languages:
120
- - es
121
  - ga
 
122
  splits:
123
  - name: train
124
- num_bytes: 63115666
125
- num_examples: 178696
126
- download_size: 14447359
127
- dataset_size: 63115666
128
  - config_name: ga-sh
129
  features:
130
  - name: id
@@ -137,10 +163,10 @@ dataset_info:
137
  - sh
138
  splits:
139
  - name: train
140
- num_bytes: 28666585
141
  num_examples: 91613
142
- download_size: 6963357
143
- dataset_size: 28666585
144
  - config_name: hr-sk
145
  features:
146
  - name: id
@@ -153,26 +179,10 @@ dataset_info:
153
  - sk
154
  splits:
155
  - name: train
156
- num_bytes: 170718371
157
  num_examples: 689263
158
- download_size: 42579941
159
- dataset_size: 170718371
160
- - config_name: mt-sh
161
- features:
162
- - name: id
163
- dtype: string
164
- - name: translation
165
- dtype:
166
- translation:
167
- languages:
168
- - mt
169
- - sh
170
- splits:
171
- - name: train
172
- num_bytes: 368562443
173
- num_examples: 1450424
174
- download_size: 88598048
175
- dataset_size: 368562443
176
  - config_name: hr-sv
177
  features:
178
  - name: id
@@ -185,11 +195,11 @@ dataset_info:
185
  - sv
186
  splits:
187
  - name: train
188
- num_bytes: 171858392
189
  num_examples: 696334
190
- download_size: 41410203
191
- dataset_size: 171858392
192
- - config_name: ga-nl
193
  features:
194
  - name: id
195
  dtype: string
@@ -197,25 +207,55 @@ dataset_info:
197
  dtype:
198
  translation:
199
  languages:
200
- - ga
201
- - nl
202
  splits:
203
  - name: train
204
- num_bytes: 59065574
205
- num_examples: 170644
206
- download_size: 13730934
207
- dataset_size: 59065574
208
- config_names:
209
- - bg-ga
210
- - bg-hr
211
- - bg-sh
212
- - es-ga
213
- - fi-ga
214
- - ga-nl
215
- - ga-sh
216
- - hr-sk
217
- - hr-sv
218
- - mt-sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  ---
220
 
221
  # Dataset Card for OpusDgt
 
42
  task_categories:
43
  - translation
44
  task_ids: []
 
45
  pretty_name: OpusDgt
46
+ config_names:
47
+ - bg-ga
48
+ - bg-hr
49
+ - bg-sh
50
+ - es-ga
51
+ - fi-ga
52
+ - ga-nl
53
+ - ga-sh
54
+ - hr-sk
55
+ - hr-sv
56
+ - mt-sh
57
  dataset_info:
58
  - config_name: bg-ga
59
  features:
 
67
  - ga
68
  splits:
69
  - name: train
70
+ num_bytes: 82972212
71
  num_examples: 179142
72
+ download_size: 32909143
73
+ dataset_size: 82972212
74
  - config_name: bg-hr
75
  features:
76
  - name: id
 
83
  - hr
84
  splits:
85
  - name: train
86
+ num_bytes: 239827799
87
  num_examples: 701572
88
+ download_size: 95163332
89
+ dataset_size: 239827799
90
  - config_name: bg-sh
91
  features:
92
  - name: id
 
99
  - sh
100
  splits:
101
  - name: train
102
+ num_bytes: 498883117
103
  num_examples: 1488507
104
+ download_size: 197907658
105
+ dataset_size: 498883117
106
+ - config_name: es-ga
107
+ features:
108
+ - name: id
109
+ dtype: string
110
+ - name: translation
111
+ dtype:
112
+ translation:
113
+ languages:
114
+ - es
115
+ - ga
116
+ splits:
117
+ - name: train
118
+ num_bytes: 63115450
119
+ num_examples: 178696
120
+ download_size: 27625395
121
+ dataset_size: 63115450
122
  - config_name: fi-ga
123
  features:
124
  - name: id
 
131
  - ga
132
  splits:
133
  - name: train
134
+ num_bytes: 61312920
135
  num_examples: 178619
136
+ download_size: 27498616
137
+ dataset_size: 61312920
138
+ - config_name: ga-nl
139
  features:
140
  - name: id
141
  dtype: string
 
143
  dtype:
144
  translation:
145
  languages:
 
146
  - ga
147
+ - nl
148
  splits:
149
  - name: train
150
+ num_bytes: 59065358
151
+ num_examples: 170644
152
+ download_size: 26024485
153
+ dataset_size: 59065358
154
  - config_name: ga-sh
155
  features:
156
  - name: id
 
163
  - sh
164
  splits:
165
  - name: train
166
+ num_bytes: 28666465
167
  num_examples: 91613
168
+ download_size: 13309478
169
+ dataset_size: 28666465
170
  - config_name: hr-sk
171
  features:
172
  - name: id
 
179
  - sk
180
  splits:
181
  - name: train
182
+ num_bytes: 170717543
183
  num_examples: 689263
184
+ download_size: 79828239
185
+ dataset_size: 170717543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  - config_name: hr-sv
187
  features:
188
  - name: id
 
195
  - sv
196
  splits:
197
  - name: train
198
+ num_bytes: 171857552
199
  num_examples: 696334
200
+ download_size: 77567933
201
+ dataset_size: 171857552
202
+ - config_name: mt-sh
203
  features:
204
  - name: id
205
  dtype: string
 
207
  dtype:
208
  translation:
209
  languages:
210
+ - mt
211
+ - sh
212
  splits:
213
  - name: train
214
+ num_bytes: 368560691
215
+ num_examples: 1450424
216
+ download_size: 166554923
217
+ dataset_size: 368560691
218
+ configs:
219
+ - config_name: bg-ga
220
+ data_files:
221
+ - split: train
222
+ path: bg-ga/train-*
223
+ - config_name: bg-hr
224
+ data_files:
225
+ - split: train
226
+ path: bg-hr/train-*
227
+ - config_name: bg-sh
228
+ data_files:
229
+ - split: train
230
+ path: bg-sh/train-*
231
+ - config_name: es-ga
232
+ data_files:
233
+ - split: train
234
+ path: es-ga/train-*
235
+ - config_name: fi-ga
236
+ data_files:
237
+ - split: train
238
+ path: fi-ga/train-*
239
+ - config_name: ga-nl
240
+ data_files:
241
+ - split: train
242
+ path: ga-nl/train-*
243
+ - config_name: ga-sh
244
+ data_files:
245
+ - split: train
246
+ path: ga-sh/train-*
247
+ - config_name: hr-sk
248
+ data_files:
249
+ - split: train
250
+ path: hr-sk/train-*
251
+ - config_name: hr-sv
252
+ data_files:
253
+ - split: train
254
+ path: hr-sv/train-*
255
+ - config_name: mt-sh
256
+ data_files:
257
+ - split: train
258
+ path: mt-sh/train-*
259
  ---
260
 
261
  # Dataset Card for OpusDgt
bg-ga/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d000371daa9e18108df07efe32141f0479c052bc47f5aceccf7da592401ca30a
3
+ size 32909143
bg-hr/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7f1c4a799a67626d717564a4df33e26c11ec799ba9a4ecd6d360b5521eaa055
3
+ size 95163332
bg-sh/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fc14282e01314a3e59122d2fed436580d30490c985c2a9b625f5a63a40b7e36
3
+ size 197907658
es-ga/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf1322c4a02de86f81a0b4c56bd1a719488c04a0ef6db7a51fad1939c932c8f9
3
+ size 27625395
fi-ga/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2dd2b5c8f44891753fcb00aafbb2411034a2c8afa7e0ecc2c1bb5fd41cfa6ef
3
+ size 27498616
ga-nl/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fbc3d83810559add9387b604a2dc041ed7c33ee69b352ccaf86d5035d23cc0f
3
+ size 26024485
ga-sh/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3349ec1795900cc1a5f21b80e705f27f41c122311fbcd6f3cdceec97856a393d
3
+ size 13309478
hr-sk/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e76939826ce355249a108726b54a8859274ae298732e19ffab97488e32be94e
3
+ size 79828239
hr-sv/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48a2d633703e80cf9a8e11672a6c31dca35f3c780d9d3cdf784fa024ba3bbe34
3
+ size 77567933
mt-sh/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91527d7322e5054f9faf132d79068948f0f0cf060e179d4c3a51951714587c20
3
+ size 166554923
opus_dgt.py DELETED
@@ -1,132 +0,0 @@
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
- A collection of translation memories provided by the JRC. Source: https://ec.europa.eu/jrc/en/language-technologies/dgt-translation-memory
24
- 25 languages, 299 bitexts
25
- total number of files: 817,410
26
- total number of tokens: 2.13G
27
- total number of sentence fragments: 113.52M
28
- """
29
- _HOMEPAGE_URL = "http://opus.nlpl.eu/DGT.php"
30
- _CITATION = """\
31
- @InProceedings{TIEDEMANN12.463,
32
- author = {J{\"o}rg Tiedemann},
33
- title = {Parallel Data, Tools and Interfaces in OPUS},
34
- booktitle = {Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)},
35
- year = {2012},
36
- month = {may},
37
- date = {23-25},
38
- address = {Istanbul, Turkey},
39
- 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},
40
- publisher = {European Language Resources Association (ELRA)},
41
- isbn = {978-2-9517408-7-7},
42
- language = {english}
43
- }
44
- """
45
-
46
- _VERSION = "1.0.0"
47
- _BASE_NAME = "DGT.{}.{}"
48
- _BASE_URL = "https://object.pouta.csc.fi/OPUS-DGT/v2019/moses/{}-{}.txt.zip"
49
- # Please note that only few pairs are shown here. You can use config to generate data for all language pairs
50
- _LANGUAGE_PAIRS = [
51
- ("bg", "ga"),
52
- ("bg", "hr"),
53
- ("bg", "sh"),
54
- ("fi", "ga"),
55
- ("es", "ga"),
56
- ("ga", "sh"),
57
- ("hr", "sk"),
58
- ("mt", "sh"),
59
- ("hr", "sv"),
60
- ("ga", "nl"),
61
- ]
62
-
63
-
64
- class DgtConfig(datasets.BuilderConfig):
65
- def __init__(self, *args, lang1=None, lang2=None, **kwargs):
66
- super().__init__(
67
- *args,
68
- name=f"{lang1}-{lang2}",
69
- **kwargs,
70
- )
71
- self.lang1 = lang1
72
- self.lang2 = lang2
73
-
74
-
75
- class OpusDgt(datasets.GeneratorBasedBuilder):
76
- BUILDER_CONFIGS = [
77
- DgtConfig(
78
- lang1=lang1,
79
- lang2=lang2,
80
- description=f"Translating {lang1} to {lang2} or vice versa",
81
- version=datasets.Version(_VERSION),
82
- )
83
- for lang1, lang2 in _LANGUAGE_PAIRS
84
- ]
85
- BUILDER_CONFIG_CLASS = DgtConfig
86
-
87
- def _info(self):
88
- return datasets.DatasetInfo(
89
- description=_DESCRIPTION,
90
- features=datasets.Features(
91
- {
92
- "id": datasets.Value("string"),
93
- "translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
94
- },
95
- ),
96
- supervised_keys=None,
97
- homepage=_HOMEPAGE_URL,
98
- citation=_CITATION,
99
- )
100
-
101
- def _split_generators(self, dl_manager):
102
- def _base_url(lang1, lang2):
103
- return _BASE_URL.format(lang1, lang2)
104
-
105
- download_url = _base_url(self.config.lang1, self.config.lang2)
106
- path = dl_manager.download_and_extract(download_url)
107
- return [
108
- datasets.SplitGenerator(
109
- name=datasets.Split.TRAIN,
110
- gen_kwargs={"datapath": path},
111
- )
112
- ]
113
-
114
- def _generate_examples(self, datapath):
115
- l1, l2 = self.config.lang1, self.config.lang2
116
- folder = l1 + "-" + l2
117
- l1_file = _BASE_NAME.format(folder, l1)
118
- l2_file = _BASE_NAME.format(folder, l2)
119
- l1_path = os.path.join(datapath, l1_file)
120
- l2_path = os.path.join(datapath, l2_file)
121
- with open(l1_path, encoding="utf-8") as f1, open(l2_path, encoding="utf-8") as f2:
122
- for sentence_counter, (x, y) in enumerate(zip(f1, f2)):
123
- x = x.strip()
124
- y = y.strip()
125
- result = (
126
- sentence_counter,
127
- {
128
- "id": str(sentence_counter),
129
- "translation": {l1: x, l2: y},
130
- },
131
- )
132
- yield result