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

Update files from the datasets library (from 1.4.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.4.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,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - af
8
+ - ak
9
+ - am
10
+ - ar
11
+ - as
12
+ - ay
13
+ - az
14
+ - be
15
+ - bg
16
+ - bm
17
+ - bn
18
+ - br
19
+ - bs
20
+ - ca
21
+ - cb
22
+ - cs
23
+ - cx
24
+ - cy
25
+ - de
26
+ - dv
27
+ - el
28
+ - eo
29
+ - es
30
+ - fa
31
+ - ff
32
+ - fi
33
+ - fo
34
+ - fr
35
+ - fy
36
+ - ga
37
+ - gl
38
+ - gn
39
+ - gu
40
+ - he
41
+ - hi
42
+ - hr
43
+ - hu
44
+ - id
45
+ - ig
46
+ - is
47
+ - it
48
+ - iu
49
+ - ja
50
+ - ka
51
+ - kg
52
+ - kk
53
+ - km
54
+ - kn
55
+ - ko
56
+ - ku
57
+ - ky
58
+ - la
59
+ - lg
60
+ - li
61
+ - ln
62
+ - lo
63
+ - lt
64
+ - lv
65
+ - mg
66
+ - mi
67
+ - mk
68
+ - ml
69
+ - mn
70
+ - mr
71
+ - ms
72
+ - mt
73
+ - my
74
+ - my
75
+ - ne
76
+ - nl
77
+ - no
78
+ - ns
79
+ - ny
80
+ - om
81
+ - or
82
+ - pa
83
+ - pl
84
+ - ps
85
+ - pt
86
+ - qa
87
+ - qd
88
+ - rm
89
+ - ro
90
+ - ru
91
+ - rw
92
+ - sc
93
+ - sd
94
+ - se
95
+ - si
96
+ - sk
97
+ - sl
98
+ - sn
99
+ - so
100
+ - sq
101
+ - sr
102
+ - ss
103
+ - st
104
+ - su
105
+ - sv
106
+ - sw
107
+ - sy
108
+ - sz
109
+ - ta
110
+ - te
111
+ - tg
112
+ - th
113
+ - ti
114
+ - tl
115
+ - tn
116
+ - tr
117
+ - ts
118
+ - tt
119
+ - tz
120
+ - ug
121
+ - uk
122
+ - ur
123
+ - uz
124
+ - ve
125
+ - vi
126
+ - wo
127
+ - wy
128
+ - xh
129
+ - yi
130
+ - yo
131
+ - zh
132
+ - zh
133
+ - zu
134
+ - zz
135
+ licenses:
136
+ - unknown
137
+ multilinguality:
138
+ - translation
139
+ size_categories:
140
+ - n<1K
141
+ - 1K<n<10K
142
+ - 10K<n<100K
143
+ - 100K<n<1M
144
+ - n>1M
145
+ source_datasets:
146
+ - original
147
+ task_categories:
148
+ - other
149
+ task_ids:
150
+ - other-other-translation
151
+ ---
152
+
153
+ # Dataset Card for ccaligned_multilingual
154
+
155
+ ## Table of Contents
156
+ - [Dataset Description](#dataset-description)
157
+ - [Dataset Summary](#dataset-summary)
158
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
159
+ - [Languages](#languages)
160
+ - [Dataset Structure](#dataset-structure)
161
+ - [Data Instances](#data-instances)
162
+ - [Data Fields](#data-instances)
163
+ - [Data Splits](#data-instances)
164
+ - [Dataset Creation](#dataset-creation)
165
+ - [Curation Rationale](#curation-rationale)
166
+ - [Source Data](#source-data)
167
+ - [Annotations](#annotations)
168
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
169
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
170
+ - [Social Impact of Dataset](#social-impact-of-dataset)
171
+ - [Discussion of Biases](#discussion-of-biases)
172
+ - [Other Known Limitations](#other-known-limitations)
173
+ - [Additional Information](#additional-information)
174
+ - [Dataset Curators](#dataset-curators)
175
+ - [Licensing Information](#licensing-information)
176
+ - [Citation Information](#citation-information)
177
+ - [Contributions](#contributions)
178
+
179
+ ## Dataset Description
180
+
181
+ - **Homepage:** http://www.statmt.org/cc-aligned/
182
+ - **Repository:** [Needs More Information]
183
+ - **Paper:** https://www.aclweb.org/anthology/2020.emnlp-main.480.pdf
184
+ - **Leaderboard:** [Needs More Information]
185
+ - **Point of Contact:** [Needs More Information]
186
+
187
+ ### Dataset Summary
188
+
189
+ CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French). This corpus was created from 68 Commoncrawl Snapshots.
190
+
191
+
192
+ To load a language which isn't part of the config, all you need to do is specify the language code. You can find the valid languages in http://www.statmt.org/cc-aligned/ E.g.
193
+ ```
194
+ dataset = load_dataset("ccaligned_multilingual", language_code="fr_XX", type="documents")
195
+ ```
196
+ or
197
+ ```
198
+ dataset = load_dataset("ccaligned_multilingual", language_code="fr_XX", type="sentences")
199
+ ```
200
+
201
+
202
+ ### Supported Tasks and Leaderboards
203
+
204
+ [Needs More Information]
205
+
206
+ ### Languages
207
+
208
+ The text in the dataset is in (137) multiple languages aligned with english.
209
+
210
+ ## Dataset Structure
211
+
212
+ ### Data Instances
213
+
214
+ An instance of `documents` type for language `ak_GH`:
215
+
216
+ ```
217
+ {'Domain': 'islamhouse.com', 'Source_URL': 'https://islamhouse.com/en/audios/373088/', 'Target_URL': 'https://islamhouse.com/ak/audios/373088/', 'translation': {'ak_GH': "Ntwatiaa / wɔabɔ no tɔfa wɔ mu no te ase ma Umrah - Arab kasa|Islamhouse.com|Follow us:|facebook|twitter|taepe|Titles All|Fie wibesite|kasa nyina|Buukuu edi adanse ma prente|Nhyehyɛmu|Nyim/sua Islam|Curriculums|Nyina ndeɛma|Nyina ndeɛma (295)|Buukuu/ nwoma (2)|sini / muuvi (31)|ɔdio (262)|Aɛn websideNew!|Kɔ wura kramosom mu seisei|Ebio|figa/kaasɛ|Farebae|AKAkan|Kratafa titriw|kasa interface( anyimu) : Akan|Kasa ma no mu-nsɛm : Arab kasa|ɔdio|Ntwatiaa / wɔabɔ no tɔfa wɔ mu no te ase ma Umrah|play|pause|stop|mute|unmute|max volume|Kasakyerɛ ni :|Farebae:|17 / 11 / 1432 , 15/10/2011|Nhyehyɛmu:|Jurisprudence/ Esum Nimdea|Som|Hajj na Umrah|Jurisprudence/ Esum Nimdea|Som|Hajj na Umrah|Mmira ma Hajj na Umrah|nkyerɛmu|kasamu /sɛntɛns ma te ase na Umrah wɔ ... mu no hann ma no Quran na Sunnah na te ase ma no nana na no kasamu /sɛntɛns ma bi ma no emerging yi adu obusuani|Akenkane we ye di ko kasa bi su (36)|Afar - Qafár afa|Akan|Amhari ne - አማርኛ|Arab kasa - عربي|Assamese - অসমীয়া|Bengali - বাংলা|Maldive - ދިވެހި|Greek - Ελληνικά|English ( brofo kasa) - English|Persian - فارسی|Fula - pulla|French - Français|Hausa - Hausa|Kurdish - كوردی سۆرانی|Uganda ne - Oluganda|Mandinka - Mandinko|Malayalam - മലയാളം|Nepali - नेपाली|Portuguese - Português|Russian - Русский|Sango - Sango|Sinhalese - සිංහල|Somali - Soomaali|Albania ne - Shqip|Swahili - Kiswahili|Telugu - తెలుగు ప్రజలు|Tajik - Тоҷикӣ|Thai - ไทย|Tagalog - Tagalog|Turkish - Türkçe|Uyghur - ئۇيغۇرچە|Urdu - اردو|Uzbeck ne - Ўзбек тили|Vietnamese - Việt Nam|Wolof - Wolof|Chine ne - 中文|Soma kɔ bi kyerɛ adwen kɔ wɛb ebusuapanin|Soma kɔ ne kɔ hom adamfo|Soma kɔ bi kyerɛ adwen kɔ wɛb ebusuapanin|Nsɔwso fael (1)|1|الموجز في فقه العمرة|MP3 14.7 MB|Enoumah ebatahu|Rituals/Esom ajomadie ewu Hajji mmire .. 1434 AH [01] no fapemso Enum|Fiidbak/ Ye hiya wu jun kyiri|Lenke de yɛe|kɔntakt yɛn|Aɛn webside|Qura'an Kro kronkrom|Balagh|wɔ mfinimfin Dowload faele|Yɛ atuu bra Islam mu afei|Tsin de yɛe ewu|Anaa bomu/combine hɛn melin liste|© Islamhouse Website/ Islam dan webi site|×|×|Yi mu kasa|", 'en_XX': 'SUMMARY in the jurisprudence of Umrah - Arabic - Abdul Aziz Bin Marzooq Al-Turaifi|Islamhouse.com|Follow us:|facebook|twitter|QuranEnc.com|HadeethEnc.com|Type|Titles All|Home Page|All Languages|Categories|Know about Islam|All items|All items (4057)|Books (701)|Articles (548)|Fatawa (370)|Videos (1853)|Audios (416)|Posters (98)|Greeting cards (22)|Favorites (25)|Applications (21)|Desktop Applications (3)|To convert to Islam now !|More|Figures|Sources|Curriculums|Our Services|QuranEnc.com|HadeethEnc.com|ENEnglish|Main Page|Interface Language : English|Language of the content : Arabic|Audios|تعريب عنوان المادة|SUMMARY in the jurisprudence of Umrah|play|pause|stop|mute|unmute|max volume|Lecturer : Abdul Aziz Bin Marzooq Al-Turaifi|Sources:|AlRaya Islamic Recoding in Riyadh|17 / 11 / 1432 , 15/10/2011|Categories:|Islamic Fiqh|Fiqh of Worship|Hajj and Umrah|Islamic Fiqh|Fiqh of Worship|Hajj and Umrah|Pilgrimage and Umrah|Description|SUMMARY in jurisprudence of Umrah: A statement of jurisprudence and Umrah in the light of the Quran and Sunnah and understanding of the Ancestors and the statement of some of the emerging issues related to them.|This page translated into (36)|Afar - Qafár afa|Akane - Akan|Amharic - አማርኛ|Arabic - عربي|Assamese - অসমীয়া|Bengali - বাংলা|Maldivi - ދިވެހި|Greek - Ελληνικά|English|Persian - فارسی|Fula - pulla|French - Français|Hausa - Hausa|kurdish - كوردی سۆرانی|Ugandan - Oluganda|Mandinka - Mandinko|Malayalam - മലയാളം|Nepali - नेपाली|Portuguese - Português|Russian - Русский|Sango - Yanga ti Sango|Sinhalese - සිංහල|Somali - Soomaali|Albanian - Shqip|Swahili - Kiswahili|Telugu - తెలుగు|Tajik - Тоҷикӣ|Thai - ไทย|Tagalog - Tagalog|Turkish - Türkçe|Uyghur - ئۇيغۇرچە|Urdu - اردو|Uzbek - Ўзбек тили|Vietnamese - Việt Nam|Wolof - Wolof|Chinese - 中文|Send a comment to Webmaster|Send to a friend?|Send a comment to Webmaster|Attachments (1)|1|الموجز في فقه العمرة|MP3 14.7 MB|The relevant Material|The rituals of the pilgrimage season .. 1434 AH [ 01] the fifth pillar|The Quality of the Accepted Hajj (Piligrimage) and Its Limitations|Easy Path to the Rules of the Rites of Hajj|A Call to the Pilgrims of the Scared House of Allah|More|feedback|Important links|Contact us|Privacy policy|Islam Q&A|Learning Arabic Language|About Us|Convert To Islam|Noble Quran encyclopedia|IslamHouse.com Reader|Encyclopedia of Translated Prophetic Hadiths|Our Services|The Quran|Balagh|Center for downloading files|To embrace Islam now...|Follow us through|Or join our mailing list.|© Islamhouse Website|×|×|Choose language|'}}
218
+ ```
219
+
220
+ An instance of `sentences` type for language `ak_GH`:
221
+
222
+ ```
223
+ {'LASER_similarity': 1.4549942016601562, 'translation': {'ak_GH': 'Salah (nyamefere) ye Mmerebeia', 'en_XX': 'What he dislikes when fasting (10)'}}
224
+ ```
225
+
226
+ ### Data Fields
227
+
228
+ For `documents` type:
229
+
230
+ - `Domain`: a `string` feature containing the domain.
231
+ - `Source_URL`: a `string` feature containing the source URL.
232
+ - `Target_URL`: a `string` feature containing the target URL.
233
+ - `translation`: a `dictionary` feature with two keys :
234
+ - `en_XX`: a `string` feature containing the content in English.
235
+ - <language_code>: a `string` feature containing the content in the `language_code` specified.
236
+
237
+ For `sentences` type:
238
+
239
+ - `LASER_similarity`: a `float32` feature representing the LASER similarity score.
240
+ - `translation`: a `dictionary` feature with two keys :
241
+ - `en_XX`: a `string` feature containing the content in English.
242
+ - <language_code>: a `string` feature containing the content in the `language_code` specified.
243
+
244
+ ### Data Splits
245
+
246
+ [Needs More Information]
247
+
248
+ ## Dataset Creation
249
+
250
+ ### Curation Rationale
251
+
252
+ [Needs More Information]
253
+
254
+ ### Source Data
255
+
256
+ #### Initial Data Collection and Normalization
257
+
258
+ [Needs More Information]
259
+
260
+ #### Who are the source language producers?
261
+
262
+ [Needs More Information]
263
+
264
+ ### Annotations
265
+
266
+ #### Annotation process
267
+
268
+ [Needs More Information]
269
+
270
+ #### Who are the annotators?
271
+
272
+ [Needs More Information]
273
+
274
+ ### Personal and Sensitive Information
275
+
276
+ [Needs More Information]
277
+
278
+ ## Considerations for Using the Data
279
+
280
+ ### Social Impact of Dataset
281
+
282
+ [Needs More Information]
283
+
284
+ ### Discussion of Biases
285
+
286
+ [Needs More Information]
287
+
288
+ ### Other Known Limitations
289
+
290
+ [Needs More Information]
291
+
292
+ ## Additional Information
293
+
294
+ ### Dataset Curators
295
+
296
+ [Needs More Information]
297
+
298
+ ### Licensing Information
299
+
300
+ [Needs More Information]
301
+
302
+ ### Citation Information
303
+
304
+ ```
305
+ @inproceedings{elkishky_ccaligned_2020,
306
+ author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{\'a}n, Francisco and Koehn, Philipp},
307
+ booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},
308
+ month = {November},
309
+ title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},
310
+ year = {2020}
311
+ address = "Online",
312
+ publisher = "Association for Computational Linguistics",
313
+ url = "https://www.aclweb.org/anthology/2020.emnlp-main.480",
314
+ doi = "10.18653/v1/2020.emnlp-main.480",
315
+ pages = "5960--5969"
316
+ }
317
+ ```
318
+
319
+ ### Contributions
320
+
321
+ Thanks to [@gchhablani](https://github.com/gchhablani) for adding this dataset.
ccaligned_multilingual.py ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
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
+ """Ccaligned Multilingual Translation Dataset"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import os
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{elkishky_ccaligned_2020,
26
+ author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{\'a}n, Francisco and Koehn, Philipp},
27
+ booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},
28
+ month = {November},
29
+ title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},
30
+ year = {2020}
31
+ address = "Online",
32
+ publisher = "Association for Computational Linguistics",
33
+ url = "https://www.aclweb.org/anthology/2020.emnlp-main.480",
34
+ doi = "10.18653/v1/2020.emnlp-main.480",
35
+ pages = "5960--5969"
36
+ }
37
+ """
38
+
39
+ _DESCRIPTION = """\
40
+ CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).
41
+ """
42
+
43
+ _HOMEPAGE = "http://www.statmt.org/cc-aligned/"
44
+
45
+
46
+ _LICENSE = "" # Unknown
47
+
48
+
49
+ _URLs = {
50
+ "documents": "http://www.statmt.org/cc-aligned/",
51
+ "sentences": "http://www.statmt.org/cc-aligned/sentence-aligned/",
52
+ }
53
+
54
+ reverse_mapped_sentences = [
55
+ "af_ZA",
56
+ "ak_GH",
57
+ "am_ET",
58
+ "ar_AR",
59
+ "as_IN",
60
+ "ay_BO",
61
+ "az_AZ",
62
+ "az_IR",
63
+ "be_BY",
64
+ "bg_BG",
65
+ "bm_ML",
66
+ "bn_IN",
67
+ "br_FR",
68
+ "bs_BA",
69
+ "ca_ES",
70
+ "cb_IQ",
71
+ "cs_CZ",
72
+ "cx_PH",
73
+ "cy_GB",
74
+ "da_DK",
75
+ "de_DE",
76
+ "el_GR",
77
+ ] # Some languages have the reverse source languages in the URLs.
78
+
79
+
80
+ class CcalignedMultilingualConfig(datasets.BuilderConfig):
81
+ def __init__(self, *args, type=None, language_code=None, **kwargs):
82
+ super().__init__(
83
+ *args,
84
+ name=f"{type}-{language_code}",
85
+ **kwargs,
86
+ )
87
+ self.type = type
88
+ self.language_code = language_code
89
+
90
+
91
+ class CcalignedMultilingual(datasets.GeneratorBasedBuilder):
92
+ """The Ccaligned Multilingual Dataset."""
93
+
94
+ VERSION = datasets.Version("1.0.0")
95
+
96
+ BUILDER_CONFIGS = [
97
+ CcalignedMultilingualConfig(
98
+ type="documents",
99
+ language_code="zz_TR",
100
+ version=VERSION,
101
+ description="The dataset containing document-pairs for en_XX-zz_TR.",
102
+ ),
103
+ CcalignedMultilingualConfig(
104
+ type="sentences",
105
+ language_code="zz_TR",
106
+ version=VERSION,
107
+ description="The dataset containing sentence-pairs for en_XX-zz_TR.",
108
+ ),
109
+ CcalignedMultilingualConfig(
110
+ type="documents",
111
+ language_code="tz_MA",
112
+ version=VERSION,
113
+ description="The dataset containing document-pairs for en_XX-tz_MA.",
114
+ ),
115
+ CcalignedMultilingualConfig(
116
+ type="sentences",
117
+ language_code="tz_MA",
118
+ version=VERSION,
119
+ description="The dataset containing sentence-pairs for en_XX-tz_MA.",
120
+ ),
121
+ CcalignedMultilingualConfig(
122
+ type="documents",
123
+ language_code="ak_GH",
124
+ version=VERSION,
125
+ description="The dataset containing document-pairs for en_XX-ak_GH.",
126
+ ),
127
+ CcalignedMultilingualConfig(
128
+ type="sentences",
129
+ language_code="ak_GH",
130
+ version=VERSION,
131
+ description="The dataset containing sentence-pairs for en_XX-ak_GH.",
132
+ ),
133
+ ]
134
+
135
+ BUILDER_CONFIG_CLASS = CcalignedMultilingualConfig
136
+
137
+ # DEFAULT_CONFIG_NAME = "documents-zz_TR" # Not Needed
138
+
139
+ def _info(self):
140
+ if self.config.name[:9] == "documents":
141
+ features = datasets.Features(
142
+ {
143
+ "Domain": datasets.Value("string"),
144
+ "Source_URL": datasets.Value("string"),
145
+ "Target_URL": datasets.Value("string"),
146
+ "translation": datasets.Translation(languages=("en_XX", self.config.language_code)),
147
+ }
148
+ )
149
+ else:
150
+ features = datasets.Features(
151
+ {
152
+ "translation": datasets.Translation(languages=("en_XX", self.config.language_code)),
153
+ "LASER_similarity": datasets.Value("float"),
154
+ }
155
+ )
156
+
157
+ return datasets.DatasetInfo(
158
+ # This is the description that will appear on the datasets page.
159
+ description=_DESCRIPTION,
160
+ # This defines the different columns of the dataset and their types
161
+ features=features, # Here we define them above because they are different between the two configurations
162
+ supervised_keys=None,
163
+ # Homepage of the dataset for documentation
164
+ homepage=_HOMEPAGE,
165
+ # License for the dataset if available
166
+ license=_LICENSE,
167
+ # Citation for the dataset
168
+ citation=_CITATION,
169
+ )
170
+
171
+ def _split_generators(self, dl_manager):
172
+ """Returns SplitGenerators."""
173
+ my_urls = _URLs[self.config.name[:9]]
174
+ if self.config.name[:9] == "sentences" and self.config.language_code in reverse_mapped_sentences:
175
+ url = my_urls + self.config.language_code + "-en_XX.tsv.xz"
176
+ from_english = False
177
+ else:
178
+ url = my_urls + "en_XX-" + self.config.language_code + ".tsv.xz"
179
+ from_english = True
180
+ data_file = dl_manager.download_and_extract(url)
181
+ return [
182
+ datasets.SplitGenerator(
183
+ name=datasets.Split.TRAIN,
184
+ # These kwargs will be passed to _generate_examples
185
+ gen_kwargs={
186
+ "filepath": os.path.join(data_file),
187
+ "from_english": from_english, # Whether the translation is from english or to english, only useful in case of sentence-pairs
188
+ },
189
+ )
190
+ ]
191
+
192
+ def _generate_examples(self, filepath, from_english=False):
193
+ """ Yields examples. """
194
+ lc = self.config.language_code
195
+ reverse = lc in reverse_mapped_sentences
196
+ with open(filepath, encoding="utf-8") as f:
197
+ for id_, row in enumerate(f):
198
+ data = row.split("\t")
199
+ if self.config.name[:9] == "documents":
200
+ yield id_, {
201
+ "Domain": data[0],
202
+ "Source_URL": data[1],
203
+ "Target_URL": data[3],
204
+ "translation": {"en_XX": data[2].strip(), lc: data[4].strip()},
205
+ }
206
+ else:
207
+ if not reverse:
208
+ yield id_, {
209
+ "translation": {"en_XX": data[0].strip(), lc: data[1].strip()},
210
+ "LASER_similarity": data[2],
211
+ }
212
+ else:
213
+ yield id_, {
214
+ "translation": {lc: data[0].strip(), "en_XX": data[1].strip()},
215
+ "LASER_similarity": data[2],
216
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"documents-zz_TR": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"Domain": {"dtype": "string", "id": null, "_type": "Value"}, "Source_URL": {"dtype": "string", "id": null, "_type": "Value"}, "Target_URL": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en_XX", "zz_TR"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "documents-zz_TR", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 641412, "num_examples": 41, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/en_XX-zz_TR.tsv.xz": {"num_bytes": 125488, "checksum": "c4a4fe74bdc054dfd1d3c83503fb1bfa41bd26f98219f179e345df5814cfc18f"}}, "download_size": 125488, "post_processing_size": null, "dataset_size": 641412, "size_in_bytes": 766900}, "sentences-zz_TR": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"translation": {"languages": ["en_XX", "zz_TR"], "id": null, "_type": "Translation"}, "LASER_similarity": {"dtype": "float32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "sentences-zz_TR", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4056, "num_examples": 34, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/sentence-aligned/en_XX-zz_TR.tsv.xz": {"num_bytes": 1428, "checksum": "14bbbb8752bc0d3620a1f441378862f457f4fdf4613887715794202301c7c9af"}}, "download_size": 1428, "post_processing_size": null, "dataset_size": 4056, "size_in_bytes": 5484}, "documents-tz_MA": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"Domain": {"dtype": "string", "id": null, "_type": "Value"}, "Source_URL": {"dtype": "string", "id": null, "_type": "Value"}, "Target_URL": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en_XX", "tz_MA"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "documents-tz_MA", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 51782, "num_examples": 4, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/en_XX-tz_MA.tsv.xz": {"num_bytes": 11996, "checksum": "31fabb4f9ba4506db3dcbecb31fcafeddb6ca5c0cc7bb37f24ebb0aa5f03f2dc"}}, "download_size": 11996, "post_processing_size": null, "dataset_size": 51782, "size_in_bytes": 63778}, "sentences-tz_MA": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"translation": {"languages": ["en_XX", "tz_MA"], "id": null, "_type": "Translation"}, "LASER_similarity": {"dtype": "float32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "sentences-tz_MA", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6256, "num_examples": 33, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/sentence-aligned/en_XX-tz_MA.tsv.xz": {"num_bytes": 2420, "checksum": "ebe1b6e0fc44af392d784fd5cba98f347e1cc010dfc2d283f884cbe8534fcc21"}}, "download_size": 2420, "post_processing_size": null, "dataset_size": 6256, "size_in_bytes": 8676}, "documents-ak_GH": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"Domain": {"dtype": "string", "id": null, "_type": "Value"}, "Source_URL": {"dtype": "string", "id": null, "_type": "Value"}, "Target_URL": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en_XX", "ak_GH"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "documents-ak_GH", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10738312, "num_examples": 249, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/en_XX-ak_GH.tsv.xz": {"num_bytes": 399236, "checksum": "e0e78c243e68e4a717be0af5bd12ff3de7331ac250b018bd755cade4f98fa832"}}, "download_size": 399236, "post_processing_size": null, "dataset_size": 10738312, "size_in_bytes": 11137548}, "sentences-ak_GH": {"description": "CCAligned consists of parallel or comparable web-document pairs in 137 languages aligned with English. These web-document pairs were constructed by performing language identification on raw web-documents, and ensuring corresponding language codes were corresponding in the URLs of web documents. This pattern matching approach yielded more than 100 million aligned documents paired with English. Recognizing that each English document was often aligned to mulitple documents in different target language, we can join on English documents to obtain aligned documents that directly pair two non-English documents (e.g., Arabic-French).\n", "citation": "@inproceedings{elkishky_ccaligned_2020,\n author = {El-Kishky, Ahmed and Chaudhary, Vishrav and Guzm{'a}n, Francisco and Koehn, Philipp},\n booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020)},\n month = {November},\n title = {{CCAligned}: A Massive Collection of Cross-lingual Web-Document Pairs},\n year = {2020}\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.480\",\n doi = \"10.18653/v1/2020.emnlp-main.480\",\n pages = \"5960--5969\"\n}\n", "homepage": "http://www.statmt.org/cc-aligned/", "license": "", "features": {"translation": {"languages": ["en_XX", "ak_GH"], "id": null, "_type": "Translation"}, "LASER_similarity": {"dtype": "float32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ccaligned_multilingual", "config_name": "sentences-ak_GH", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 50110, "num_examples": 478, "dataset_name": "ccaligned_multilingual"}}, "download_checksums": {"http://www.statmt.org/cc-aligned/sentence-aligned/ak_GH-en_XX.tsv.xz": {"num_bytes": 17636, "checksum": "52b9db18c1a19d4c9cd16d28730d7c1a945679302fcec10b79a990b3d1efbb46"}}, "download_size": 17636, "post_processing_size": null, "dataset_size": 50110, "size_in_bytes": 67746}}
dummy/documents-ak_GH/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a036a026482dac3acf410e462f4bf25f0f765cde53193c2a34e93479adf5365
3
+ size 2796
dummy/documents-tz_MA/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b8c15168e2b1e90df66ed6ef7bdd8ef38a970cf5118bbfb5723c8b05d2a0ab4
3
+ size 1734
dummy/documents-zz_TR/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76c6c0a66ed32e6f859d4063dba02e6fa15d3188eb67db6b0a44bebe6a7a5d83
3
+ size 2618
dummy/sentences-ak_GH/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de00a36f249d6ac2c497f7ebfecdc429612bc4d65832b13a46063d739a92fa68
3
+ size 474
dummy/sentences-tz_MA/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8abb80362d93ba9c825e583bf769801c4e15d3886ce0c79b9de8af590016500c
3
+ size 483
dummy/sentences-zz_TR/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47367a6914049e2083168fbf4c20de5a00faf7b2ab16daefda67e49a45bc3917
3
+ size 506