jtz18 commited on
Commit
4c8394a
1 Parent(s): 30227b3

Upload 4 files

Browse files
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. README.md +916 -0
  3. biblenlp-corpus.py +339 -0
  4. corpus.json +3 -0
  5. vref.txt +0 -0
.gitattributes CHANGED
@@ -56,3 +56,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
56
  # Video files - compressed
57
  *.mp4 filter=lfs diff=lfs merge=lfs -text
58
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
56
  # Video files - compressed
57
  *.mp4 filter=lfs diff=lfs merge=lfs -text
58
  *.webm filter=lfs diff=lfs merge=lfs -text
59
+ corpus.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,916 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - expert-generated
6
+ language:
7
+ - aai
8
+ - aak
9
+ - aau
10
+ - aaz
11
+ - abt
12
+ - abx
13
+ - aby
14
+ - acf
15
+ - acr
16
+ - acu
17
+ - adz
18
+ - aer
19
+ - aey
20
+ - agd
21
+ - agg
22
+ - agm
23
+ - agn
24
+ - agr
25
+ - agt
26
+ - agu
27
+ - aia
28
+ - aii
29
+ - aka
30
+ - ake
31
+ - alp
32
+ - alq
33
+ - als
34
+ - aly
35
+ - ame
36
+ - amf
37
+ - amk
38
+ - amm
39
+ - amn
40
+ - amo
41
+ - amp
42
+ - amr
43
+ - amu
44
+ - amx
45
+ - anh
46
+ - anv
47
+ - aoi
48
+ - aoj
49
+ - aom
50
+ - aon
51
+ - apb
52
+ - ape
53
+ - apn
54
+ - apr
55
+ - apu
56
+ - apw
57
+ - apz
58
+ - arb
59
+ - are
60
+ - arl
61
+ - arn
62
+ - arp
63
+ - asm
64
+ - aso
65
+ - ata
66
+ - atb
67
+ - atd
68
+ - atg
69
+ - att
70
+ - auc
71
+ - aui
72
+ - auy
73
+ - avt
74
+ - awb
75
+ - awk
76
+ - awx
77
+ - azb
78
+ - azg
79
+ - azz
80
+ - bao
81
+ - bba
82
+ - bbb
83
+ - bbr
84
+ - bch
85
+ - bco
86
+ - bdd
87
+ - bea
88
+ - bef
89
+ - bel
90
+ - ben
91
+ - beo
92
+ - beu
93
+ - bgs
94
+ - bgt
95
+ - bhg
96
+ - bhl
97
+ - big
98
+ - bjk
99
+ - bjp
100
+ - bjr
101
+ - bjv
102
+ - bjz
103
+ - bkd
104
+ - bki
105
+ - bkq
106
+ - bkx
107
+ - bla
108
+ - blw
109
+ - blz
110
+ - bmh
111
+ - bmk
112
+ - bmr
113
+ - bmu
114
+ - bnp
115
+ - boa
116
+ - boj
117
+ - bon
118
+ - box
119
+ - bpr
120
+ - bps
121
+ - bqc
122
+ - bqp
123
+ - bre
124
+ - bsj
125
+ - bsn
126
+ - bsp
127
+ - bss
128
+ - buk
129
+ - bus
130
+ - bvd
131
+ - bvr
132
+ - bxh
133
+ - byr
134
+ - byx
135
+ - bzd
136
+ - bzh
137
+ - bzj
138
+ - caa
139
+ - cab
140
+ - cac
141
+ - caf
142
+ - cak
143
+ - cao
144
+ - cap
145
+ - car
146
+ - cav
147
+ - cax
148
+ - cbc
149
+ - cbi
150
+ - cbk
151
+ - cbr
152
+ - cbs
153
+ - cbt
154
+ - cbu
155
+ - cbv
156
+ - cco
157
+ - ceb
158
+ - cek
159
+ - ces
160
+ - cgc
161
+ - cha
162
+ - chd
163
+ - chf
164
+ - chk
165
+ - chq
166
+ - chz
167
+ - cjo
168
+ - cjv
169
+ - ckb
170
+ - cle
171
+ - clu
172
+ - cme
173
+ - cmn
174
+ - cni
175
+ - cnl
176
+ - cnt
177
+ - cof
178
+ - con
179
+ - cop
180
+ - cot
181
+ - cpa
182
+ - cpb
183
+ - cpc
184
+ - cpu
185
+ - cpy
186
+ - crn
187
+ - crx
188
+ - cso
189
+ - csy
190
+ - cta
191
+ - cth
192
+ - ctp
193
+ - ctu
194
+ - cub
195
+ - cuc
196
+ - cui
197
+ - cuk
198
+ - cut
199
+ - cux
200
+ - cwe
201
+ - cya
202
+ - daa
203
+ - dad
204
+ - dah
205
+ - dan
206
+ - ded
207
+ - deu
208
+ - dgc
209
+ - dgr
210
+ - dgz
211
+ - dhg
212
+ - dif
213
+ - dik
214
+ - dji
215
+ - djk
216
+ - djr
217
+ - dob
218
+ - dop
219
+ - dov
220
+ - dwr
221
+ - dww
222
+ - dwy
223
+ - ebk
224
+ - eko
225
+ - emi
226
+ - emp
227
+ - eng
228
+ - enq
229
+ - epo
230
+ - eri
231
+ - ese
232
+ - esk
233
+ - etr
234
+ - ewe
235
+ - faa
236
+ - fai
237
+ - far
238
+ - ffm
239
+ - for
240
+ - fra
241
+ - fue
242
+ - fuf
243
+ - fuh
244
+ - gah
245
+ - gai
246
+ - gam
247
+ - gaw
248
+ - gdn
249
+ - gdr
250
+ - geb
251
+ - gfk
252
+ - ghs
253
+ - glk
254
+ - gmv
255
+ - gng
256
+ - gnn
257
+ - gnw
258
+ - gof
259
+ - grc
260
+ - gub
261
+ - guh
262
+ - gui
263
+ - guj
264
+ - gul
265
+ - gum
266
+ - gun
267
+ - guo
268
+ - gup
269
+ - gux
270
+ - gvc
271
+ - gvf
272
+ - gvn
273
+ - gvs
274
+ - gwi
275
+ - gym
276
+ - gyr
277
+ - hat
278
+ - hau
279
+ - haw
280
+ - hbo
281
+ - hch
282
+ - heb
283
+ - heg
284
+ - hin
285
+ - hix
286
+ - hla
287
+ - hlt
288
+ - hmo
289
+ - hns
290
+ - hop
291
+ - hot
292
+ - hrv
293
+ - hto
294
+ - hub
295
+ - hui
296
+ - hun
297
+ - hus
298
+ - huu
299
+ - huv
300
+ - hvn
301
+ - ian
302
+ - ign
303
+ - ikk
304
+ - ikw
305
+ - ilo
306
+ - imo
307
+ - inb
308
+ - ind
309
+ - ino
310
+ - iou
311
+ - ipi
312
+ - isn
313
+ - ita
314
+ - iws
315
+ - ixl
316
+ - jac
317
+ - jae
318
+ - jao
319
+ - jic
320
+ - jid
321
+ - jiv
322
+ - jni
323
+ - jpn
324
+ - jvn
325
+ - kan
326
+ - kaq
327
+ - kbc
328
+ - kbh
329
+ - kbm
330
+ - kbq
331
+ - kdc
332
+ - kde
333
+ - kdl
334
+ - kek
335
+ - ken
336
+ - kew
337
+ - kgf
338
+ - kgk
339
+ - kgp
340
+ - khs
341
+ - khz
342
+ - kik
343
+ - kiw
344
+ - kiz
345
+ - kje
346
+ - kjn
347
+ - kjs
348
+ - kkc
349
+ - kkl
350
+ - klt
351
+ - klv
352
+ - kmg
353
+ - kmh
354
+ - kmk
355
+ - kmo
356
+ - kms
357
+ - kmu
358
+ - kne
359
+ - knf
360
+ - knj
361
+ - knv
362
+ - kos
363
+ - kpf
364
+ - kpg
365
+ - kpj
366
+ - kpr
367
+ - kpw
368
+ - kpx
369
+ - kqa
370
+ - kqc
371
+ - kqf
372
+ - kql
373
+ - kqw
374
+ - ksd
375
+ - ksj
376
+ - ksr
377
+ - ktm
378
+ - kto
379
+ - kud
380
+ - kue
381
+ - kup
382
+ - kvg
383
+ - kvn
384
+ - kwd
385
+ - kwf
386
+ - kwi
387
+ - kwj
388
+ - kyc
389
+ - kyf
390
+ - kyg
391
+ - kyq
392
+ - kyz
393
+ - kze
394
+ - lac
395
+ - lat
396
+ - lbb
397
+ - lbk
398
+ - lcm
399
+ - leu
400
+ - lex
401
+ - lgl
402
+ - lid
403
+ - lif
404
+ - lin
405
+ - lit
406
+ - llg
407
+ - lug
408
+ - luo
409
+ - lww
410
+ - maa
411
+ - maj
412
+ - mal
413
+ - mam
414
+ - maq
415
+ - mar
416
+ - mau
417
+ - mav
418
+ - maz
419
+ - mbb
420
+ - mbc
421
+ - mbh
422
+ - mbj
423
+ - mbl
424
+ - mbs
425
+ - mbt
426
+ - mca
427
+ - mcb
428
+ - mcd
429
+ - mcf
430
+ - mco
431
+ - mcp
432
+ - mcq
433
+ - mcr
434
+ - mdy
435
+ - med
436
+ - mee
437
+ - mek
438
+ - meq
439
+ - met
440
+ - meu
441
+ - mgc
442
+ - mgh
443
+ - mgw
444
+ - mhl
445
+ - mib
446
+ - mic
447
+ - mie
448
+ - mig
449
+ - mih
450
+ - mil
451
+ - mio
452
+ - mir
453
+ - mit
454
+ - miz
455
+ - mjc
456
+ - mkj
457
+ - mkl
458
+ - mkn
459
+ - mks
460
+ - mle
461
+ - mlh
462
+ - mlp
463
+ - mmo
464
+ - mmx
465
+ - mna
466
+ - mop
467
+ - mox
468
+ - mph
469
+ - mpj
470
+ - mpm
471
+ - mpp
472
+ - mps
473
+ - mpt
474
+ - mpx
475
+ - mqb
476
+ - mqj
477
+ - msb
478
+ - msc
479
+ - msk
480
+ - msm
481
+ - msy
482
+ - mti
483
+ - mto
484
+ - mux
485
+ - muy
486
+ - mva
487
+ - mvn
488
+ - mwc
489
+ - mwe
490
+ - mwf
491
+ - mwp
492
+ - mxb
493
+ - mxp
494
+ - mxq
495
+ - mxt
496
+ - mya
497
+ - myk
498
+ - myu
499
+ - myw
500
+ - myy
501
+ - mzz
502
+ - nab
503
+ - naf
504
+ - nak
505
+ - nas
506
+ - nay
507
+ - nbq
508
+ - nca
509
+ - nch
510
+ - ncj
511
+ - ncl
512
+ - ncu
513
+ - ndg
514
+ - ndj
515
+ - nfa
516
+ - ngp
517
+ - ngu
518
+ - nhe
519
+ - nhg
520
+ - nhi
521
+ - nho
522
+ - nhr
523
+ - nhu
524
+ - nhw
525
+ - nhy
526
+ - nif
527
+ - nii
528
+ - nin
529
+ - nko
530
+ - nld
531
+ - nlg
532
+ - nmw
533
+ - nna
534
+ - nnq
535
+ - noa
536
+ - nop
537
+ - not
538
+ - nou
539
+ - npi
540
+ - npl
541
+ - nsn
542
+ - nss
543
+ - ntj
544
+ - ntp
545
+ - ntu
546
+ - nuy
547
+ - nvm
548
+ - nwi
549
+ - nya
550
+ - nys
551
+ - nyu
552
+ - obo
553
+ - okv
554
+ - omw
555
+ - ong
556
+ - ons
557
+ - ood
558
+ - opm
559
+ - ory
560
+ - ote
561
+ - otm
562
+ - otn
563
+ - otq
564
+ - ots
565
+ - pab
566
+ - pad
567
+ - pah
568
+ - pan
569
+ - pao
570
+ - pes
571
+ - pib
572
+ - pio
573
+ - pir
574
+ - piu
575
+ - pjt
576
+ - pls
577
+ - plu
578
+ - pma
579
+ - poe
580
+ - poh
581
+ - poi
582
+ - pol
583
+ - pon
584
+ - por
585
+ - poy
586
+ - ppo
587
+ - prf
588
+ - pri
589
+ - ptp
590
+ - ptu
591
+ - pwg
592
+ - qub
593
+ - quc
594
+ - quf
595
+ - quh
596
+ - qul
597
+ - qup
598
+ - qvc
599
+ - qve
600
+ - qvh
601
+ - qvm
602
+ - qvn
603
+ - qvs
604
+ - qvw
605
+ - qvz
606
+ - qwh
607
+ - qxh
608
+ - qxn
609
+ - qxo
610
+ - rai
611
+ - reg
612
+ - rgu
613
+ - rkb
614
+ - rmc
615
+ - rmy
616
+ - ron
617
+ - roo
618
+ - rop
619
+ - row
620
+ - rro
621
+ - ruf
622
+ - rug
623
+ - rus
624
+ - rwo
625
+ - sab
626
+ - san
627
+ - sbe
628
+ - sbk
629
+ - sbs
630
+ - seh
631
+ - sey
632
+ - sgb
633
+ - sgz
634
+ - shj
635
+ - shp
636
+ - sim
637
+ - sja
638
+ - sll
639
+ - smk
640
+ - snc
641
+ - snn
642
+ - snp
643
+ - snx
644
+ - sny
645
+ - som
646
+ - soq
647
+ - soy
648
+ - spa
649
+ - spl
650
+ - spm
651
+ - spp
652
+ - sps
653
+ - spy
654
+ - sri
655
+ - srm
656
+ - srn
657
+ - srp
658
+ - srq
659
+ - ssd
660
+ - ssg
661
+ - ssx
662
+ - stp
663
+ - sua
664
+ - sue
665
+ - sus
666
+ - suz
667
+ - swe
668
+ - swh
669
+ - swp
670
+ - sxb
671
+ - tac
672
+ - taj
673
+ - tam
674
+ - tav
675
+ - taw
676
+ - tbc
677
+ - tbf
678
+ - tbg
679
+ - tbl
680
+ - tbo
681
+ - tbz
682
+ - tca
683
+ - tcs
684
+ - tcz
685
+ - tdt
686
+ - tee
687
+ - tel
688
+ - ter
689
+ - tet
690
+ - tew
691
+ - tfr
692
+ - tgk
693
+ - tgl
694
+ - tgo
695
+ - tgp
696
+ - tha
697
+ - thd
698
+ - tif
699
+ - tim
700
+ - tiw
701
+ - tiy
702
+ - tke
703
+ - tku
704
+ - tlf
705
+ - tmd
706
+ - tna
707
+ - tnc
708
+ - tnk
709
+ - tnn
710
+ - tnp
711
+ - toc
712
+ - tod
713
+ - tof
714
+ - toj
715
+ - ton
716
+ - too
717
+ - top
718
+ - tos
719
+ - tpa
720
+ - tpi
721
+ - tpt
722
+ - tpz
723
+ - trc
724
+ - tsw
725
+ - ttc
726
+ - tte
727
+ - tuc
728
+ - tue
729
+ - tuf
730
+ - tuo
731
+ - tur
732
+ - tvk
733
+ - twi
734
+ - txq
735
+ - txu
736
+ - tzj
737
+ - tzo
738
+ - ubr
739
+ - ubu
740
+ - udu
741
+ - uig
742
+ - ukr
743
+ - uli
744
+ - ulk
745
+ - upv
746
+ - ura
747
+ - urb
748
+ - urd
749
+ - uri
750
+ - urt
751
+ - urw
752
+ - usa
753
+ - usp
754
+ - uvh
755
+ - uvl
756
+ - vid
757
+ - vie
758
+ - viv
759
+ - vmy
760
+ - waj
761
+ - wal
762
+ - wap
763
+ - wat
764
+ - wbi
765
+ - wbp
766
+ - wed
767
+ - wer
768
+ - wim
769
+ - wiu
770
+ - wiv
771
+ - wmt
772
+ - wmw
773
+ - wnc
774
+ - wnu
775
+ - wol
776
+ - wos
777
+ - wrk
778
+ - wro
779
+ - wrs
780
+ - wsk
781
+ - wuv
782
+ - xav
783
+ - xbi
784
+ - xed
785
+ - xla
786
+ - xnn
787
+ - xon
788
+ - xsi
789
+ - xtd
790
+ - xtm
791
+ - yaa
792
+ - yad
793
+ - yal
794
+ - yap
795
+ - yaq
796
+ - yby
797
+ - ycn
798
+ - yka
799
+ - yle
800
+ - yml
801
+ - yon
802
+ - yor
803
+ - yrb
804
+ - yre
805
+ - yss
806
+ - yuj
807
+ - yut
808
+ - yuw
809
+ - yva
810
+ - zaa
811
+ - zab
812
+ - zac
813
+ - zad
814
+ - zai
815
+ - zaj
816
+ - zam
817
+ - zao
818
+ - zap
819
+ - zar
820
+ - zas
821
+ - zat
822
+ - zav
823
+ - zaw
824
+ - zca
825
+ - zga
826
+ - zia
827
+ - ziw
828
+ - zlm
829
+ - zos
830
+ - zpc
831
+ - zpl
832
+ - zpm
833
+ - zpo
834
+ - zpq
835
+ - zpu
836
+ - zpv
837
+ - zpz
838
+ - zsr
839
+ - ztq
840
+ - zty
841
+ - zyp
842
+ - be
843
+ - br
844
+ - cs
845
+ - ch
846
+ - zh
847
+ - de
848
+ - en
849
+ - eo
850
+ - fr
851
+ - ht
852
+ - he
853
+ - hr
854
+ - id
855
+ - it
856
+ - ja
857
+ - la
858
+ - nl
859
+ - ru
860
+ - sa
861
+ - so
862
+ - es
863
+ - sr
864
+ - sv
865
+ - to
866
+ - uk
867
+ - vi
868
+ license:
869
+ - cc-by-4.0
870
+ - other
871
+ multilinguality:
872
+ - translation
873
+ - multilingual
874
+ pretty_name: biblenlp-corpus
875
+ size_categories:
876
+ - 1M<n<10M
877
+ source_datasets:
878
+ - original
879
+ task_categories:
880
+ - translation
881
+ task_ids: []
882
+ ---
883
+
884
+ # Dataset Card for BibleNLP Corpus
885
+
886
+ ### Dataset Summary
887
+ Partial and complete Bible translations in 833 languages, aligned by verse.
888
+
889
+ ### Languages
890
+ aai, aak, aau, aaz, abt, abx, aby, acf, acr, acu, adz, aer, aey, agd, agg, agm, agn, agr, agt, agu, aia, aii, aka, ake, alp, alq, als, aly, ame, amf, amk, amm, amn, amo, amp, amr, amu, amx, anh, anv, aoi, aoj, aom, aon, apb, ape, apn, apr, apu, apw, apz, arb, are, arl, arn, arp, asm, aso, ata, atb, atd, atg, att, auc, aui, auy, avt, awb, awk, awx, azb, azg, azz, bao, bba, bbb, bbr, bch, bco, bdd, bea, bef, bel, ben, beo, beu, bgs, bgt, bhg, bhl, big, bjk, bjp, bjr, bjv, bjz, bkd, bki, bkq, bkx, bla, blw, blz, bmh, bmk, bmr, bmu, bnp, boa, boj, bon, box, bpr, bps, bqc, bqp, bre, bsj, bsn, bsp, bss, buk, bus, bvd, bvr, bxh, byr, byx, bzd, bzh, bzj, caa, cab, cac, caf, cak, cao, cap, car, cav, cax, cbc, cbi, cbk, cbr, cbs, cbt, cbu, cbv, cco, ceb, cek, ces, cgc, cha, chd, chf, chk, chq, chz, cjo, cjv, ckb, cle, clu, cme, cmn, cni, cnl, cnt, cof, con, cop, cot, cpa, cpb, cpc, cpu, cpy, crn, crx, cso, csy, cta, cth, ctp, ctu, cub, cuc, cui, cuk, cut, cux, cwe, cya, daa, dad, dah, dan, ded, deu, dgc, dgr, dgz, dhg, dif, dik, dji, djk, djr, dob, dop, dov, dwr, dww, dwy, ebk, eko, emi, emp, eng, enq, epo, eri, ese, esk, etr, ewe, faa, fai, far, ffm, for, fra, fue, fuf, fuh, gah, gai, gam, gaw, gdn, gdr, geb, gfk, ghs, glk, gmv, gng, gnn, gnw, gof, grc, gub, guh, gui, guj, gul, gum, gun, guo, gup, gux, gvc, gvf, gvn, gvs, gwi, gym, gyr, hat, hau, haw, hbo, hch, heb, heg, hin, hix, hla, hlt, hmo, hns, hop, hot, hrv, hto, hub, hui, hun, hus, huu, huv, hvn, ian, ign, ikk, ikw, ilo, imo, inb, ind, ino, iou, ipi, isn, ita, iws, ixl, jac, jae, jao, jic, jid, jiv, jni, jpn, jvn, kan, kaq, kbc, kbh, kbm, kbq, kdc, kde, kdl, kek, ken, kew, kgf, kgk, kgp, khs, khz, kik, kiw, kiz, kje, kjn, kjs, kkc, kkl, klt, klv, kmg, kmh, kmk, kmo, kms, kmu, kne, knf, knj, knv, kos, kpf, kpg, kpj, kpr, kpw, kpx, kqa, kqc, kqf, kql, kqw, ksd, ksj, ksr, ktm, kto, kud, kue, kup, kvg, kvn, kwd, kwf, kwi, kwj, kyc, kyf, kyg, kyq, kyz, kze, lac, lat, lbb, lbk, lcm, leu, lex, lgl, lid, lif, lin, lit, llg, lug, luo, lww, maa, maj, mal, mam, maq, mar, mau, mav, maz, mbb, mbc, mbh, mbj, mbl, mbs, mbt, mca, mcb, mcd, mcf, mco, mcp, mcq, mcr, mdy, med, mee, mek, meq, met, meu, mgc, mgh, mgw, mhl, mib, mic, mie, mig, mih, mil, mio, mir, mit, miz, mjc, mkj, mkl, mkn, mks, mle, mlh, mlp, mmo, mmx, mna, mop, mox, mph, mpj, mpm, mpp, mps, mpt, mpx, mqb, mqj, msb, msc, msk, msm, msy, mti, mto, mux, muy, mva, mvn, mwc, mwe, mwf, mwp, mxb, mxp, mxq, mxt, mya, myk, myu, myw, myy, mzz, nab, naf, nak, nas, nay, nbq, nca, nch, ncj, ncl, ncu, ndg, ndj, nfa, ngp, ngu, nhe, nhg, nhi, nho, nhr, nhu, nhw, nhy, nif, nii, nin, nko, nld, nlg, nmw, nna, nnq, noa, nop, not, nou, npi, npl, nsn, nss, ntj, ntp, ntu, nuy, nvm, nwi, nya, nys, nyu, obo, okv, omw, ong, ons, ood, opm, ory, ote, otm, otn, otq, ots, pab, pad, pah, pan, pao, pes, pib, pio, pir, piu, pjt, pls, plu, pma, poe, poh, poi, pol, pon, por, poy, ppo, prf, pri, ptp, ptu, pwg, qub, quc, quf, quh, qul, qup, qvc, qve, qvh, qvm, qvn, qvs, qvw, qvz, qwh, qxh, qxn, qxo, rai, reg, rgu, rkb, rmc, rmy, ron, roo, rop, row, rro, ruf, rug, rus, rwo, sab, san, sbe, sbk, sbs, seh, sey, sgb, sgz, shj, shp, sim, sja, sll, smk, snc, snn, snp, snx, sny, som, soq, soy, spa, spl, spm, spp, sps, spy, sri, srm, srn, srp, srq, ssd, ssg, ssx, stp, sua, sue, sus, suz, swe, swh, swp, sxb, tac, taj, tam, tav, taw, tbc, tbf, tbg, tbl, tbo, tbz, tca, tcs, tcz, tdt, tee, tel, ter, tet, tew, tfr, tgk, tgl, tgo, tgp, tha, thd, tif, tim, tiw, tiy, tke, tku, tlf, tmd, tna, tnc, tnk, tnn, tnp, toc, tod, tof, toj, ton, too, top, tos, tpa, tpi, tpt, tpz, trc, tsw, ttc, tte, tuc, tue, tuf, tuo, tur, tvk, twi, txq, txu, tzj, tzo, ubr, ubu, udu, uig, ukr, uli, ulk, upv, ura, urb, urd, uri, urt, urw, usa, usp, uvh, uvl, vid, vie, viv, vmy, waj, wal, wap, wat, wbi, wbp, wed, wer, wim, wiu, wiv, wmt, wmw, wnc, wnu, wol, wos, wrk, wro, wrs, wsk, wuv, xav, xbi, xed, xla, xnn, xon, xsi, xtd, xtm, yaa, yad, yal, yap, yaq, yby, ycn, yka, yle, yml, yon, yor, yrb, yre, yss, yuj, yut, yuw, yva, zaa, zab, zac, zad, zai, zaj, zam, zao, zap, zar, zas, zat, zav, zaw, zca, zga, zia, ziw, zlm, zos, zpc, zpl, zpm, zpo, zpq, zpu, zpv, zpz, zsr, ztq, zty, zyp
891
+
892
+ ## Dataset Structure
893
+
894
+ ### Data Fields
895
+
896
+ **translation**
897
+ - **languages** - an N length list of the languages of the translations, sorted alphabetically
898
+ - **translation** - an N length list with the translations each corresponding to the language specified in the above field
899
+ **files**
900
+ - **lang** - an N length list of the languages of the files, in order of input
901
+ - **file** - an N length list of the filenames from the corpus on github, each corresponding with the lang above
902
+ **ref** - the verse(s) contained in the record, as a list, with each represented with: ``<a three letter book code> <chapter number>:<verse number>``
903
+
904
+ **licenses** - an N length list of licenses, corresponding to the list of files above
905
+
906
+ **copyrights** - information on copyright holders, corresponding to the list of files above
907
+
908
+ ### Usage
909
+
910
+ The dataset loading script requires installation of tqdm, ijson, and numpy
911
+
912
+ Specify the languages to be paired with a list and ISO 693-3 language codes, such as ``languages = ['eng', 'fra']``.
913
+ By default, the script will return individual verse pairs, as well as verses covering a full range. If only the individual verses is desired, use ``pair='single'``. If only the maximum range pairing is desired use ``pair='range'`` (for example, if one text uses the verse range covering GEN 1:1-3, all texts would return only the full length pairing).
914
+
915
+ ## Sources
916
+ https://github.com/BibleNLP/ebible-corpus
biblenlp-corpus.py ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+ import os
18
+
19
+ import datasets
20
+ from tqdm import tqdm
21
+ import numpy as np
22
+ import ijson
23
+ import hashlib
24
+
25
+ _VERSION = "1.0.0"
26
+ _LANGUAGES = ['aai', 'aak', 'aau', 'aaz', 'abt', 'abx', 'aby', 'acf', 'acr', 'acu', 'adz', 'aer', 'aey', 'agd', 'agg', 'agm', 'agn', 'agr', 'agt', 'agu', 'aia', 'aii', 'aka', 'ake', 'alp', 'alq', 'als', 'aly', 'ame', 'amf', 'amk', 'amm', 'amn', 'amo', 'amp', 'amr', 'amu', 'amx', 'anh', 'anv', 'aoi', 'aoj', 'aom', 'aon', 'apb', 'ape', 'apn', 'apr', 'apu', 'apw', 'apz', 'arb', 'are', 'arl', 'arn', 'arp', 'asm', 'aso', 'ata', 'atb', 'atd', 'atg', 'att', 'auc', 'aui', 'auy', 'avt', 'awb', 'awk', 'awx', 'azb', 'azg', 'azz', 'bao', 'bba', 'bbb', 'bbr', 'bch', 'bco', 'bdd', 'bea', 'bef', 'bel', 'ben', 'beo', 'beu', 'bgs', 'bgt', 'bhg', 'bhl', 'big', 'bjk', 'bjp', 'bjr', 'bjv', 'bjz', 'bkd', 'bki', 'bkq', 'bkx', 'bla', 'blw', 'blz', 'bmh', 'bmk', 'bmr', 'bmu', 'bnp', 'boa', 'boj', 'bon', 'box', 'bpr', 'bps', 'bqc', 'bqp', 'bre', 'bsj', 'bsn', 'bsp', 'bss', 'buk', 'bus', 'bvd', 'bvr', 'bxh', 'byr', 'byx', 'bzd', 'bzh', 'bzj', 'caa', 'cab', 'cac', 'caf', 'cak', 'cao', 'cap', 'car', 'cav', 'cax', 'cbc', 'cbi', 'cbk', 'cbr', 'cbs', 'cbt', 'cbu', 'cbv', 'cco', 'ceb', 'cek', 'ces', 'cgc', 'cha', 'chd', 'chf', 'chk', 'chq', 'chz', 'cjo', 'cjv', 'ckb', 'cle', 'clu', 'cme', 'cmn', 'cni', 'cnl', 'cnt', 'cof', 'con', 'cop', 'cot', 'cpa', 'cpb', 'cpc', 'cpu', 'cpy', 'crn', 'crx', 'cso', 'csy', 'cta', 'cth', 'ctp', 'ctu', 'cub', 'cuc', 'cui', 'cuk', 'cut', 'cux', 'cwe', 'cya', 'daa', 'dad', 'dah', 'dan', 'ded', 'deu', 'dgc', 'dgr', 'dgz', 'dhg', 'dif', 'dik', 'dji', 'djk', 'djr', 'dob', 'dop', 'dov', 'dwr', 'dww', 'dwy', 'ebk', 'eko', 'emi', 'emp', 'eng', 'enq', 'epo', 'eri', 'ese', 'esk', 'etr', 'ewe', 'faa', 'fai', 'far', 'ffm', 'for', 'fra', 'fue', 'fuf', 'fuh', 'gah', 'gai', 'gam', 'gaw', 'gdn', 'gdr', 'geb', 'gfk', 'ghs', 'glk', 'gmv', 'gng', 'gnn', 'gnw', 'gof', 'grc', 'gub', 'guh', 'gui', 'guj', 'gul', 'gum', 'gun', 'guo', 'gup', 'gux', 'gvc', 'gvf', 'gvn', 'gvs', 'gwi', 'gym', 'gyr', 'hat', 'hau', 'haw', 'hbo', 'hch', 'heb', 'heg', 'hin', 'hix', 'hla', 'hlt', 'hmo', 'hns', 'hop', 'hot', 'hrv', 'hto', 'hub', 'hui', 'hun', 'hus', 'huu', 'huv', 'hvn', 'ian', 'ign', 'ikk', 'ikw', 'ilo', 'imo', 'inb', 'ind', 'ino', 'iou', 'ipi', 'isn', 'ita', 'iws', 'ixl', 'jac', 'jae', 'jao', 'jic', 'jid', 'jiv', 'jni', 'jpn', 'jvn', 'kan', 'kaq', 'kbc', 'kbh', 'kbm', 'kbq', 'kdc', 'kde', 'kdl', 'kek', 'ken', 'kew', 'kgf', 'kgk', 'kgp', 'khs', 'khz', 'kik', 'kiw', 'kiz', 'kje', 'kjn', 'kjs', 'kkc', 'kkl', 'klt', 'klv', 'kmg', 'kmh', 'kmk', 'kmo', 'kms', 'kmu', 'kne', 'knf', 'knj', 'knv', 'kos', 'kpf', 'kpg', 'kpj', 'kpr', 'kpw', 'kpx', 'kqa', 'kqc', 'kqf', 'kql', 'kqw', 'ksd', 'ksj', 'ksr', 'ktm', 'kto', 'kud', 'kue', 'kup', 'kvg', 'kvn', 'kwd', 'kwf', 'kwi', 'kwj', 'kyc', 'kyf', 'kyg', 'kyq', 'kyz', 'kze', 'lac', 'lat', 'lbb', 'lbk', 'lcm', 'leu', 'lex', 'lgl', 'lid', 'lif', 'lin', 'lit', 'llg', 'lug', 'luo', 'lww', 'maa', 'maj', 'mal', 'mam', 'maq', 'mar', 'mau', 'mav', 'maz', 'mbb', 'mbc', 'mbh', 'mbj', 'mbl', 'mbs', 'mbt', 'mca', 'mcb', 'mcd', 'mcf', 'mco', 'mcp', 'mcq', 'mcr', 'mdy', 'med', 'mee', 'mek', 'meq', 'met', 'meu', 'mgc', 'mgh', 'mgw', 'mhl', 'mib', 'mic', 'mie', 'mig', 'mih', 'mil', 'mio', 'mir', 'mit', 'miz', 'mjc', 'mkj', 'mkl', 'mkn', 'mks', 'mle', 'mlh', 'mlp', 'mmo', 'mmx', 'mna', 'mop', 'mox', 'mph', 'mpj', 'mpm', 'mpp', 'mps', 'mpt', 'mpx', 'mqb', 'mqj', 'msb', 'msc', 'msk', 'msm', 'msy', 'mti', 'mto', 'mux', 'muy', 'mva', 'mvn', 'mwc', 'mwe', 'mwf', 'mwp', 'mxb', 'mxp', 'mxq', 'mxt', 'mya', 'myk', 'myu', 'myw', 'myy', 'mzz', 'nab', 'naf', 'nak', 'nas', 'nay', 'nbq', 'nca', 'nch', 'ncj', 'ncl', 'ncu', 'ndg', 'ndj', 'nfa', 'ngp', 'ngu', 'nhe', 'nhg', 'nhi', 'nho', 'nhr', 'nhu', 'nhw', 'nhy', 'nif', 'nii', 'nin', 'nko', 'nld', 'nlg', 'nmw', 'nna', 'nnq', 'noa', 'nop', 'not', 'nou', 'npi', 'npl', 'nsn', 'nss', 'ntj', 'ntp', 'ntu', 'nuy', 'nvm', 'nwi', 'nya', 'nys', 'nyu', 'obo', 'okv', 'omw', 'ong', 'ons', 'ood', 'opm', 'ory', 'ote', 'otm', 'otn', 'otq', 'ots', 'pab', 'pad', 'pah', 'pan', 'pao', 'pes', 'pib', 'pio', 'pir', 'piu', 'pjt', 'pls', 'plu', 'pma', 'poe', 'poh', 'poi', 'pol', 'pon', 'por', 'poy', 'ppo', 'prf', 'pri', 'ptp', 'ptu', 'pwg', 'qub', 'quc', 'quf', 'quh', 'qul', 'qup', 'qvc', 'qve', 'qvh', 'qvm', 'qvn', 'qvs', 'qvw', 'qvz', 'qwh', 'qxh', 'qxn', 'qxo', 'rai', 'reg', 'rgu', 'rkb', 'rmc', 'rmy', 'ron', 'roo', 'rop', 'row', 'rro', 'ruf', 'rug', 'rus', 'rwo', 'sab', 'san', 'sbe', 'sbk', 'sbs', 'seh', 'sey', 'sgb', 'sgz', 'shj', 'shp', 'sim', 'sja', 'sll', 'smk', 'snc', 'snn', 'snp', 'snx', 'sny', 'som', 'soq', 'soy', 'spa', 'spl', 'spm', 'spp', 'sps', 'spy', 'sri', 'srm', 'srn', 'srp', 'srq', 'ssd', 'ssg', 'ssx', 'stp', 'sua', 'sue', 'sus', 'suz', 'swe', 'swh', 'swp', 'sxb', 'tac', 'taj', 'tam', 'tav', 'taw', 'tbc', 'tbf', 'tbg', 'tbl', 'tbo', 'tbz', 'tca', 'tcs', 'tcz', 'tdt', 'tee', 'tel', 'ter', 'tet', 'tew', 'tfr', 'tgk', 'tgl', 'tgo', 'tgp', 'tha', 'thd', 'tif', 'tim', 'tiw', 'tiy', 'tke', 'tku', 'tlf', 'tmd', 'tna', 'tnc', 'tnk', 'tnn', 'tnp', 'toc', 'tod', 'tof', 'toj', 'ton', 'too', 'top', 'tos', 'tpa', 'tpi', 'tpt', 'tpz', 'trc', 'tsw', 'ttc', 'tte', 'tuc', 'tue', 'tuf', 'tuo', 'tur', 'tvk', 'twi', 'txq', 'txu', 'tzj', 'tzo', 'ubr', 'ubu', 'udu', 'uig', 'ukr', 'uli', 'ulk', 'upv', 'ura', 'urb', 'urd', 'uri', 'urt', 'urw', 'usa', 'usp', 'uvh', 'uvl', 'vid', 'vie', 'viv', 'vmy', 'waj', 'wal', 'wap', 'wat', 'wbi', 'wbp', 'wed', 'wer', 'wim', 'wiu', 'wiv', 'wmt', 'wmw', 'wnc', 'wnu', 'wol', 'wos', 'wrk', 'wro', 'wrs', 'wsk', 'wuv', 'xav', 'xbi', 'xed', 'xla', 'xnn', 'xon', 'xsi', 'xtd', 'xtm', 'yaa', 'yad', 'yal', 'yap', 'yaq', 'yby', 'ycn', 'yka', 'yle', 'yml', 'yon', 'yor', 'yrb', 'yre', 'yss', 'yuj', 'yut', 'yuw', 'yva', 'zaa', 'zab', 'zac', 'zad', 'zai', 'zaj', 'zam', 'zao', 'zap', 'zar', 'zas', 'zat', 'zav', 'zaw', 'zca', 'zga', 'zia', 'ziw', 'zlm', 'zos', 'zpc', 'zpl', 'zpm', 'zpo', 'zpq', 'zpu', 'zpv', 'zpz', 'zsr', 'ztq', 'zty', 'zyp']
27
+ _DESCRIPTION = "Bible Parallel Corpus"
28
+ _HOMEPAGE = 'https://github.com/BibleNLP/ebible-corpus'
29
+ _PAIR = 'all'
30
+ _CITATION = """\
31
+ @InProceedings{huggingface:dataset,
32
+ title = {A great new dataset},
33
+ author={huggingface, Inc.
34
+ },
35
+ year={2020}
36
+ }
37
+ """
38
+ _LICENSE = 'Creative Commons and Public Domain, specified in the dataset'
39
+ _FILES = {'corpus':'corpus.json','vref':'vref.txt'}
40
+
41
+ class BiblenlpCorpusConfig(datasets.BuilderConfig):
42
+ def __init__(self, languages=[], pair='all', **kwargs):
43
+ '''
44
+ languages: list of languages to include
45
+ pair: 'all', 'range', or 'single' to specify whether verse ranges, single pairings, or all pairs are included
46
+ **kwargs: additional arguments to pass to the superclass'''
47
+ super(BiblenlpCorpusConfig, self).__init__(name=hashlib.md5(f'{"-".join([x for x in languages])}'.encode('UTF-8')).hexdigest(), **kwargs)
48
+ self.languages = languages
49
+ self.pair = pair
50
+
51
+ class BiblenlpCorpus(datasets.GeneratorBasedBuilder):
52
+ BUILDER_CONFIGS = [
53
+ BiblenlpCorpusConfig(
54
+ languages=_LANGUAGES,
55
+ pair=_PAIR,
56
+ description = f'Parallel Bible verses with {_PAIR} pairings of {"-".join([x for x in _LANGUAGES])} languages',
57
+ )
58
+ ]
59
+
60
+ BUILDER_CONFIG_CLASS = BiblenlpCorpusConfig
61
+
62
+ def _info(self):
63
+ return datasets.DatasetInfo(
64
+ description=_DESCRIPTION,
65
+ features=datasets.Features(
66
+ {
67
+ "translation": datasets.features.TranslationVariableLanguages(languages=_LANGUAGES),
68
+ "files": datasets.features.Sequence( {'lang':datasets.Value("string"), 'file':datasets.Value("string")} ),
69
+ "ref": datasets.features.Sequence( datasets.Value("string") ),
70
+ "licenses": datasets.features.Sequence( datasets.Value("string") ),
71
+ "copyrights": datasets.features.Sequence( datasets.Value("string") )
72
+ },
73
+ ),
74
+ supervised_keys=None,
75
+ homepage=_HOMEPAGE,
76
+ citation=_CITATION,
77
+ license=_LICENSE,
78
+ version=_VERSION
79
+ ) #
80
+
81
+ def _split_generators(self, dl_manager):
82
+ downloaded_files = dl_manager.download(_FILES)
83
+
84
+ def parse_json(json_filename, langs):
85
+ with open(json_filename, 'rb') as input_file:
86
+ # load json iteratively
87
+ parser = ijson.parse(input_file)
88
+ parsed_dict = {lang: [] for lang in langs}
89
+ idx = {lang: -1 for lang in langs}
90
+ for prefix, event, value in parser:
91
+ #print(f'prefix:{prefix}, event:{event}, value:{value}')
92
+ if any([prefix.startswith(f'{lang}.') for lang in langs]):
93
+ #print(f'prefix:{prefix}, event:{event}, value:{value}')
94
+ if event == 'start_map':
95
+ idx[prefix.split('.')[0]] += 1
96
+ tmpdict ={}
97
+ tmpdict['verses']=[]
98
+ if prefix.endswith('verses.item'):
99
+ tmpdict['verses'].append(value)
100
+ if prefix.endswith('copyright'):
101
+ tmpdict['copyright'] = value
102
+ if prefix.endswith('text'):
103
+ tmpdict['text'] = value
104
+ if prefix.endswith('file'):
105
+ tmpdict['file'] = value
106
+ if prefix.endswith('license'):
107
+ tmpdict['license'] = value
108
+ if event == 'end_map':
109
+ #write the dictionary
110
+ parsed_dict[prefix.split('.')[0]].append( tmpdict.copy() )
111
+ return(parsed_dict)
112
+
113
+ def define_splits(corpus_slice, langs):
114
+ verse2split = {}
115
+ langtexts = {}
116
+ textverses = {}
117
+ vindexes = {}
118
+ vgroups = []
119
+ versesets ={}
120
+
121
+ np.random.seed(42)
122
+
123
+ for lang in tqdm(langs):
124
+ langtexts[lang] = set()
125
+ textverses[lang]={}
126
+ vindexes[lang]={}
127
+ for idx,line in enumerate(corpus_slice[lang]):
128
+ langtexts[lang].add(line['file'])
129
+ for v in line['verses']:
130
+ if not textverses[lang].get(line['file']):
131
+ textverses[lang][line['file']] = set()
132
+ textverses[lang][line['file']].add(v)
133
+ if not vindexes[lang].get(v):
134
+ vindexes[lang][v] = [idx]
135
+ else:
136
+ vindexes[lang][v].append(idx)
137
+
138
+ #print(list(vindexes['eng'].keys())[0:10])
139
+ #for f in langtexts['eng']:
140
+ # print(len(textverses['eng'][f]))
141
+
142
+ for line in tqdm(corpus_slice[langs[0]]):
143
+ versesets = {line['file']:line['verses']}
144
+ if any([verse2split.get(z) for z in line['verses']]):
145
+ for verse in line['verses']:
146
+ if verse2split.get(verse):
147
+ prevsplit = verse2split.get(verse)
148
+ break
149
+ split = prevsplit
150
+ else:
151
+ split = np.random.choice(['train','test','dev'],p=[.9,.05,.05])
152
+ if not all([verse2split.get(z) for z in line['verses']]):
153
+ all_verses = set()
154
+ for v in line['verses']:
155
+ all_verses.add(v)
156
+ while True:
157
+ verses_added = False
158
+ idxes = {k:set() for k in langs}
159
+ #get indexes for verses
160
+ for v in all_verses:
161
+ for lang in langs:
162
+ if vindexes[lang].get(v):
163
+ for idx in vindexes[lang][v]:
164
+ idxes[lang].add(idx)
165
+
166
+ for lang in langs:
167
+ for compline in [corpus_slice[lang][x] for x in idxes[lang] if x != set()]:
168
+
169
+ if all(x in textverses[lang][compline['file']] for x in all_verses) and any([x in list(all_verses) for x in compline['verses']]):
170
+ if not versesets.get(compline['file']):
171
+ versesets[compline['file']] = compline['verses'].copy()
172
+ else:
173
+ versesets[compline['file']].extend(compline['verses'].copy())
174
+ for v in compline['verses']:
175
+ pre_size = len(all_verses)
176
+ all_verses.add(v)
177
+ if len(all_verses) > pre_size:
178
+ verses_added = True
179
+
180
+ if verses_added == False or all([set(versesets[q]) == all_verses for q in versesets.keys()]):
181
+ vgroups.append(all_verses)
182
+ for v in all_verses:
183
+ verse2split[v] = split
184
+ break
185
+
186
+ return(vgroups,vindexes, verse2split)
187
+
188
+
189
+ corpus_slice = parse_json(downloaded_files['corpus'], self.config.languages)
190
+ vgroups, vindexes, verse2split = define_splits(corpus_slice, self.config.languages)
191
+
192
+
193
+ return [
194
+ datasets.SplitGenerator(
195
+ name=datasets.Split.TRAIN,
196
+ gen_kwargs={
197
+ 'langs': self.config.languages,
198
+ 'corpus': corpus_slice,
199
+ 'vgroups': vgroups,
200
+ 'vindexes': vindexes,
201
+ 'v2split': verse2split,
202
+ 'split': 'train',
203
+ 'vref': downloaded_files['vref'],
204
+ }
205
+ ),
206
+ datasets.SplitGenerator(
207
+ name=datasets.Split.VALIDATION,
208
+ gen_kwargs={
209
+ 'langs': self.config.languages,
210
+ 'corpus': corpus_slice,
211
+ 'vgroups': vgroups,
212
+ 'vindexes': vindexes,
213
+ 'v2split': verse2split,
214
+ 'split': 'dev',
215
+ 'vref': downloaded_files['vref'],
216
+ }
217
+ ),
218
+ datasets.SplitGenerator(
219
+ name=datasets.Split.TEST,
220
+ gen_kwargs={
221
+ 'langs': self.config.languages,
222
+ 'corpus': corpus_slice,
223
+ 'vgroups': vgroups,
224
+ 'vindexes': vindexes,
225
+ 'v2split': verse2split,
226
+ 'split': 'test',
227
+ 'vref': downloaded_files['vref'],
228
+ }
229
+ ),
230
+ ]
231
+
232
+
233
+
234
+
235
+
236
+ def _generate_examples(self, vref, corpus, vgroups, vindexes, v2split, split, langs):
237
+ #print(f'Generating {split} examples...')
238
+ with open(vref, 'r') as txtfile:
239
+ #print('file opened')
240
+ lines = txtfile.readlines()
241
+ #print('lines read')
242
+ verse2index = {k.strip():v for v,k in enumerate(lines) if k.strip() != ''}
243
+ #print('v2i created')
244
+
245
+ def order_verses(verse_list):
246
+ lines_list = [int(verse2index[x]) for x in verse_list]
247
+ verse_order = np.argsort(lines_list)
248
+ return(verse_order)
249
+
250
+ trans_license = {}
251
+ trans_copyright = {}
252
+ id = -1
253
+ #print(f'beginning groups, starting with {list(vgroups)[0]}')
254
+ for group in vgroups:
255
+ #print(group)
256
+ if v2split.get(list(group)[0]) == split:
257
+ #print('correct split')
258
+ if len(group) > 1:
259
+ v_order = order_verses(group)
260
+ o_group = list(np.array(list(group))[v_order])
261
+
262
+ else:
263
+ o_group = list(group)
264
+ trans_dict={k:{} for k in langs}
265
+ trans_texts = {k:{} for k in langs}
266
+ used_idxes = {k:[] for k in langs}
267
+ for v in o_group:
268
+ #print(f'trying verse {v}')
269
+ single_texts = {k:{} for k in langs}
270
+ single_dict = {k:{} for k in langs}
271
+ for lang in langs:
272
+ if vindexes[lang].get(v):
273
+ try:
274
+ for i in range(0,len(list(vindexes[lang][v]))):
275
+ if list(vindexes[lang][v])[i] not in used_idxes[lang]:
276
+ used_idxes[lang].append(vindexes[lang][v])
277
+ line = corpus[lang][vindexes[lang][v][i]]
278
+ if not trans_texts.get(line['file']):
279
+ trans_texts[lang][line['file']]=line['text']
280
+ else:
281
+ trans_texts[lang][line['file']] += f' {line["text"]}'
282
+ if line.get('license'):
283
+ trans_license[line['file']]=line['license']
284
+ if line.get('copyright'):
285
+ trans_copyright[line['file']]=line['copyright']
286
+ if len(line['verses']) == 1:
287
+ single_texts[lang][line['file']] = line['text']
288
+ except:
289
+ print(lang,v)
290
+ raise
291
+
292
+ single_dict[lang]=list(single_texts[lang].values())
293
+ trans_dict[lang]=list(trans_texts[lang].values())
294
+
295
+ single_file = {x:list(single_texts[x].keys()) for x in langs}
296
+ sing_v_order = {x:np.argsort(list(single_texts[x].values())) for x in langs}
297
+ lang_order = np.argsort(langs)
298
+ single_lic_list =[]
299
+ single_copy_list = []
300
+ for lang in [langs[x] for x in lang_order]:
301
+ single_lic_list.extend([trans_license.get(single_file[lang][x],'') for x in sing_v_order[lang]])
302
+ single_copy_list.extend([trans_copyright.get(single_file[lang][x],'') for x in sing_v_order[lang]])
303
+ if all([single_dict.get(x) and single_dict.get(x) != [{}] and list(single_dict.get(x)) for x in langs]) and len(list(single_dict.keys())) == len(langs) and self.config.pair != 'range':
304
+ id = id + 1
305
+ sfile_list = []
306
+ for key in [langs[x] for x in lang_order]:
307
+ for value in [single_file.get(key)[x] for x in sing_v_order.get(key)]:
308
+ sfile_list.append({'lang':key,'file':value})
309
+
310
+ #print('outputting single example')
311
+ # print(id, single_dict, sfile_list, v, single_lic_list, single_copy_list)
312
+ try:
313
+ yield(id, {'translation': single_dict, 'files': sfile_list, 'ref':[v], 'licenses':single_lic_list, 'copyrights':single_copy_list})
314
+ except:
315
+ print(id, single_dict, sfile_list, v, single_lic_list, single_copy_list)
316
+ raise
317
+
318
+ file_list = {x:list(trans_texts[x].keys()) for x in langs}
319
+ trans_v_order = {x:np.argsort(list(trans_texts[x].values())) for x in langs}
320
+ lang_order = np.argsort(langs)
321
+ #license_list = [trans_license.get(x,'') for x in [y for y in file_list.values()]]
322
+ #copyright_list = [trans_copyright.get(x,'') for x in [y for y in file_list.values()]]
323
+ license_list = []
324
+ copyright_list = []
325
+ for lang in [langs[x] for x in lang_order]:
326
+ license_list.extend([trans_license.get(file_list[lang][x],'') for x in trans_v_order[lang]])
327
+ copyright_list .extend([trans_copyright.get(file_list[lang][x],'') for x in trans_v_order[lang]])
328
+ if len(o_group)>1 and all([trans_dict.get(x) and trans_dict.get(x) != [{}] and list(trans_dict.get(x)) for x in langs]) and len(list(trans_dict.keys())) == len(langs) and self.config.pair != 'single':
329
+ id = id + 1
330
+ ofile_list = []
331
+ for key in [langs[x] for x in lang_order]:
332
+ for value in [file_list.get(key)[x] for x in trans_v_order.get(key)]:
333
+ ofile_list.append({'lang':key,'file':value})
334
+ #print('outputting range example')
335
+ try:
336
+ yield(id, {'translation': trans_dict, 'files': ofile_list, 'ref':o_group, 'licenses':license_list, 'copyrights':copyright_list})
337
+ except:
338
+ print(id, trans_dict, ofile_list, o_group, license_list, copyright_list)
339
+ raise
corpus.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc2b4330de91b439b243b5c0fd6b5a2fd2de7a9f9db7f8e23291f1a5083faa7a
3
+ size 5182382597
vref.txt ADDED
The diff for this file is too large to render. See raw diff