luciferxf commited on
Commit
fef4aa7
1 Parent(s): 2e3f422

Upload 4 files

Browse files
wikipedia/.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
wikipedia/README.md ADDED
@@ -0,0 +1,789 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - crowdsourced
6
+ pretty_name: Wikipedia
7
+ paperswithcode_id: null
8
+ license:
9
+ - cc-by-sa-3.0
10
+ - gfdl
11
+ task_categories:
12
+ - text-generation
13
+ - fill-mask
14
+ task_ids:
15
+ - language-modeling
16
+ - masked-language-modeling
17
+ source_datasets:
18
+ - original
19
+ multilinguality:
20
+ - multilingual
21
+ size_categories:
22
+ - n<1K
23
+ - 1K<n<10K
24
+ - 10K<n<100K
25
+ - 100K<n<1M
26
+ - 1M<n<10M
27
+ language:
28
+ - aa
29
+ - ab
30
+ - ace
31
+ - af
32
+ - ak
33
+ - als
34
+ - am
35
+ - an
36
+ - ang
37
+ - ar
38
+ - arc
39
+ - arz
40
+ - as
41
+ - ast
42
+ - atj
43
+ - av
44
+ - ay
45
+ - az
46
+ - azb
47
+ - ba
48
+ - bar
49
+ - bcl
50
+ - be
51
+ - bg
52
+ - bh
53
+ - bi
54
+ - bjn
55
+ - bm
56
+ - bn
57
+ - bo
58
+ - bpy
59
+ - br
60
+ - bs
61
+ - bug
62
+ - bxr
63
+ - ca
64
+ - cbk
65
+ - cdo
66
+ - ce
67
+ - ceb
68
+ - ch
69
+ - cho
70
+ - chr
71
+ - chy
72
+ - ckb
73
+ - co
74
+ - cr
75
+ - crh
76
+ - cs
77
+ - csb
78
+ - cu
79
+ - cv
80
+ - cy
81
+ - da
82
+ - de
83
+ - din
84
+ - diq
85
+ - dsb
86
+ - dty
87
+ - dv
88
+ - dz
89
+ - ee
90
+ - el
91
+ - eml
92
+ - en
93
+ - eo
94
+ - es
95
+ - et
96
+ - eu
97
+ - ext
98
+ - fa
99
+ - ff
100
+ - fi
101
+ - fj
102
+ - fo
103
+ - fr
104
+ - frp
105
+ - frr
106
+ - fur
107
+ - fy
108
+ - ga
109
+ - gag
110
+ - gan
111
+ - gd
112
+ - gl
113
+ - glk
114
+ - gn
115
+ - gom
116
+ - gor
117
+ - got
118
+ - gu
119
+ - gv
120
+ - ha
121
+ - hak
122
+ - haw
123
+ - he
124
+ - hi
125
+ - hif
126
+ - ho
127
+ - hr
128
+ - hsb
129
+ - ht
130
+ - hu
131
+ - hy
132
+ - ia
133
+ - id
134
+ - ie
135
+ - ig
136
+ - ii
137
+ - ik
138
+ - ilo
139
+ - inh
140
+ - io
141
+ - is
142
+ - it
143
+ - iu
144
+ - ja
145
+ - jam
146
+ - jbo
147
+ - jv
148
+ - ka
149
+ - kaa
150
+ - kab
151
+ - kbd
152
+ - kbp
153
+ - kg
154
+ - ki
155
+ - kj
156
+ - kk
157
+ - kl
158
+ - km
159
+ - kn
160
+ - ko
161
+ - koi
162
+ - krc
163
+ - ks
164
+ - ksh
165
+ - ku
166
+ - kv
167
+ - kw
168
+ - ky
169
+ - la
170
+ - lad
171
+ - lb
172
+ - lbe
173
+ - lez
174
+ - lfn
175
+ - lg
176
+ - li
177
+ - lij
178
+ - lmo
179
+ - ln
180
+ - lo
181
+ - lrc
182
+ - lt
183
+ - ltg
184
+ - lv
185
+ - lzh
186
+ - mai
187
+ - mdf
188
+ - mg
189
+ - mh
190
+ - mhr
191
+ - mi
192
+ - min
193
+ - mk
194
+ - ml
195
+ - mn
196
+ - mr
197
+ - mrj
198
+ - ms
199
+ - mt
200
+ - mus
201
+ - mwl
202
+ - my
203
+ - myv
204
+ - mzn
205
+ - na
206
+ - nah
207
+ - nan
208
+ - nap
209
+ - nds
210
+ - ne
211
+ - new
212
+ - ng
213
+ - nl
214
+ - nn
215
+ - 'no'
216
+ - nov
217
+ - nrf
218
+ - nso
219
+ - nv
220
+ - ny
221
+ - oc
222
+ - olo
223
+ - om
224
+ - or
225
+ - os
226
+ - pa
227
+ - pag
228
+ - pam
229
+ - pap
230
+ - pcd
231
+ - pdc
232
+ - pfl
233
+ - pi
234
+ - pih
235
+ - pl
236
+ - pms
237
+ - pnb
238
+ - pnt
239
+ - ps
240
+ - pt
241
+ - qu
242
+ - rm
243
+ - rmy
244
+ - rn
245
+ - ro
246
+ - ru
247
+ - rue
248
+ - rup
249
+ - rw
250
+ - sa
251
+ - sah
252
+ - sat
253
+ - sc
254
+ - scn
255
+ - sco
256
+ - sd
257
+ - se
258
+ - sg
259
+ - sgs
260
+ - sh
261
+ - si
262
+ - sk
263
+ - sl
264
+ - sm
265
+ - sn
266
+ - so
267
+ - sq
268
+ - sr
269
+ - srn
270
+ - ss
271
+ - st
272
+ - stq
273
+ - su
274
+ - sv
275
+ - sw
276
+ - szl
277
+ - ta
278
+ - tcy
279
+ - tdt
280
+ - te
281
+ - tg
282
+ - th
283
+ - ti
284
+ - tk
285
+ - tl
286
+ - tn
287
+ - to
288
+ - tpi
289
+ - tr
290
+ - ts
291
+ - tt
292
+ - tum
293
+ - tw
294
+ - ty
295
+ - tyv
296
+ - udm
297
+ - ug
298
+ - uk
299
+ - ur
300
+ - uz
301
+ - ve
302
+ - vec
303
+ - vep
304
+ - vi
305
+ - vls
306
+ - vo
307
+ - vro
308
+ - wa
309
+ - war
310
+ - wo
311
+ - wuu
312
+ - xal
313
+ - xh
314
+ - xmf
315
+ - yi
316
+ - yo
317
+ - yue
318
+ - za
319
+ - zea
320
+ - zh
321
+ - zu
322
+ language_bcp47:
323
+ - nds-nl
324
+ configs:
325
+ - 20220301.aa
326
+ - 20220301.ab
327
+ - 20220301.ace
328
+ - 20220301.ady
329
+ - 20220301.af
330
+ - 20220301.ak
331
+ - 20220301.als
332
+ - 20220301.am
333
+ - 20220301.an
334
+ - 20220301.ang
335
+ - 20220301.ar
336
+ - 20220301.arc
337
+ - 20220301.arz
338
+ - 20220301.as
339
+ - 20220301.ast
340
+ - 20220301.atj
341
+ - 20220301.av
342
+ - 20220301.ay
343
+ - 20220301.az
344
+ - 20220301.azb
345
+ - 20220301.ba
346
+ - 20220301.bar
347
+ - 20220301.bat-smg
348
+ - 20220301.bcl
349
+ - 20220301.be
350
+ - 20220301.be-x-old
351
+ - 20220301.bg
352
+ - 20220301.bh
353
+ - 20220301.bi
354
+ - 20220301.bjn
355
+ - 20220301.bm
356
+ - 20220301.bn
357
+ - 20220301.bo
358
+ - 20220301.bpy
359
+ - 20220301.br
360
+ - 20220301.bs
361
+ - 20220301.bug
362
+ - 20220301.bxr
363
+ - 20220301.ca
364
+ - 20220301.cbk-zam
365
+ - 20220301.cdo
366
+ - 20220301.ce
367
+ - 20220301.ceb
368
+ - 20220301.ch
369
+ - 20220301.cho
370
+ - 20220301.chr
371
+ - 20220301.chy
372
+ - 20220301.ckb
373
+ - 20220301.co
374
+ - 20220301.cr
375
+ - 20220301.crh
376
+ - 20220301.cs
377
+ - 20220301.csb
378
+ - 20220301.cu
379
+ - 20220301.cv
380
+ - 20220301.cy
381
+ - 20220301.da
382
+ - 20220301.de
383
+ - 20220301.din
384
+ - 20220301.diq
385
+ - 20220301.dsb
386
+ - 20220301.dty
387
+ - 20220301.dv
388
+ - 20220301.dz
389
+ - 20220301.ee
390
+ - 20220301.el
391
+ - 20220301.eml
392
+ - 20220301.en
393
+ - 20220301.eo
394
+ - 20220301.es
395
+ - 20220301.et
396
+ - 20220301.eu
397
+ - 20220301.ext
398
+ - 20220301.fa
399
+ - 20220301.ff
400
+ - 20220301.fi
401
+ - 20220301.fiu-vro
402
+ - 20220301.fj
403
+ - 20220301.fo
404
+ - 20220301.fr
405
+ - 20220301.frp
406
+ - 20220301.frr
407
+ - 20220301.fur
408
+ - 20220301.fy
409
+ - 20220301.ga
410
+ - 20220301.gag
411
+ - 20220301.gan
412
+ - 20220301.gd
413
+ - 20220301.gl
414
+ - 20220301.glk
415
+ - 20220301.gn
416
+ - 20220301.gom
417
+ - 20220301.gor
418
+ - 20220301.got
419
+ - 20220301.gu
420
+ - 20220301.gv
421
+ - 20220301.ha
422
+ - 20220301.hak
423
+ - 20220301.haw
424
+ - 20220301.he
425
+ - 20220301.hi
426
+ - 20220301.hif
427
+ - 20220301.ho
428
+ - 20220301.hr
429
+ - 20220301.hsb
430
+ - 20220301.ht
431
+ - 20220301.hu
432
+ - 20220301.hy
433
+ - 20220301.ia
434
+ - 20220301.id
435
+ - 20220301.ie
436
+ - 20220301.ig
437
+ - 20220301.ii
438
+ - 20220301.ik
439
+ - 20220301.ilo
440
+ - 20220301.inh
441
+ - 20220301.io
442
+ - 20220301.is
443
+ - 20220301.it
444
+ - 20220301.iu
445
+ - 20220301.ja
446
+ - 20220301.jam
447
+ - 20220301.jbo
448
+ - 20220301.jv
449
+ - 20220301.ka
450
+ - 20220301.kaa
451
+ - 20220301.kab
452
+ - 20220301.kbd
453
+ - 20220301.kbp
454
+ - 20220301.kg
455
+ - 20220301.ki
456
+ - 20220301.kj
457
+ - 20220301.kk
458
+ - 20220301.kl
459
+ - 20220301.km
460
+ - 20220301.kn
461
+ - 20220301.ko
462
+ - 20220301.koi
463
+ - 20220301.krc
464
+ - 20220301.ks
465
+ - 20220301.ksh
466
+ - 20220301.ku
467
+ - 20220301.kv
468
+ - 20220301.kw
469
+ - 20220301.ky
470
+ - 20220301.la
471
+ - 20220301.lad
472
+ - 20220301.lb
473
+ - 20220301.lbe
474
+ - 20220301.lez
475
+ - 20220301.lfn
476
+ - 20220301.lg
477
+ - 20220301.li
478
+ - 20220301.lij
479
+ - 20220301.lmo
480
+ - 20220301.ln
481
+ - 20220301.lo
482
+ - 20220301.lrc
483
+ - 20220301.lt
484
+ - 20220301.ltg
485
+ - 20220301.lv
486
+ - 20220301.mai
487
+ - 20220301.map-bms
488
+ - 20220301.mdf
489
+ - 20220301.mg
490
+ - 20220301.mh
491
+ - 20220301.mhr
492
+ - 20220301.mi
493
+ - 20220301.min
494
+ - 20220301.mk
495
+ - 20220301.ml
496
+ - 20220301.mn
497
+ - 20220301.mr
498
+ - 20220301.mrj
499
+ - 20220301.ms
500
+ - 20220301.mt
501
+ - 20220301.mus
502
+ - 20220301.mwl
503
+ - 20220301.my
504
+ - 20220301.myv
505
+ - 20220301.mzn
506
+ - 20220301.na
507
+ - 20220301.nah
508
+ - 20220301.nap
509
+ - 20220301.nds
510
+ - 20220301.nds-nl
511
+ - 20220301.ne
512
+ - 20220301.new
513
+ - 20220301.ng
514
+ - 20220301.nl
515
+ - 20220301.nn
516
+ - 20220301.no
517
+ - 20220301.nov
518
+ - 20220301.nrm
519
+ - 20220301.nso
520
+ - 20220301.nv
521
+ - 20220301.ny
522
+ - 20220301.oc
523
+ - 20220301.olo
524
+ - 20220301.om
525
+ - 20220301.or
526
+ - 20220301.os
527
+ - 20220301.pa
528
+ - 20220301.pag
529
+ - 20220301.pam
530
+ - 20220301.pap
531
+ - 20220301.pcd
532
+ - 20220301.pdc
533
+ - 20220301.pfl
534
+ - 20220301.pi
535
+ - 20220301.pih
536
+ - 20220301.pl
537
+ - 20220301.pms
538
+ - 20220301.pnb
539
+ - 20220301.pnt
540
+ - 20220301.ps
541
+ - 20220301.pt
542
+ - 20220301.qu
543
+ - 20220301.rm
544
+ - 20220301.rmy
545
+ - 20220301.rn
546
+ - 20220301.ro
547
+ - 20220301.roa-rup
548
+ - 20220301.roa-tara
549
+ - 20220301.ru
550
+ - 20220301.rue
551
+ - 20220301.rw
552
+ - 20220301.sa
553
+ - 20220301.sah
554
+ - 20220301.sat
555
+ - 20220301.sc
556
+ - 20220301.scn
557
+ - 20220301.sco
558
+ - 20220301.sd
559
+ - 20220301.se
560
+ - 20220301.sg
561
+ - 20220301.sh
562
+ - 20220301.si
563
+ - 20220301.simple
564
+ - 20220301.sk
565
+ - 20220301.sl
566
+ - 20220301.sm
567
+ - 20220301.sn
568
+ - 20220301.so
569
+ - 20220301.sq
570
+ - 20220301.sr
571
+ - 20220301.srn
572
+ - 20220301.ss
573
+ - 20220301.st
574
+ - 20220301.stq
575
+ - 20220301.su
576
+ - 20220301.sv
577
+ - 20220301.sw
578
+ - 20220301.szl
579
+ - 20220301.ta
580
+ - 20220301.tcy
581
+ - 20220301.te
582
+ - 20220301.tet
583
+ - 20220301.tg
584
+ - 20220301.th
585
+ - 20220301.ti
586
+ - 20220301.tk
587
+ - 20220301.tl
588
+ - 20220301.tn
589
+ - 20220301.to
590
+ - 20220301.tpi
591
+ - 20220301.tr
592
+ - 20220301.ts
593
+ - 20220301.tt
594
+ - 20220301.tum
595
+ - 20220301.tw
596
+ - 20220301.ty
597
+ - 20220301.tyv
598
+ - 20220301.udm
599
+ - 20220301.ug
600
+ - 20220301.uk
601
+ - 20220301.ur
602
+ - 20220301.uz
603
+ - 20220301.ve
604
+ - 20220301.vec
605
+ - 20220301.vep
606
+ - 20220301.vi
607
+ - 20220301.vls
608
+ - 20220301.vo
609
+ - 20220301.wa
610
+ - 20220301.war
611
+ - 20220301.wo
612
+ - 20220301.wuu
613
+ - 20220301.xal
614
+ - 20220301.xh
615
+ - 20220301.xmf
616
+ - 20220301.yi
617
+ - 20220301.yo
618
+ - 20220301.za
619
+ - 20220301.zea
620
+ - 20220301.zh
621
+ - 20220301.zh-classical
622
+ - 20220301.zh-min-nan
623
+ - 20220301.zh-yue
624
+ - 20220301.zu
625
+ ---
626
+
627
+ # Dataset Card for Wikipedia
628
+
629
+ This repo is a fork of the original Hugging Face Wikipedia repo [here](https://huggingface.co/datasets/wikipedia).
630
+ The difference is that this fork does away with the need for `apache-beam`, and this fork is very fast if you have a lot of CPUs on your machine.
631
+ It will use all CPUs available to create a clean Wikipedia pretraining dataset. It takes less than an hour to process all of English wikipedia on a GCP n1-standard-96.
632
+ This fork is also used in the [OLM Project](https://github.com/huggingface/olm-datasets) to pull and process up-to-date wikipedia snapshots.
633
+
634
+ ## Table of Contents
635
+ - [Dataset Description](#dataset-description)
636
+ - [Dataset Summary](#dataset-summary)
637
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
638
+ - [Languages](#languages)
639
+ - [Dataset Structure](#dataset-structure)
640
+ - [Data Instances](#data-instances)
641
+ - [Data Fields](#data-fields)
642
+ - [Data Splits](#data-splits)
643
+ - [Dataset Creation](#dataset-creation)
644
+ - [Curation Rationale](#curation-rationale)
645
+ - [Source Data](#source-data)
646
+ - [Annotations](#annotations)
647
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
648
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
649
+ - [Social Impact of Dataset](#social-impact-of-dataset)
650
+ - [Discussion of Biases](#discussion-of-biases)
651
+ - [Other Known Limitations](#other-known-limitations)
652
+ - [Additional Information](#additional-information)
653
+ - [Dataset Curators](#dataset-curators)
654
+ - [Licensing Information](#licensing-information)
655
+ - [Citation Information](#citation-information)
656
+ - [Contributions](#contributions)
657
+
658
+ ## Dataset Description
659
+
660
+ - **Homepage:** [https://dumps.wikimedia.org](https://dumps.wikimedia.org)
661
+ - **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
662
+ - **Paper:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
663
+ - **Point of Contact:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
664
+
665
+ ### Dataset Summary
666
+
667
+ Wikipedia dataset containing cleaned articles of all languages.
668
+ The datasets are built from the Wikipedia dump
669
+ (https://dumps.wikimedia.org/) with one split per language. Each example
670
+ contains the content of one full Wikipedia article with cleaning to strip
671
+ markdown and unwanted sections (references, etc.).
672
+
673
+ The articles are parsed using the ``mwparserfromhell`` tool, and we use ``multiprocess`` for parallelization.
674
+
675
+ To load this dataset you need to install these first:
676
+
677
+ ```
678
+ pip install mwparserfromhell==0.6.4 multiprocess==0.70.13
679
+ ```
680
+
681
+ Then, you can load any subset of Wikipedia per language and per date this way:
682
+
683
+ ```python
684
+ from datasets import load_dataset
685
+
686
+ load_dataset("olm/wikipedia", language="en", date="20220920")
687
+ ```
688
+
689
+ You can find the full list of languages and dates [here](https://dumps.wikimedia.org/backup-index.html).
690
+
691
+ ### Supported Tasks and Leaderboards
692
+
693
+ The dataset is generally used for Language Modeling.
694
+
695
+ ### Languages
696
+
697
+ You can find the list of languages [here](https://meta.wikimedia.org/wiki/List_of_Wikipedias).
698
+
699
+ ## Dataset Structure
700
+
701
+ ### Data Instances
702
+
703
+ An example looks as follows:
704
+
705
+ ```
706
+ {'id': '1',
707
+ 'url': 'https://simple.wikipedia.org/wiki/April',
708
+ 'title': 'April',
709
+ 'text': 'April is the fourth month...'
710
+ }
711
+ ```
712
+
713
+ ### Data Fields
714
+
715
+ The data fields are the same among all configurations:
716
+
717
+ - `id` (`str`): ID of the article.
718
+ - `url` (`str`): URL of the article.
719
+ - `title` (`str`): Title of the article.
720
+ - `text` (`str`): Text content of the article.
721
+
722
+ ### Curation Rationale
723
+
724
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
725
+
726
+ ### Source Data
727
+
728
+ #### Initial Data Collection and Normalization
729
+
730
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
731
+
732
+ #### Who are the source language producers?
733
+
734
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
735
+
736
+ ### Annotations
737
+
738
+ #### Annotation process
739
+
740
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
741
+
742
+ #### Who are the annotators?
743
+
744
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
745
+
746
+ ### Personal and Sensitive Information
747
+
748
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
749
+
750
+ ## Considerations for Using the Data
751
+
752
+ ### Social Impact of Dataset
753
+
754
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
755
+
756
+ ### Discussion of Biases
757
+
758
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
759
+
760
+ ### Other Known Limitations
761
+
762
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
763
+
764
+ ## Additional Information
765
+
766
+ ### Dataset Curators
767
+
768
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
769
+
770
+ ### Licensing Information
771
+
772
+ Most of Wikipedia's text and many of its images are co-licensed under the
773
+ [Creative Commons Attribution-ShareAlike 3.0 Unported License](https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)
774
+ (CC BY-SA) and the [GNU Free Documentation License](https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License)
775
+ (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover texts).
776
+
777
+ Some text has been imported only under CC BY-SA and CC BY-SA-compatible license and cannot be reused under GFDL; such
778
+ text will be identified on the page footer, in the page history, or on the discussion page of the article that utilizes
779
+ the text.
780
+
781
+ ### Citation Information
782
+
783
+ ```
784
+ @ONLINE{wikidump,
785
+ author = "Wikimedia Foundation",
786
+ title = "Wikimedia Downloads",
787
+ url = "https://dumps.wikimedia.org"
788
+ }
789
+ ```
wikipedia/dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"20220301.de": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.de", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8905282792, "num_examples": 2665357, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/dewiki/20220301/dumpstatus.json": {"num_bytes": 116264, "checksum": "5b708414557485e8a06e62c85b83a40d60bfac46bfb4c8138c8f28daf3248c60"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream1.xml-p1p297012.bz2": {"num_bytes": 546047463, "checksum": "ecd4b93ae09af06c3d168a497f7b497eac5f1edd116e5199a2431c23b404e758"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream2.xml-p297013p1262093.bz2": {"num_bytes": 696548700, "checksum": "36107a2888184da355735b63edc69b6cf6437a0b217c08a5f24fb434e028e691"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream3.xml-p1262094p2762093.bz2": {"num_bytes": 646438206, "checksum": "50faed8dba837c5426290a8de71804c080d65469aef2abf7c1337f00c5e965dc"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream3.xml-p2762094p3376257.bz2": {"num_bytes": 258845977, "checksum": "09b5ba550ec8559206f69f5fc3c907308f06bfc63609bfbac78342b9e9f7ec48"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream4.xml-p3376258p4876257.bz2": {"num_bytes": 636610718, "checksum": "aab320d9e8a0ca9c097998bc195fc2b5d240b2b4e04b71a663d9dd66da409b5c"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream4.xml-p4876258p6115464.bz2": {"num_bytes": 525224364, "checksum": "65361c5b09ff2c5cfd5049b649a5827626dabff9a7d82857cb75679cee5b6578"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream5.xml-p6115465p7615464.bz2": {"num_bytes": 706926142, "checksum": "0966acbdca4fe180d064fc5710bb7c4b226731b65a27b7915814f9a77d9bcd94"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream5.xml-p7615465p9115464.bz2": {"num_bytes": 814164179, "checksum": "1a1a78551a6ae2ca085022012d63a33910a0a36d7d5eeda68e734fa4f59cbe49"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream5.xml-p9115465p9261244.bz2": {"num_bytes": 37506060, "checksum": "526dca3d96658c7cac53962272b610e11834c2bd9000662825a38437086673f8"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream6.xml-p9261245p10761244.bz2": {"num_bytes": 864587865, "checksum": "99c1cde91cb2fead1ee10ac7f7f6713675256e16a282a204717391cc98aca026"}, "https://dumps.wikimedia.org/dewiki/20220301/dewiki-20220301-pages-articles-multistream6.xml-p10761245p12150082.bz2": {"num_bytes": 790199167, "checksum": "865e4bc7aec2d171c2c341c960c7711ae130b134b030e842e0356d6a8d062e21"}}, "download_size": 6523215105, "post_processing_size": null, "dataset_size": 8905282792, "size_in_bytes": 15428497897}, "20220301.en": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.en", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 20275516160, "num_examples": 6458670, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/enwiki/20220301/dumpstatus.json": {"num_bytes": 516376, "checksum": "e22e3176e9df0eed162afefd57c1df66f92fbd43e5b80ab6c6feb8f07d30b02a"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream1.xml-p1p41242.bz2": {"num_bytes": 258112319, "checksum": "2dc8a3486a6f87144088fee79f11e8ab63ddcdb4f0ac1c154c4b7659a17a9459"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream2.xml-p41243p151573.bz2": {"num_bytes": 347436304, "checksum": "0dfd7823e7b4ebd8429cf85e97497510cde812a5548377b820ebe6f5486f5aa3"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream3.xml-p151574p311329.bz2": {"num_bytes": 375706949, "checksum": "5aecabceaadbbbb53b69c90f282386ea578d20c2a3a814b650b892dbe500b99d"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream4.xml-p311330p558391.bz2": {"num_bytes": 418339550, "checksum": "953ebbdfbe82da5bf1d4ca5e2b672a8e8ad808de109d51b0df802684a5ff2a3a"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream5.xml-p558392p958045.bz2": {"num_bytes": 449928655, "checksum": "b7f550733c5761f0501da1ed66fdd94734fe79ef45de6006feee8203f64a9d82"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream6.xml-p958046p1483661.bz2": {"num_bytes": 482922823, "checksum": "079c671fabd3cc980caf81a36d4a713870f52e6c08d29e61f14573f6c51cd575"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream7.xml-p1483662p2134111.bz2": {"num_bytes": 497056081, "checksum": "5b2b39b4e19f7002fa4e8268ddb0a07dc6155abffe9ef57147f234137efd7d5b"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream8.xml-p2134112p2936260.bz2": {"num_bytes": 510496509, "checksum": "bfa735ba6d36d2a6cd34a84f2e8247fb34fa591b9397e4cf970bbae0ae31c402"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream9.xml-p2936261p4045402.bz2": {"num_bytes": 554747284, "checksum": "fd77d269455f5b80e5305a46b1fbd32d5e6e11bda9eb5a55a438a40754ecbfc5"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream10.xml-p4045403p5399366.bz2": {"num_bytes": 547359425, "checksum": "c06f7a46486ee79dd77e754f5a9f683feea7efc24a95d8c3dc57c03036df6e27"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream11.xml-p5399367p6899366.bz2": {"num_bytes": 532372567, "checksum": "4e37537149e81de0cb427713f4548f3fd513abcb3ee4c1ba6d1a678f5243674f"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream11.xml-p6899367p7054859.bz2": {"num_bytes": 50936280, "checksum": "f5576b58539b4994ea1e1789eb099a7b12784e1a8391e5b49a9839f3e34a1530"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream12.xml-p7054860p8554859.bz2": {"num_bytes": 442668915, "checksum": "9d839333b495b0045074f748b4fefefbae48c81ac5d379736da733f4afa309c6"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream12.xml-p8554860p9172788.bz2": {"num_bytes": 179217172, "checksum": "72aeb74de6c53cf5190e6ada753f9d393b1a711b38457ccf319c8ddd7814e22f"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream13.xml-p9172789p10672788.bz2": {"num_bytes": 361353438, "checksum": "1e6ea8be75b00d8616038e28fcfc467cac04af4706fe29ff83eb29d649b8b12c"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream13.xml-p10672789p11659682.bz2": {"num_bytes": 250734861, "checksum": "280733424957f639f604af62091957e8a24cf97b7d9a84e77c5de997c4edebe7"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream14.xml-p11659683p13159682.bz2": {"num_bytes": 434903039, "checksum": "4caa451919b193b88d4f487c8b48859e6f5034a5124a81789b53f8b1ea9d506e"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream14.xml-p13159683p14324602.bz2": {"num_bytes": 299923606, "checksum": "943c0829c25787e90ab661d60045acc6036af59f5c0ec55e9b447ca57e9bc7da"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream15.xml-p14324603p15824602.bz2": {"num_bytes": 391508419, "checksum": "d8319556e7a0eea76c7e867a5fc89d794cc04faf09d1f6b4a469c5f77b2d2cb2"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream15.xml-p15824603p17324602.bz2": {"num_bytes": 340212461, "checksum": "ead4d0b65f5691bb548a367c71047a291d37339790d1cb2b72cf5c9c2a3acfff"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream15.xml-p17324603p17460152.bz2": {"num_bytes": 30829930, "checksum": "8074a6f6a955bb0d2cb673ca877318601075ac8929d45c0180ae841bd1d379af"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream16.xml-p17460153p18960152.bz2": {"num_bytes": 370023231, "checksum": "0badfcf8df1e1b58532328d7c61c3878292d067dfb67d54060487add07833c2b"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream16.xml-p18960153p20460152.bz2": {"num_bytes": 345207815, "checksum": "8451c30d521b7bf53bfe49ecb2c358ada38ce1f3e55c45fc469f6f37739a2574"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream16.xml-p20460153p20570392.bz2": {"num_bytes": 25174733, "checksum": "be62d7ae6610a97a1717eb60ab58f5fd7776947d969e2598ea007013568a79df"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream17.xml-p20570393p22070392.bz2": {"num_bytes": 383922926, "checksum": "5b96f2866cb437a64aea5d20543febc272afe18584ba7b79bc4ebf14635adf36"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream17.xml-p22070393p23570392.bz2": {"num_bytes": 395730986, "checksum": "305218b0aaaef636e3eb40fbfde2793d9ebd9cf5eb96647221afaefe2ce119d6"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream17.xml-p23570393p23716197.bz2": {"num_bytes": 43963524, "checksum": "81c83d54a090bf49686ddcd8f1f22139e33acc56f1a00dd07d7106796b30b633"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream18.xml-p23716198p25216197.bz2": {"num_bytes": 409278549, "checksum": "fa78f2abda80bfee6fea37776c992ed1624627ad45fec16a8b95a3d86df205f1"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream18.xml-p25216198p26716197.bz2": {"num_bytes": 376434754, "checksum": "e187998729da4cf3d2a488e1248489088813d2cac115ebf8ffa77d808f004855"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream18.xml-p26716198p27121850.bz2": {"num_bytes": 95921864, "checksum": "2e776ac9098e1a29e8abc9d91ba33dea15611d67894da5501428c29035f8763f"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream19.xml-p27121851p28621850.bz2": {"num_bytes": 369897015, "checksum": "fd06a648a1cc191dcbf50f9cc9eb5982e84d474b76756fb4896de0a59225beb1"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream19.xml-p28621851p30121850.bz2": {"num_bytes": 325337029, "checksum": "6b509456118d57b9f37d35d296f0f598bcadb7771526b1985ecbd7c8eb8b55b7"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream19.xml-p30121851p31308442.bz2": {"num_bytes": 304960559, "checksum": "6621795c2a7e588a9143a5475d85768b337f0f9d5a0f82cafffd6dd33785dbda"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream20.xml-p31308443p32808442.bz2": {"num_bytes": 413948944, "checksum": "a0d1bf068c492927bf146b3a64638fd4ef875d3e5b6882533bfc394dca2c55d9"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream20.xml-p32808443p34308442.bz2": {"num_bytes": 380386475, "checksum": "8c32652a614c4ad51c3b959b0aee64721e028f017b1f10f33915f67bb4541a0a"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream20.xml-p34308443p35522432.bz2": {"num_bytes": 280075938, "checksum": "dc27c76f45e5ff1ae3f0b96de2d270736dd9741840245410bd76eedea9e7fe37"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream21.xml-p35522433p37022432.bz2": {"num_bytes": 385640399, "checksum": "5b98ffac90fc138cc775c999e57ca6a9d77053ae03f82e7280ac0332e0aa8ce4"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream21.xml-p37022433p38522432.bz2": {"num_bytes": 372653931, "checksum": "4117d06b710a4b6cd4b6f83d4879bf7dbda8b371b526380836484e870fb7e1b2"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream21.xml-p38522433p39996245.bz2": {"num_bytes": 377877693, "checksum": "cdbd3b4832c5cc490748beaa4813c0a7d2e48d8430fc879014052b4868db9464"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream22.xml-p39996246p41496245.bz2": {"num_bytes": 371485741, "checksum": "d93248360867b2bdf8e41fa95ef139283d8194eefc69368189faef4b59864492"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream22.xml-p41496246p42996245.bz2": {"num_bytes": 381901960, "checksum": "74eca8a454787e231d60299a458f6056e9319827423e8df26338fb703e2f7db7"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream22.xml-p42996246p44496245.bz2": {"num_bytes": 387633014, "checksum": "9eaf8cd27f95027d90a35821f939a88f1da24ab83d8f8285cd078b08a35a4c77"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream22.xml-p44496246p44788941.bz2": {"num_bytes": 61111911, "checksum": "47a415014e9ca4f99336d4611bcbfcfd51be1436b583cbb14b22bf33a8f88c80"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream23.xml-p44788942p46288941.bz2": {"num_bytes": 248594177, "checksum": "322705c1782165a29c235226243debe97b10cd810765a09753ade172cd71eb91"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream23.xml-p46288942p47788941.bz2": {"num_bytes": 397742843, "checksum": "6badb8a7ed44b27a5d39b6f9265281f8ef8c2cc4b8452d5cd91d96f42e26263b"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream23.xml-p47788942p49288941.bz2": {"num_bytes": 332850442, "checksum": "bc9c9feeac8d525093720a9581512ff4fd1e86b8ad5ccff9e2d86afd8e4f45c5"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream23.xml-p49288942p50564553.bz2": {"num_bytes": 262134661, "checksum": "e83e4a6a033bc04ad4ac2771be8aec4a5ebc45d457cb61d34aedb2f79593a238"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream24.xml-p50564554p52064553.bz2": {"num_bytes": 356285691, "checksum": "0b6281c187801f7aa66f90cf623b56edcf57f45940b0b8385ac6ef9bc4c6f856"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream24.xml-p52064554p53564553.bz2": {"num_bytes": 355189066, "checksum": "ad1e0c4052e6ec7f8fbee1db7898a015df3621feeb2c6e90fd60b62b31136d86"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream24.xml-p53564554p55064553.bz2": {"num_bytes": 340505087, "checksum": "4e71603b9e81e49c95086d2fe6aaeb99bea95560ac0c06ead37b7fd3dd423620"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream24.xml-p55064554p56564553.bz2": {"num_bytes": 358134041, "checksum": "7aa29ba9da137f8c33530fae34cb2f7d33b60f9ccb114e4094c1c178dc47a800"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream24.xml-p56564554p57025655.bz2": {"num_bytes": 112854213, "checksum": "9d2aa9435d06303c7e477ba5e9fb01a2d6cc1b4050a1a4b6cfcd26bd582d3d00"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream25.xml-p57025656p58525655.bz2": {"num_bytes": 368228982, "checksum": "2497b38c84ab8ec355f60385884f116032e9dea866d86818ea19306fdda90389"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream25.xml-p58525656p60025655.bz2": {"num_bytes": 330207424, "checksum": "79fda40841fb8234b5794425dfe246f5e250cb0bb11bf07f0653f97f80864aaf"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream25.xml-p60025656p61525655.bz2": {"num_bytes": 365614799, "checksum": "b428cf877bae7686601a811c797e221e414e41bc56ccec4e64fd4faf83b70568"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream25.xml-p61525656p62585850.bz2": {"num_bytes": 253055775, "checksum": "7ab490880c479c7aa7a9a734ee48d294c220fd3e67315b719e23bc8866071252"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream26.xml-p62585851p63975909.bz2": {"num_bytes": 369883871, "checksum": "6ac3e25764a816f7d201a46af54ef8bc60d2b139ae9226e303d002dfa460b968"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream27.xml-p63975910p65475909.bz2": {"num_bytes": 333644957, "checksum": "9c29a1bc6199440a49b3b95987e66a049767d42330fda681336e33f42bd42bb6"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream27.xml-p65475910p66975909.bz2": {"num_bytes": 361537200, "checksum": "6383dacbf2a21c3ef84ceaf5c23314f869c864935a2a9c856a8edc9553eaef66"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream27.xml-p66975910p68475909.bz2": {"num_bytes": 385365490, "checksum": "7e312fbbfec9473530796e550a7a5b106849b9653c255dc18cb1461a960b87e7"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream27.xml-p68475910p69975909.bz2": {"num_bytes": 396726943, "checksum": "576197dc5b086a8f46c74162237c8abffd92f05a55eddf1692de15186c67e1fa"}, "https://dumps.wikimedia.org/enwiki/20220301/enwiki-20220301-pages-articles-multistream27.xml-p69975910p70201969.bz2": {"num_bytes": 53906320, "checksum": "fbba55ac845a639c787e365cd903637c9b89f3df31564f0c4668a51094ed03ad"}}, "download_size": 20598313936, "post_processing_size": null, "dataset_size": 20275516160, "size_in_bytes": 40873830096}, "20220301.fr": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.fr", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7375920768, "num_examples": 2402095, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/frwiki/20220301/dumpstatus.json": {"num_bytes": 105721, "checksum": "e87fb482002c2bff2e3c738704e49c28636cba7a5612ffdf9e6ce9069d8913ee"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream1.xml-p1p306134.bz2": {"num_bytes": 591104142, "checksum": "761729cb32274f94a6202a592766bc4069bf51199ab64af48abd3d368c51e594"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream2.xml-p306135p1050822.bz2": {"num_bytes": 663004215, "checksum": "bd29d4b68138d7bac285e65c3c20bb1a96479eb34feb7b46cbb8d66b5b023586"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream3.xml-p1050823p2550822.bz2": {"num_bytes": 562426077, "checksum": "d0fe6f2915f631dc5c3a392859232da9cd3b23a2e07e62b3ba92d2dcbcb8eaae"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream3.xml-p2550823p2977214.bz2": {"num_bytes": 149106511, "checksum": "84e4b3341cd09f16f14fa1d3f205a7052b0170a994131ab31b3f9fbce8ea91e1"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream4.xml-p2977215p4477214.bz2": {"num_bytes": 570306664, "checksum": "30f317d478baedb5b12f9bac9ebbd432a490259201a593cc89968d56c03d9351"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream4.xml-p4477215p5202073.bz2": {"num_bytes": 278393035, "checksum": "0d5f2841b62f0a73214ddff37873a6a437c7dc3123a7ce85cfa1ce212c61142d"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream5.xml-p5202074p6702073.bz2": {"num_bytes": 538681585, "checksum": "8d4bd2dfb68df9c7692de2fb75f5659256fc1af7b4bb9dc0c15e29e3e15dd5e4"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream5.xml-p6702074p8202073.bz2": {"num_bytes": 450708819, "checksum": "3e9629a38e089f4f1b36c80a6acbea57f6db2dbfaea306abfd97a3c822b0faca"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream5.xml-p8202074p9074283.bz2": {"num_bytes": 180668756, "checksum": "8bcf57d4f8d9bfff415c32b69a2583235638550a229f163f5f358bf7b0647474"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream6.xml-p9074284p10574283.bz2": {"num_bytes": 415725199, "checksum": "87dd3b1feee0eb2e3f479d6f875d4eaa84218d777956e3553a9a8f4fcae94f34"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream6.xml-p10574284p12074283.bz2": {"num_bytes": 401653810, "checksum": "7877ffa64389fc7159c688d04d9aca89a80010259a602bc2d416a4bf2e5f03b7"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream6.xml-p12074284p13574283.bz2": {"num_bytes": 456457056, "checksum": "fb0b7078931f2fd03243b146166ebe0d1a09ad203413fa1229b788fba3007139"}, "https://dumps.wikimedia.org/frwiki/20220301/frwiki-20220301-pages-articles-multistream6.xml-p13574284p14821802.bz2": {"num_bytes": 344223684, "checksum": "62061c80d80f2e19622d9109a0ec1cd6a1447f92ca70ee988c993f8e5353952e"}}, "download_size": 5602565274, "post_processing_size": null, "dataset_size": 7375920768, "size_in_bytes": 12978486042}, "20220301.frr": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.frr", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 9129760, "num_examples": 15199, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/frrwiki/20220301/dumpstatus.json": {"num_bytes": 11330, "checksum": "4a2e855bedb6a339fac9ab6eddaccc6927267df590196725238ef5d58490c77d"}, "https://dumps.wikimedia.org/frrwiki/20220301/frrwiki-20220301-pages-articles-multistream.xml.bz2": {"num_bytes": 12426687, "checksum": "3d7c76a452d25ae633c89880006e6f09c377c02a12c09326f710899fe61fcf26"}}, "download_size": 12438017, "post_processing_size": null, "dataset_size": 9129760, "size_in_bytes": 21567777}, "20220301.it": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.it", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4539944448, "num_examples": 1743035, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/itwiki/20220301/dumpstatus.json": {"num_bytes": 72047, "checksum": "bbea1ec508a29c100db90d7d8a4a16bd81d6eadba7f0ecfa25431f1d72f339c3"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream1.xml-p1p316052.bz2": {"num_bytes": 306248227, "checksum": "6642d994f399f0860243de003e5681d1c9fff916162b36775709e4aaaaeff858"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream2.xml-p316053p1204973.bz2": {"num_bytes": 423186063, "checksum": "080af4d28d65809037963143b5b7f2fe9a68c05b21ced34d598745688118adf8"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream3.xml-p1204974p2206774.bz2": {"num_bytes": 483626055, "checksum": "24b1efcedff36547c7a42a474ba133e044a7d15de0bd0f831a02409ef7795734"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream4.xml-p2206775p3593336.bz2": {"num_bytes": 586265474, "checksum": "11a0f8350fa5d2439b2d36074d49045ec9838abdc13814d8eb524a258cb490db"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream5.xml-p3593337p5093336.bz2": {"num_bytes": 581856227, "checksum": "fa8da146836d3116f3d464a716428588a53c42b30607048c65553e75560f693d"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream5.xml-p5093337p5915379.bz2": {"num_bytes": 244580638, "checksum": "facc73f8bb5a326e65083ef1e083bca0faa74e63e9ab2e0c99c111078bebf05e"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream6.xml-p5915380p7415379.bz2": {"num_bytes": 312145545, "checksum": "fa885a11228722027db74f9e33a28022b38637cc290ce25b1bf9cce8bc0b53a8"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream6.xml-p7415380p8915379.bz2": {"num_bytes": 455006641, "checksum": "a30ca223f83d3bc77b9297648e6573d40165fe2cc238f733eb091444ad1afdd0"}, "https://dumps.wikimedia.org/itwiki/20220301/itwiki-20220301-pages-articles-multistream6.xml-p8915380p9319766.bz2": {"num_bytes": 123454322, "checksum": "6ca6dd370278363d0e55e394864476ae7e70cf42503a6572c546cf9ec6b6328e"}}, "download_size": 3516441239, "post_processing_size": null, "dataset_size": 4539944448, "size_in_bytes": 8056385687}, "20220301.simple": {"description": "Wikipedia dataset containing cleaned articles of all languages.\nThe datasets are built from the Wikipedia dump\n(https://dumps.wikimedia.org/) with one split per language. Each example\ncontains the content of one full Wikipedia article with cleaning to strip\nmarkdown and unwanted sections (references, etc.).\n", "citation": "@ONLINE {wikidump,\n author = {Wikimedia Foundation},\n title = {Wikimedia Downloads},\n url = {https://dumps.wikimedia.org}\n}\n", "homepage": "https://dumps.wikimedia.org", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "wikipedia", "config_name": "20220301.simple", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 235072360, "num_examples": 205328, "dataset_name": "wikipedia"}}, "download_checksums": {"https://dumps.wikimedia.org/simplewiki/20220301/dumpstatus.json": {"num_bytes": 11707, "checksum": "2f2690e9f8bb87cfc13ca0d12316454986f7874605acb56401b681b0d1fed6d0"}, "https://dumps.wikimedia.org/simplewiki/20220301/simplewiki-20220301-pages-articles-multistream.xml.bz2": {"num_bytes": 239671089, "checksum": "9b979865f771b927e587ff1f92578d3f526125569f853b717ab5158f1d02a7c0"}}, "download_size": 239682796, "post_processing_size": null, "dataset_size": 235072360, "size_in_bytes": 474755156}}
wikipedia/wikipedia.py ADDED
@@ -0,0 +1,1115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Wikipedia dataset containing cleaned articles of all languages."""
18
+
19
+
20
+ import bz2
21
+ import codecs
22
+ import json
23
+ import re
24
+ import xml.etree.cElementTree as etree
25
+ from urllib.parse import quote
26
+ import mwparserfromhell
27
+ from multiprocess import Process, Manager
28
+ from tqdm import tqdm
29
+
30
+ import datasets
31
+
32
+
33
+ logger = datasets.logging.get_logger(__name__)
34
+
35
+
36
+ _CITATION = """\
37
+ @ONLINE {wikidump,
38
+ author = {Wikimedia Foundation},
39
+ title = {Wikimedia Downloads},
40
+ url = {https://dumps.wikimedia.org}
41
+ }
42
+ """
43
+
44
+ _DESCRIPTION = """\
45
+ Wikipedia dataset containing cleaned articles of all languages.
46
+ The datasets are built from the Wikipedia dump
47
+ (https://dumps.wikimedia.org/) with one split per language. Each example
48
+ contains the content of one full Wikipedia article with cleaning to strip
49
+ markdown and unwanted sections (references, etc.).
50
+ """
51
+
52
+ _LICENSE = (
53
+ "This work is licensed under the Creative Commons Attribution-ShareAlike "
54
+ "3.0 Unported License. To view a copy of this license, visit "
55
+ "http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to "
56
+ "Creative Commons, PO Box 1866, Mountain View, CA 94042, USA."
57
+ )
58
+
59
+ # Source: https://en.wikipedia.org/wiki/List_of_Wikipedias (accessed 3/1/2019)
60
+ # Removed because no articles: hz.
61
+ WIKIPEDIA_LANGUAGES = [
62
+ "aa",
63
+ "ab",
64
+ "ace",
65
+ "ady",
66
+ "af",
67
+ "ak",
68
+ "als",
69
+ "am",
70
+ "an",
71
+ "ang",
72
+ "ar",
73
+ "arc",
74
+ "arz",
75
+ "as",
76
+ "ast",
77
+ "atj",
78
+ "av",
79
+ "ay",
80
+ "az",
81
+ "azb",
82
+ "ba",
83
+ "bar",
84
+ "bat-smg",
85
+ "bcl",
86
+ "be",
87
+ "be-x-old",
88
+ "bg",
89
+ "bh",
90
+ "bi",
91
+ "bjn",
92
+ "bm",
93
+ "bn",
94
+ "bo",
95
+ "bpy",
96
+ "br",
97
+ "bs",
98
+ "bug",
99
+ "bxr",
100
+ "ca",
101
+ "cbk-zam",
102
+ "cdo",
103
+ "ce",
104
+ "ceb",
105
+ "ch",
106
+ "cho",
107
+ "chr",
108
+ "chy",
109
+ "ckb",
110
+ "co",
111
+ "cr",
112
+ "crh",
113
+ "cs",
114
+ "csb",
115
+ "cu",
116
+ "cv",
117
+ "cy",
118
+ "da",
119
+ "de",
120
+ "din",
121
+ "diq",
122
+ "dsb",
123
+ "dty",
124
+ "dv",
125
+ "dz",
126
+ "ee",
127
+ "el",
128
+ "eml",
129
+ "en",
130
+ "eo",
131
+ "es",
132
+ "et",
133
+ "eu",
134
+ "ext",
135
+ "fa",
136
+ "ff",
137
+ "fi",
138
+ "fiu-vro",
139
+ "fj",
140
+ "fo",
141
+ "fr",
142
+ "frp",
143
+ "frr",
144
+ "fur",
145
+ "fy",
146
+ "ga",
147
+ "gag",
148
+ "gan",
149
+ "gd",
150
+ "gl",
151
+ "glk",
152
+ "gn",
153
+ "gom",
154
+ "gor",
155
+ "got",
156
+ "gu",
157
+ "gv",
158
+ "ha",
159
+ "hak",
160
+ "haw",
161
+ "he",
162
+ "hi",
163
+ "hif",
164
+ "ho",
165
+ "hr",
166
+ "hsb",
167
+ "ht",
168
+ "hu",
169
+ "hy",
170
+ "ia",
171
+ "id",
172
+ "ie",
173
+ "ig",
174
+ "ii",
175
+ "ik",
176
+ "ilo",
177
+ "inh",
178
+ "io",
179
+ "is",
180
+ "it",
181
+ "iu",
182
+ "ja",
183
+ "jam",
184
+ "jbo",
185
+ "jv",
186
+ "ka",
187
+ "kaa",
188
+ "kab",
189
+ "kbd",
190
+ "kbp",
191
+ "kg",
192
+ "ki",
193
+ "kj",
194
+ "kk",
195
+ "kl",
196
+ "km",
197
+ "kn",
198
+ "ko",
199
+ "koi",
200
+ "krc",
201
+ "ks",
202
+ "ksh",
203
+ "ku",
204
+ "kv",
205
+ "kw",
206
+ "ky",
207
+ "la",
208
+ "lad",
209
+ "lb",
210
+ "lbe",
211
+ "lez",
212
+ "lfn",
213
+ "lg",
214
+ "li",
215
+ "lij",
216
+ "lmo",
217
+ "ln",
218
+ "lo",
219
+ "lrc",
220
+ "lt",
221
+ "ltg",
222
+ "lv",
223
+ "mai",
224
+ "map-bms",
225
+ "mdf",
226
+ "mg",
227
+ "mh",
228
+ "mhr",
229
+ "mi",
230
+ "min",
231
+ "mk",
232
+ "ml",
233
+ "mn",
234
+ "mr",
235
+ "mrj",
236
+ "ms",
237
+ "mt",
238
+ "mus",
239
+ "mwl",
240
+ "my",
241
+ "myv",
242
+ "mzn",
243
+ "na",
244
+ "nah",
245
+ "nap",
246
+ "nds",
247
+ "nds-nl",
248
+ "ne",
249
+ "new",
250
+ "ng",
251
+ "nl",
252
+ "nn",
253
+ "no",
254
+ "nov",
255
+ "nrm",
256
+ "nso",
257
+ "nv",
258
+ "ny",
259
+ "oc",
260
+ "olo",
261
+ "om",
262
+ "or",
263
+ "os",
264
+ "pa",
265
+ "pag",
266
+ "pam",
267
+ "pap",
268
+ "pcd",
269
+ "pdc",
270
+ "pfl",
271
+ "pi",
272
+ "pih",
273
+ "pl",
274
+ "pms",
275
+ "pnb",
276
+ "pnt",
277
+ "ps",
278
+ "pt",
279
+ "qu",
280
+ "rm",
281
+ "rmy",
282
+ "rn",
283
+ "ro",
284
+ "roa-rup",
285
+ "roa-tara",
286
+ "ru",
287
+ "rue",
288
+ "rw",
289
+ "sa",
290
+ "sah",
291
+ "sat",
292
+ "sc",
293
+ "scn",
294
+ "sco",
295
+ "sd",
296
+ "se",
297
+ "sg",
298
+ "sh",
299
+ "si",
300
+ "simple",
301
+ "sk",
302
+ "sl",
303
+ "sm",
304
+ "sn",
305
+ "so",
306
+ "sq",
307
+ "sr",
308
+ "srn",
309
+ "ss",
310
+ "st",
311
+ "stq",
312
+ "su",
313
+ "sv",
314
+ "sw",
315
+ "szl",
316
+ "ta",
317
+ "tcy",
318
+ "te",
319
+ "tet",
320
+ "tg",
321
+ "th",
322
+ "ti",
323
+ "tk",
324
+ "tl",
325
+ "tn",
326
+ "to",
327
+ "tpi",
328
+ "tr",
329
+ "ts",
330
+ "tt",
331
+ "tum",
332
+ "tw",
333
+ "ty",
334
+ "tyv",
335
+ "udm",
336
+ "ug",
337
+ "uk",
338
+ "ur",
339
+ "uz",
340
+ "ve",
341
+ "vec",
342
+ "vep",
343
+ "vi",
344
+ "vls",
345
+ "vo",
346
+ "wa",
347
+ "war",
348
+ "wo",
349
+ "wuu",
350
+ "xal",
351
+ "xh",
352
+ "xmf",
353
+ "yi",
354
+ "yo",
355
+ "za",
356
+ "zea",
357
+ "zh",
358
+ "zh-classical",
359
+ "zh-min-nan",
360
+ "zh-yue",
361
+ "zu",
362
+ ]
363
+
364
+ # Source: for each Wikipedia language code (example shown for "ab"), aliases for namespaces -2 and 6 accessed via this API call:
365
+ # https://ab.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespacealiases|namespaces&format=json&formatversion=2 (accessed 12/21/2021)
366
+ MEDIA_ALIASES = {
367
+ "ab": ["Медиа", "Файл", "Афаил", "Амедиа", "Изображение"],
368
+ "ace": ["Beureukaih", "Gambar", "Alat", "Berkas"],
369
+ "ady": ["Медиа"],
370
+ "af": ["Lêer", "Beeld"],
371
+ "als": ["Medium", "Datei", "Bild"],
372
+ "am": ["ፋይል", "ስዕል"],
373
+ "an": ["Imachen", "Imagen"],
374
+ "ang": ["Ymele", "Biliþ"],
375
+ "ar": ["ميديا", "صورة", "وسائط", "ملف"],
376
+ "arc": ["ܠܦܦܐ", "ܡܝܕܝܐ"],
377
+ "arz": ["ميديا", "صورة", "وسائط", "ملف"],
378
+ "as": ["চিত্ৰ", "चित्र", "চিত্র", "মাধ্যম"],
379
+ "ast": ["Imaxen", "Ficheru", "Imaxe", "Archivu", "Imagen", "Medios"],
380
+ "atj": ["Tipatcimoctakewin", "Natisinahikaniwoc"],
381
+ "av": ["Медиа", "Файл", "Изображение"],
382
+ "ay": ["Medio", "Archivo", "Imagen"],
383
+ "az": ["Mediya", "Şəkil", "Fayl"],
384
+ "azb": ["رسانه", "تصویر", "مدیا", "فایل", "رسانه‌ای"],
385
+ "ba": ["Медиа", "Рәсем", "Файл", "Изображение"],
386
+ "bar": ["Medium", "Datei", "Bild"],
387
+ "bat-smg": ["Vaizdas", "Medėjė", "Abruozdielis"],
388
+ "bcl": ["Medio", "Ladawan"],
389
+ "be": ["Мультымедыя", "Файл", "Выява"],
390
+ "be-x-old": ["Мэдыя", "Файл", "Выява"],
391
+ "bg": ["Медия", "Файл", "Картинка"],
392
+ "bh": ["मीडिया", "चित्र"],
393
+ "bjn": ["Barakas", "Gambar", "Berkas"],
394
+ "bm": ["Média", "Fichier"],
395
+ "bn": ["চিত্র", "মিডিয়া"],
396
+ "bpy": ["ছবি", "মিডিয়া"],
397
+ "br": ["Skeudenn", "Restr"],
398
+ "bs": ["Mediji", "Slika", "Datoteka", "Medija"],
399
+ "bug": ["Gambar", "Berkas"],
400
+ "bxr": ["Файл", "Меди", "Изображение"],
401
+ "ca": ["Fitxer", "Imatge"],
402
+ "cbk-zam": ["Medio", "Archivo", "Imagen"],
403
+ "cdo": ["文件", "媒體", "圖像", "檔案"],
404
+ "ce": ["Хlум", "Медиа", "Сурт", "Файл", "Медйа", "Изображение"],
405
+ "ceb": ["Payl", "Medya", "Imahen"],
406
+ "ch": ["Litratu"],
407
+ "ckb": ["میدیا", "پەڕگە"],
408
+ "co": ["Immagine"],
409
+ "crh": ["Медиа", "Resim", "Файл", "Fayl", "Ресим"],
410
+ "cs": ["Soubor", "Média", "Obrázok"],
411
+ "csb": ["Òbrôzk", "Grafika"],
412
+ "cu": ["Видъ", "Ви́дъ", "Дѣло", "Срѣдьства"],
413
+ "cv": ["Медиа", "Ӳкерчĕк", "Изображение"],
414
+ "cy": ["Delwedd"],
415
+ "da": ["Billede", "Fil"],
416
+ "de": ["Medium", "Datei", "Bild"],
417
+ "din": ["Ciɛl", "Apamduööt"],
418
+ "diq": ["Medya", "Dosya"],
419
+ "dsb": ["Wobraz", "Dataja", "Bild", "Medija"],
420
+ "dty": ["चित्र", "मिडिया"],
421
+ "dv": ["ފައިލު", "މީޑިއާ", "ފައިލް"],
422
+ "el": ["Εικόνα", "Αρχείο", "Μέσο", "Μέσον"],
423
+ "eml": ["Immagine"],
424
+ "eo": ["Dosiero", "Aŭdvidaĵo"],
425
+ "es": ["Medio", "Archivo", "Imagen"],
426
+ "et": ["Pilt", "Fail", "Meedia"],
427
+ "eu": ["Irudi", "Fitxategi"],
428
+ "ext": ["Archivu", "Imagen", "Mediu"],
429
+ "fa": ["رسانه", "تصویر", "مدیا", "پرونده", "رسانه‌ای"],
430
+ "ff": ["Média", "Fichier"],
431
+ "fi": ["Kuva", "Tiedosto"],
432
+ "fiu-vro": ["Pilt", "Meediä"],
433
+ "fo": ["Miðil", "Mynd"],
434
+ "fr": ["Média", "Fichier"],
435
+ "frp": ["Émâge", "Fichiér", "Mèdia"],
436
+ "frr": ["Medium", "Datei", "Bild"],
437
+ "fur": ["Immagine", "Figure"],
438
+ "fy": ["Ofbyld"],
439
+ "ga": ["Íomhá", "Meán"],
440
+ "gag": ["Mediya", "Medya", "Resim", "Dosya", "Dosye"],
441
+ "gan": ["媒体文件", "文件", "文檔", "档案", "媒體", "图像", "圖像", "媒体", "檔案"],
442
+ "gd": ["Faidhle", "Meadhan"],
443
+ "gl": ["Imaxe", "Ficheiro", "Arquivo", "Imagem"],
444
+ "glk": ["رسانه", "تصویر", "پرونده", "فاىل", "رسانه‌ای", "مديا"],
445
+ "gn": ["Medio", "Imagen", "Ta'ãnga"],
446
+ "gom": ["माध्यम", "मिडिया", "फायल"],
447
+ "gor": ["Gambar", "Berkas"],
448
+ "got": ["𐍆𐌴𐌹𐌻𐌰"],
449
+ "gu": ["દ્રશ્ય-શ્રાવ્ય (મિડિયા)", "દ્રશ્ય-શ્રાવ્ય_(મિડિયા)", "ચિત્ર"],
450
+ "gv": ["Coadan", "Meanyn"],
451
+ "hak": ["文件", "媒體", "圖像", "檔案"],
452
+ "haw": ["Kiʻi", "Waihona", "Pāpaho"],
453
+ "he": ["תמונה", "קו", "מדיה", "קובץ"],
454
+ "hi": ["मीडिया", "चित्र"],
455
+ "hif": ["file", "saadhan"],
456
+ "hr": ["Mediji", "DT", "Slika", "F", "Datoteka"],
457
+ "hsb": ["Wobraz", "Dataja", "Bild"],
458
+ "ht": ["Imaj", "Fichye", "Medya"],
459
+ "hu": ["Kép", "Fájl", "Média"],
460
+ "hy": ["Պատկեր", "Մեդիա"],
461
+ "ia": ["Imagine", "Multimedia"],
462
+ "id": ["Gambar", "Berkas"],
463
+ "ig": ["Nká", "Midia", "Usòrò", "Ákwúkwó orünotu", "Ákwúkwó_orünotu"],
464
+ "ii": ["媒体文件", "文件", "档案", "图像", "媒体"],
465
+ "ilo": ["Midia", "Papeles"],
466
+ "inh": ["Медиа", "Файл", "Изображение"],
467
+ "io": ["Imajo", "Arkivo"],
468
+ "is": ["Miðill", "Mynd"],
469
+ "it": ["Immagine"],
470
+ "ja": ["メディア", "ファイル", "画像"],
471
+ "jbo": ["velsku", "datnyvei"],
472
+ "jv": ["Barkas", "Medhia", "Gambar", "Médhia"],
473
+ "ka": ["მედია", "სურათი", "ფაილი"],
474
+ "kaa": ["Swret", "Таспа", "سۋرەت", "Taspa", "Su'wret", "Сурет", "تاسپا"],
475
+ "kab": ["Tugna"],
476
+ "kbd": ["Медиа", "Файл"],
477
+ "kbp": ["Média", "Fichier"],
478
+ "kg": ["Fisye"],
479
+ "kk": ["Swret", "سۋرەت", "Таспа", "Taspa", "Сурет", "تاسپا"],
480
+ "kl": ["Billede", "Fiileq", "Fil"],
481
+ "km": ["ឯកសារ", "រូបភាព", "មេឌា", "មីឌា"],
482
+ "kn": ["ಚಿತ್ರ", "ಮೀಡಿಯ"],
483
+ "ko": ["미디어", "파일", "그림"],
484
+ "koi": ["Медиа", "Файл", "Изображение"],
485
+ "krc": ["Медиа", "Файл", "Изображение"],
486
+ "ks": ["میڈیا", "فَیِل"],
487
+ "ksh": ["Beld", "Meedije", "Medie", "Belld", "Medium", "Datei", "Meedijum", "Bild"],
488
+ "ku": ["میدیا", "پەڕگە", "Medya", "Wêne"],
489
+ "kv": ["Медиа", "Файл", "Изображение"],
490
+ "kw": ["Restren"],
491
+ "ky": ["Медиа", "Файл"],
492
+ "la": ["Imago", "Fasciculus"],
493
+ "lad": ["Dossia", "Medya", "Archivo", "Dosya", "Imagen", "Meddia"],
494
+ "lb": ["Fichier", "Bild"],
495
+ "lbe": ["Медиа", "Сурат", "Изображение"],
496
+ "lez": ["Медиа", "Mediya", "Файл", "Şəkil", "Изображение"],
497
+ "lfn": ["Fix"],
498
+ "li": ["Afbeelding", "Plaetje", "Aafbeilding"],
499
+ "lij": ["Immaggine", "Immagine"],
500
+ "lmo": ["Immagine", "Imàjine", "Archivi"],
501
+ "ln": ["Média", "Fichier"],
502
+ "lo": ["ສື່ອ", "ສື່", "ຮູບ"],
503
+ "lrc": ["رسانه", "تصویر", "رسانه‌ای", "جانیا", "أسگ", "ڤارئسگأر"],
504
+ "lt": ["Vaizdas", "Medija"],
505
+ "ltg": ["Medeja", "Fails"],
506
+ "lv": ["Attēls"],
507
+ "mai": ["मेडिया", "फाइल"],
508
+ "map-bms": ["Barkas", "Medhia", "Gambar", "Médhia"],
509
+ "mdf": ["Медиа", "Няйф", "Изображение"],
510
+ "mg": ["Rakitra", "Sary", "Média"],
511
+ "mhr": ["Медиа", "Файл", "Изображение"],
512
+ "min": ["Gambar", "Berkas"],
513
+ "mk": ["Податотека", "Медија", "Медиум", "Слика"],
514
+ "ml": ["പ്രമാണം", "ചി", "മീഡിയ", "പ്ര", "ചിത്രം"],
515
+ "mn": ["Медиа", "Файл", "Зураг"],
516
+ "mr": ["चित्र", "मिडिया"],
517
+ "mrj": ["Медиа", "Файл", "Изображение"],
518
+ "ms": ["Fail", "Imej"],
519
+ "mt": ["Midja", "Medja", "Stampa"],
520
+ "mwl": ["Multimédia", "Fexeiro", "Ficheiro", "Arquivo", "Imagem"],
521
+ "my": ["ဖိုင်", "မီဒီယာ"],
522
+ "myv": ["Медия", "Артовкс", "Изображение"],
523
+ "mzn": ["رسانه", "تصویر", "مه‌دیا", "مدیا", "پرونده", "رسانه‌ای"],
524
+ "nah": ["Mēdiatl", "Īxiptli", "Imagen"],
525
+ "nap": ["Fiùra", "Immagine"],
526
+ "nds": ["Datei", "Bild"],
527
+ "nds-nl": ["Ofbeelding", "Afbeelding", "Bestaand"],
528
+ "ne": ["मीडिया", "चित्र"],
529
+ "new": ["किपा", "माध्यम"],
530
+ "nl": ["Bestand", "Afbeelding"],
531
+ "nn": ["Fil", "Bilde", "Filpeikar"],
532
+ "no": ["Fil", "Medium", "Bilde"],
533
+ "nov": [],
534
+ "nrm": ["Média", "Fichier"],
535
+ "nso": ["Seswantšho"],
536
+ "nv": ["Eʼelyaaígíí"],
537
+ "oc": ["Imatge", "Fichièr", "Mèdia"],
538
+ "olo": ["Kuva", "Medii", "Failu"],
539
+ "or": ["ମାଧ୍ୟମ", "ଫାଇଲ"],
540
+ "os": ["Ныв", "Медиа", "Файл", "Изображение"],
541
+ "pa": ["ਤਸਵੀਰ", "ਮੀਡੀਆ"],
542
+ "pcd": ["Média", "Fichier"],
543
+ "pdc": ["Medium", "Datei", "Bild", "Feil"],
544
+ "pfl": ["Dadai", "Medium", "Datei", "Bild"],
545
+ "pi": ["मीडिया", "पटिमा"],
546
+ "pl": ["Plik", "Grafika"],
547
+ "pms": ["Figura", "Immagine"],
548
+ "pnb": ["میڈیا", "تصویر", "فائل"],
549
+ "pnt": ["Εικόνα", "Αρχείον", "Εικόναν", "Μέσον"],
550
+ "ps": ["انځور", "رسنۍ", "دوتنه"],
551
+ "pt": ["Multimédia", "Ficheiro", "Arquivo", "Imagem"],
552
+ "qu": ["Midya", "Imagen", "Rikcha"],
553
+ "rm": ["Multimedia", "Datoteca"],
554
+ "rmy": ["Fişier", "Mediya", "Chitro", "Imagine"],
555
+ "ro": ["Fişier", "Imagine", "Fișier"],
556
+ "roa-rup": ["Fişier", "Imagine", "Fișier"],
557
+ "roa-tara": ["Immagine"],
558
+ "ru": ["Медиа", "Файл", "Изображение"],
559
+ "rue": ["Медіа", "Медиа", "Файл", "Изображение", "Зображення"],
560
+ "rw": ["Dosiye", "Itangazamakuru"],
561
+ "sa": ["चित्रम्", "माध्यमम्", "सञ्चिका", "माध्यम", "चित्रं"],
562
+ "sah": ["Миэдьийэ", "Ойуу", "Билэ", "Изображение"],
563
+ "sat": ["ᱨᱮᱫ", "ᱢᱤᱰᱤᱭᱟ"],
564
+ "sc": ["Immàgini"],
565
+ "scn": ["Immagine", "Mmàggini", "Mèdia"],
566
+ "sd": ["عڪس", "ذريعات", "فائل"],
567
+ "se": ["Fiila"],
568
+ "sg": ["Média", "Fichier"],
569
+ "sh": ["Mediji", "Slika", "Медија", "Datoteka", "Medija", "Слика"],
570
+ "si": ["රූපය", "මාධ්‍යය", "ගොනුව"],
571
+ "sk": ["Súbor", "Obrázok", "Médiá"],
572
+ "sl": ["Slika", "Datoteka"],
573
+ "sq": ["Figura", "Skeda"],
574
+ "sr": ["Датотека", "Medij", "Slika", "Медија", "Datoteka", "Медиј", "Medija", "Слика"],
575
+ "srn": ["Afbeelding", "Gefre"],
576
+ "stq": ["Bielde", "Bild"],
577
+ "su": ["Média", "Gambar"],
578
+ "sv": ["Fil", "Bild"],
579
+ "sw": ["Faili", "Picha"],
580
+ "szl": ["Plik", "Grafika"],
581
+ "ta": ["படிமம்", "ஊடகம்"],
582
+ "tcy": ["ಮಾದ್ಯಮೊ", "ಫೈಲ್"],
583
+ "te": ["ఫైలు", "దస్త్రం", "బొమ్మ", "మీడియా"],
584
+ "tet": ["Imajen", "Arquivo", "Imagem"],
585
+ "tg": ["Акс", "Медиа"],
586
+ "th": ["ไฟล์", "สื่อ", "ภาพ"],
587
+ "ti": ["ፋይል", "ሜድያ"],
588
+ "tk": ["Faýl"],
589
+ "tl": ["Midya", "Talaksan"],
590
+ "tpi": ["Fail"],
591
+ "tr": ["Medya", "Resim", "Dosya", "Ortam"],
592
+ "tt": ["Медиа", "Рәсем", "Файл", "Räsem", "Изображение"],
593
+ "ty": ["Média", "Fichier"],
594
+ "tyv": ["Медиа", "Файл", "Изображение"],
595
+ "udm": ["Медиа", "Файл", "Суред", "Изображение"],
596
+ "ug": ["ۋاسىتە", "ھۆججەت"],
597
+ "uk": ["Медіа", "Медиа", "Файл", "Изображение", "Зображення"],
598
+ "ur": ["میڈیا", "تصویر", "وسیط", "زریعہ", "فائل", "ملف"],
599
+ "uz": ["Mediya", "Tasvir", "Fayl"],
600
+ "vec": ["Immagine", "Imàjine", "Mèdia"],
601
+ "vep": ["Pilt", "Fail"],
602
+ "vi": ["Phương_tiện", "Tập_tin", "Hình", "Tập tin", "Phương tiện"],
603
+ "vls": ["Afbeelding", "Ofbeeldienge"],
604
+ "vo": ["Ragiv", "Magod", "Nünamakanäd"],
605
+ "wa": ["Imådje"],
606
+ "war": ["Medya", "Fayl", "Paypay"],
607
+ "wo": ["Xibaarukaay", "Dencukaay"],
608
+ "wuu": ["文件", "档案", "图像", "媒体"],
609
+ "xal": ["Аһар", "Боомг", "Изображение", "Зург"],
610
+ "xmf": ["მედია", "სურათი", "ფაილი"],
611
+ "yi": ["מעדיע", "תמונה", "טעקע", "בילד"],
612
+ "yo": ["Fáìlì", "Amóhùnmáwòrán", "Àwòrán"],
613
+ "za": ["媒体文件", "文件", "档案", "图像", "媒体"],
614
+ "zea": ["Afbeelding", "Plaetje"],
615
+ "zh": ["媒体文件", "F", "文件", "媒體", "档案", "图像", "圖像", "媒体", "檔案"],
616
+ "zh-classical": ["文件", "媒體", "圖像", "檔案"],
617
+ "zh-min-nan": ["tóng-àn", "文件", "媒體", "Mûi-thé", "圖像", "檔案"],
618
+ "zh-yue": ["檔", "档", "文件", "图", "媒體", "圖", "档案", "图像", "圖像", "媒体", "檔案"],
619
+ }
620
+
621
+ # Source: for each Wikipedia language code (example shown for "ab"), aliases for namespace 14 accessed via this API call:
622
+ # https://ab.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespacealiases|namespaces&format=json&formatversion=2 (accessed 12/21/2021)
623
+ CAT_ALIASES = {
624
+ "ab": ["Категория", "Акатегориа"],
625
+ "ace": ["Kawan", "Kategori"],
626
+ "af": ["Kategorie"],
627
+ "ak": ["Nkyekyem"],
628
+ "als": ["Kategorie"],
629
+ "am": ["መደብ"],
630
+ "an": ["Categoría"],
631
+ "ang": ["Flocc"],
632
+ "ar": ["تصنيف"],
633
+ "arc": ["ܣܕܪܐ"],
634
+ "arz": ["تصنيف"],
635
+ "as": ["CAT", "শ্ৰেণী", "श्रेणी", "শ্রেণী"],
636
+ "ast": ["Categoría"],
637
+ "atj": ["Tipanictawin"],
638
+ "av": ["Категория"],
639
+ "ay": ["Categoría"],
640
+ "az": ["Kateqoriya"],
641
+ "azb": ["بؤلمه"],
642
+ "ba": ["Төркөм", "Категория"],
643
+ "bar": ["Kategorie"],
644
+ "bat-smg": ["Kategorija", "Kateguorėjė"],
645
+ "bcl": ["Kategorya"],
646
+ "be": ["Катэгорыя"],
647
+ "be-x-old": ["Катэгорыя"],
648
+ "bg": ["Категория"],
649
+ "bh": ["श्रेणी"],
650
+ "bjn": ["Tumbung", "Kategori"],
651
+ "bm": ["Catégorie"],
652
+ "bn": ["বিষয়শ্রেণী", "വിഭാഗം"],
653
+ "bpy": ["থাক"],
654
+ "br": ["Rummad"],
655
+ "bs": ["Kategorija"],
656
+ "bug": ["Kategori"],
657
+ "bxr": ["Категори", "Категория"],
658
+ "ca": ["Categoria"],
659
+ "cbk-zam": ["Categoría"],
660
+ "cdo": ["分類"],
661
+ "ce": ["Категори", "Тоба", "Кадегар"],
662
+ "ceb": ["Kategoriya"],
663
+ "ch": ["Katigoria"],
664
+ "ckb": ["پ", "پۆل"],
665
+ "co": ["Categoria"],
666
+ "crh": ["Категория", "Kategoriya"],
667
+ "cs": ["Kategorie"],
668
+ "csb": ["Kategòrëjô"],
669
+ "cu": ["Катигорї", "Категория", "Катигорїꙗ"],
670
+ "cv": ["Категори"],
671
+ "cy": ["Categori"],
672
+ "da": ["Kategori"],
673
+ "de": ["Kategorie"],
674
+ "din": ["Bekätakthook"],
675
+ "diq": ["Kategoriye", "Kategori"],
676
+ "dsb": ["Kategorija"],
677
+ "dty": ["श्रेणी"],
678
+ "dv": ["ޤިސްމު"],
679
+ "el": ["Κατηγορία"],
680
+ "eml": ["Categoria"],
681
+ "eo": ["Kategorio"],
682
+ "es": ["CAT", "Categoría"],
683
+ "et": ["Kategooria"],
684
+ "eu": ["Kategoria"],
685
+ "ext": ["Categoría", "Categoria"],
686
+ "fa": ["رده"],
687
+ "ff": ["Catégorie"],
688
+ "fi": ["Luokka"],
689
+ "fiu-vro": ["Katõgooria"],
690
+ "fo": ["Bólkur"],
691
+ "fr": ["Catégorie"],
692
+ "frp": ["Catègorie"],
693
+ "frr": ["Kategorie"],
694
+ "fur": ["Categorie"],
695
+ "fy": ["Kategory"],
696
+ "ga": ["Rang", "Catagóir"],
697
+ "gag": ["Kategori", "Kategoriya"],
698
+ "gan": ["分類", "分类"],
699
+ "gd": ["Roinn-seòrsa"],
700
+ "gl": ["Categoría"],
701
+ "glk": ["جرگه", "رده"],
702
+ "gn": ["Ñemohenda"],
703
+ "gom": ["वर्ग", "श्रेणी"],
704
+ "gor": ["Dalala"],
705
+ "got": ["𐌷𐌰𐌽𐍃𐌰"],
706
+ "gu": ["શ્રેણી", "CAT", "શ્રે"],
707
+ "gv": ["Ronney"],
708
+ "hak": ["分類"],
709
+ "haw": ["Māhele"],
710
+ "he": ["קטגוריה", "קט"],
711
+ "hi": ["श्र", "श्रेणी"],
712
+ "hif": ["vibhag"],
713
+ "hr": ["CT", "KT", "Kategorija"],
714
+ "hsb": ["Kategorija"],
715
+ "ht": ["Kategori"],
716
+ "hu": ["Kategória"],
717
+ "hy": ["Կատեգորիա"],
718
+ "ia": ["Categoria"],
719
+ "id": ["Kategori"],
720
+ "ie": ["Categorie"],
721
+ "ig": ["Ébéonọr", "Òtù"],
722
+ "ii": ["分类"],
723
+ "ilo": ["Kategoria"],
724
+ "inh": ["ОагӀат"],
725
+ "io": ["Kategorio"],
726
+ "is": ["Flokkur"],
727
+ "it": ["CAT", "Categoria"],
728
+ "ja": ["カテゴリ"],
729
+ "jbo": ["klesi"],
730
+ "jv": ["Kategori"],
731
+ "ka": ["კატეგორია"],
732
+ "kaa": ["Sanat", "Kategoriya", "Санат", "سانات"],
733
+ "kab": ["Taggayt"],
734
+ "kbd": ["Категория", "Категориэ"],
735
+ "kbp": ["Catégorie"],
736
+ "kg": ["Kalasi"],
737
+ "kk": ["Sanat", "Санат", "سانات"],
738
+ "kl": ["Sumut_atassuseq", "Kategori", "Sumut atassuseq"],
739
+ "km": ["ចំនាត់ថ្នាក់ក្រុម", "ចំណាត់ក្រុម", "ចំណាត់ថ្នាក់ក្រុម"],
740
+ "kn": ["ವರ್ಗ"],
741
+ "ko": ["분류"],
742
+ "koi": ["Категория"],
743
+ "krc": ["Категория"],
744
+ "ks": ["زٲژ"],
745
+ "ksh": ["Saachjropp", "Saachjrop", "Katejori", "Kategorie", "Saachjrupp", "Kattejori", "Sachjrop"],
746
+ "ku": ["Kategorî", "پۆل"],
747
+ "kv": ["Категория"],
748
+ "kw": ["Class", "Klass"],
749
+ "ky": ["Категория"],
750
+ "la": ["Categoria"],
751
+ "lad": ["Kateggoría", "Katēggoría", "Categoría"],
752
+ "lb": ["Kategorie"],
753
+ "lbe": ["Категория"],
754
+ "lez": ["Категория"],
755
+ "lfn": ["Categoria"],
756
+ "li": ["Categorie", "Kategorie"],
757
+ "lij": ["Categorîa", "Categoria"],
758
+ "lmo": ["Categuria", "Categoria"],
759
+ "ln": ["Catégorie"],
760
+ "lo": ["ໝວດ"],
761
+ "lrc": ["دأسە"],
762
+ "lt": ["Kategorija"],
763
+ "ltg": ["Kategoreja"],
764
+ "lv": ["Kategorija"],
765
+ "mai": ["CA", "श्रेणी"],
766
+ "map-bms": ["Kategori"],
767
+ "mdf": ["Категорие", "Категория"],
768
+ "mg": ["Sokajy", "Catégorie"],
769
+ "mhr": ["Категория", "Категорий"],
770
+ "min": ["Kategori"],
771
+ "mk": ["Категорија"],
772
+ "ml": ["വിഭാഗം", "വി", "വർഗ്ഗം", "വ"],
773
+ "mn": ["Ангилал"],
774
+ "mr": ["वर्ग"],
775
+ "mrj": ["Категори", "Категория"],
776
+ "ms": ["Kategori"],
777
+ "mt": ["Kategorija"],
778
+ "mwl": ["Catadorie", "Categoria"],
779
+ "my": ["ကဏ္ဍ"],
780
+ "myv": ["Категория"],
781
+ "mzn": ["رج", "رده"],
782
+ "nah": ["Neneuhcāyōtl", "Categoría"],
783
+ "nap": ["Categurìa", "Categoria"],
784
+ "nds": ["Kategorie"],
785
+ "nds-nl": ["Categorie", "Kattegerie", "Kategorie"],
786
+ "ne": ["श्रेणी"],
787
+ "new": ["पुचः"],
788
+ "nl": ["Categorie"],
789
+ "nn": ["Kategori"],
790
+ "no": ["Kategori"],
791
+ "nrm": ["Catégorie"],
792
+ "nso": ["Setensele"],
793
+ "nv": ["Tʼááłáhági_átʼéego", "Tʼááłáhági átʼéego"],
794
+ "oc": ["Categoria"],
795
+ "olo": ["Kategourii"],
796
+ "or": ["ବିଭାଗ", "ଶ୍ରେଣୀ"],
797
+ "os": ["Категори"],
798
+ "pa": ["ਸ਼੍ਰੇਣੀ"],
799
+ "pcd": ["Catégorie"],
800
+ "pdc": ["Abdeeling", "Kategorie"],
801
+ "pfl": ["Kadegorie", "Sachgrubb", "Kategorie"],
802
+ "pi": ["विभाग"],
803
+ "pl": ["Kategoria"],
804
+ "pms": ["Categorìa"],
805
+ "pnb": ["گٹھ"],
806
+ "pnt": ["Κατηγορίαν"],
807
+ "ps": ["وېشنيزه"],
808
+ "pt": ["Categoria"],
809
+ "qu": ["Katiguriya"],
810
+ "rm": ["Categoria"],
811
+ "rmy": ["Shopni"],
812
+ "ro": ["Categorie"],
813
+ "roa-rup": ["Categorie"],
814
+ "roa-tara": ["Categoria"],
815
+ "ru": ["Категория", "К"],
816
+ "rue": ["Категория", "Катеґорія"],
817
+ "rw": ["Ikiciro"],
818
+ "sa": ["वर्गः"],
819
+ "sah": ["Категория"],
820
+ "sat": ["ᱛᱷᱚᱠ"],
821
+ "sc": ["Categoria"],
822
+ "scn": ["Catigurìa"],
823
+ "sd": ["زمرو"],
824
+ "se": ["Kategoriija"],
825
+ "sg": ["Catégorie"],
826
+ "sh": ["Kategorija", "Категорија"],
827
+ "si": ["ප්‍රවර්ගය"],
828
+ "sk": ["Kategória"],
829
+ "sl": ["Kategorija"],
830
+ "sq": ["Kategoria", "Kategori"],
831
+ "sr": ["Kategorija", "Категорија"],
832
+ "srn": ["Categorie", "Guru"],
833
+ "stq": ["Kategorie"],
834
+ "su": ["Kategori"],
835
+ "sv": ["Kategori"],
836
+ "sw": ["Jamii"],
837
+ "szl": ["Kategoryjo", "Kategoria"],
838
+ "ta": ["பகுப்பு"],
839
+ "tcy": ["ವರ್ಗೊ"],
840
+ "te": ["వర్గం"],
841
+ "tet": ["Kategoría", "Kategoria"],
842
+ "tg": ["Гурӯҳ"],
843
+ "th": ["หมวดหมู่"],
844
+ "ti": ["መደብ"],
845
+ "tk": ["Kategoriýa"],
846
+ "tl": ["Kategorya", "Kaurian"],
847
+ "tpi": ["Grup"],
848
+ "tr": ["Kategori", "KAT"],
849
+ "tt": ["Төркем", "Törkem", "Категория"],
850
+ "ty": ["Catégorie"],
851
+ "tyv": ["Аңгылал", "Категория"],
852
+ "udm": ["Категория"],
853
+ "ug": ["تۈر"],
854
+ "uk": ["Категория", "Категорія"],
855
+ "ur": ["زمرہ"],
856
+ "uz": ["Turkum", "Kategoriya"],
857
+ "vec": ["Categoria"],
858
+ "vep": ["Kategorii"],
859
+ "vi": ["Thể_loại", "Thể loại"],
860
+ "vls": ["Categorie"],
861
+ "vo": ["Klad"],
862
+ "wa": ["Categoreye"],
863
+ "war": ["Kaarangay"],
864
+ "wo": ["Wàll", "Catégorie"],
865
+ "wuu": ["分类"],
866
+ "xal": ["Янз", "Әәшл"],
867
+ "xmf": ["კატეგორია"],
868
+ "yi": ["קאטעגאריע", "קאַטעגאָריע"],
869
+ "yo": ["Ẹ̀ka"],
870
+ "za": ["分类"],
871
+ "zea": ["Categorie"],
872
+ "zh": ["分类", "分類", "CAT"],
873
+ "zh-classical": ["分類", "CAT"],
874
+ "zh-min-nan": ["分類", "Lūi-pia̍t"],
875
+ "zh-yue": ["分类", "分類", "类", "類"],
876
+ }
877
+
878
+ _BASE_URL_TMPL = "https://dumps.wikimedia.org/{lang}wiki/{date}/"
879
+ _INFO_FILE = "dumpstatus.json"
880
+
881
+
882
+ _VERSION = datasets.Version("2.0.0", "")
883
+
884
+
885
+ class WikipediaConfig(datasets.BuilderConfig):
886
+ """BuilderConfig for Wikipedia."""
887
+
888
+ def __init__(self, language=None, date=None, version=_VERSION, **kwargs):
889
+ """BuilderConfig for Wikipedia.
890
+
891
+ Args:
892
+ language: string, the language code for the Wikipedia dump to use.
893
+ date: string, date of the Wikipedia dump in YYYYMMDD format. A list of
894
+ available dates can be found at https://dumps.wikimedia.org/enwiki/.
895
+ **kwargs: keyword arguments forwarded to super.
896
+ """
897
+ super().__init__(
898
+ name=f"{date}.{language}",
899
+ description=f"Wikipedia dataset for {language}, parsed from {date} dump.",
900
+ version=version,
901
+ **kwargs,
902
+ )
903
+ self.date = date
904
+ self.language = language
905
+
906
+
907
+ _DATE = "20230301"
908
+
909
+
910
+ class Wikipedia(datasets.GeneratorBasedBuilder):
911
+ """Wikipedia dataset."""
912
+
913
+ # Use mirror (your.org) to avoid download caps.
914
+ BUILDER_CONFIG_CLASS = WikipediaConfig
915
+ BUILDER_CONFIGS = [
916
+ WikipediaConfig(
917
+ language=lang,
918
+ date=_DATE,
919
+ ) # pylint:disable=g-complex-comprehension
920
+ for lang in WIKIPEDIA_LANGUAGES
921
+ ]
922
+
923
+ def _info(self):
924
+ return datasets.DatasetInfo(
925
+ description=_DESCRIPTION,
926
+ features=datasets.Features(
927
+ {
928
+ "id": datasets.Value("string"),
929
+ "url": datasets.Value("string"),
930
+ "title": datasets.Value("string"),
931
+ "text": datasets.Value("string"),
932
+ }
933
+ ),
934
+ # No default supervised_keys.
935
+ supervised_keys=None,
936
+ homepage="https://dumps.wikimedia.org",
937
+ citation=_CITATION,
938
+ )
939
+
940
+ def _split_generators(self, dl_manager):
941
+ def _base_url(lang):
942
+ return _BASE_URL_TMPL.format(lang=lang.replace("-", "_"), date=self.config.date)
943
+
944
+ lang = self.config.language
945
+
946
+ info_url = _base_url(lang) + _INFO_FILE
947
+ # Use dictionary since testing mock always returns the same result.
948
+ downloaded_files = dl_manager.download_and_extract({"info": info_url})
949
+
950
+ xml_urls = []
951
+ total_bytes = 0
952
+ with open(downloaded_files["info"], encoding="utf-8") as f:
953
+ dump_info = json.load(f)
954
+ multistream_dump_info = dump_info["jobs"]["articlesmultistreamdump"]
955
+ assert (
956
+ multistream_dump_info["status"] == "done"
957
+ ), "Specified dump (%s) multistream status is not 'done': %s" % (
958
+ _base_url(lang),
959
+ multistream_dump_info["status"],
960
+ )
961
+
962
+ for fname, info in multistream_dump_info["files"].items():
963
+ if ".xml" not in fname:
964
+ continue
965
+ total_bytes += info["size"]
966
+ xml_urls.append(_base_url(lang) + fname)
967
+
968
+ # Use dictionary since testing mock always returns the same result.
969
+
970
+ print("Dowloading Wikipedia dump")
971
+ downloaded_files = dl_manager.download({"xml": xml_urls})
972
+ print("Finished downloading Wikipedia dump")
973
+
974
+ return [
975
+ datasets.SplitGenerator( # pylint:disable=g-complex-comprehension
976
+ name=datasets.Split.TRAIN, gen_kwargs={"filepaths": downloaded_files["xml"], "language": lang}
977
+ )
978
+ ]
979
+
980
+ def _generate_examples(self, filepaths, language, no_labels=False):
981
+
982
+
983
+ def _extract_content(filepath):
984
+ """Extracts article content from a single WikiMedia XML file."""
985
+ logger.info("generating examples from = %s", filepath)
986
+ content = []
987
+ f = bz2.BZ2File(filename=filepath)
988
+ # Workaround due to: https://github.com/tensorflow/tensorflow/issues/33563
989
+ utf_f = codecs.getreader("utf-8")(f)
990
+ context = etree.iterparse(utf_f, events=("end",))
991
+ for unused_event, elem in context:
992
+ if not elem.tag.endswith("page"):
993
+ continue
994
+ namespace = elem.tag[:-4]
995
+ title = elem.find(f"./{namespace}title").text
996
+ ns = elem.find(f"./{namespace}ns").text
997
+ id_ = elem.find(f"./{namespace}id").text
998
+ red_ = elem.find(f"./{namespace}redirect")
999
+
1000
+ # Filter pages that are not in the "main" namespace.
1001
+ if ns != "0":
1002
+ elem.clear()
1003
+ continue
1004
+
1005
+ raw_content = elem.find(f"./{namespace}revision/{namespace}text").text
1006
+ elem.clear()
1007
+
1008
+ # Filter redirects.
1009
+ if raw_content is None or red_ is not None:
1010
+ continue
1011
+
1012
+ content.append((id_, title, raw_content))
1013
+ return content
1014
+
1015
+ def _clean_content(inputs, language):
1016
+ """Cleans raw wikicode to extract text."""
1017
+ id_, title, raw_content = inputs
1018
+ try:
1019
+ text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell, language=language)
1020
+ except (mwparserfromhell.parser.ParserError) as e:
1021
+ logger.error("mwparserfromhell ParseError: %s", e)
1022
+ return
1023
+
1024
+ if not text:
1025
+ return
1026
+
1027
+ url = _construct_url(title, language)
1028
+
1029
+ return id_, {"id": id_, "url": url, "title": title, "text": text}
1030
+
1031
+ print("Parsing and cleaning Wikipedia examples")
1032
+ with Manager() as manager:
1033
+ examples = manager.list()
1034
+ processes = []
1035
+ for filepath in filepaths:
1036
+ def parse_and_clean(examples):
1037
+ content = _extract_content(filepath)
1038
+ for obj in tqdm(content):
1039
+ examples.append(_clean_content(obj, language=language))
1040
+ p = Process(target=parse_and_clean, args=(examples,))
1041
+ p.start()
1042
+ processes.append(p)
1043
+
1044
+ for p in processes:
1045
+ p.join()
1046
+
1047
+ print("Parsed and cleaned Wikipedia examples")
1048
+
1049
+ for example in examples:
1050
+ if example is not None:
1051
+ yield example
1052
+
1053
+
1054
+ def _parse_and_clean_wikicode(raw_content, parser, language):
1055
+ """Strips formatting and unwanted sections from raw page content."""
1056
+ wikicode = parser.parse(raw_content)
1057
+
1058
+ # Filters for magic words that are parser instructions -- e.g., __NOTOC__
1059
+ re_rm_magic = re.compile("__[A-Z]*__", flags=re.UNICODE)
1060
+
1061
+ # Filters for file/image links.
1062
+ media_prefixes = "|".join(["File", "Image", "Media"] + MEDIA_ALIASES.get(language, []))
1063
+ re_rm_wikilink = re.compile(f"^(?:{media_prefixes}):", flags=re.IGNORECASE | re.UNICODE)
1064
+
1065
+ def rm_wikilink(obj):
1066
+ return bool(re_rm_wikilink.match(str(obj.title)))
1067
+
1068
+ # Filters for references and tables
1069
+ def rm_tag(obj):
1070
+ return str(obj.tag) in {"ref", "table"}
1071
+
1072
+ # Leave category links in-place but remove the category prefixes
1073
+ cat_prefixes = "|".join(["Category"] + CAT_ALIASES.get(language, []))
1074
+ re_clean_wikilink = re.compile(f"^(?:{cat_prefixes}):", flags=re.IGNORECASE | re.UNICODE)
1075
+
1076
+ def is_category(obj):
1077
+ return bool(re_clean_wikilink.match(str(obj.title)))
1078
+
1079
+ def clean_wikilink(obj):
1080
+ text = obj.__strip__()
1081
+ text = re.sub(re_clean_wikilink, "", text)
1082
+ obj.text = text
1083
+
1084
+ def try_replace_obj(obj):
1085
+ try:
1086
+ clean_wikilink(obj)
1087
+ except ValueError:
1088
+ # For unknown reasons, objects are sometimes not found.
1089
+ pass
1090
+
1091
+ def try_remove_obj(obj, section):
1092
+ try:
1093
+ section.remove(obj)
1094
+ except ValueError:
1095
+ # For unknown reasons, objects are sometimes not found.
1096
+ pass
1097
+
1098
+ section_text = []
1099
+ # Filter individual sections to clean.
1100
+ for section in wikicode.get_sections(flat=True, include_lead=True, include_headings=True):
1101
+ for obj in section.ifilter_wikilinks(recursive=True):
1102
+ if rm_wikilink(obj):
1103
+ try_remove_obj(obj, section)
1104
+ elif is_category(obj):
1105
+ try_replace_obj(obj)
1106
+ for obj in section.ifilter_tags(matches=rm_tag, recursive=True):
1107
+ try_remove_obj(obj, section)
1108
+
1109
+ section_text.append(re.sub(re_rm_magic, "", section.strip_code().strip()))
1110
+ return "\n\n".join(section_text)
1111
+
1112
+
1113
+ def _construct_url(title, language):
1114
+ # See: https://meta.wikimedia.org/wiki/Help:URL
1115
+ return f"https://{language}.wikipedia.org/wiki/{quote(title)}"