parquet-converter
commited on
Commit
•
571d389
1
Parent(s):
2fa7297
Update parquet files
Browse files- README.md +0 -35
- bibles.py +0 -249
- division_validation.csv → division/bibles-test.parquet +2 -2
- division_train.csv → division/bibles-train.parquet +2 -2
- division_test.csv → division/bibles-validation.parquet +2 -2
- genre_test.csv → genre/bibles-test.parquet +2 -2
- books_labels.tar.gz → genre/bibles-train.parquet +2 -2
- genre/bibles-validation.parquet +3 -0
- genre_train.csv +0 -3
- genre_validation.csv +0 -3
- testament/bibles-test.parquet +3 -0
- testament/bibles-train.parquet +3 -0
- testament/bibles-validation.parquet +3 -0
- testament_test.csv +0 -3
- testament_train.csv +0 -3
- testament_validation.csv +0 -3
README.md
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- sq
|
4 |
-
- ar
|
5 |
-
- az
|
6 |
-
- be
|
7 |
-
- bg
|
8 |
-
- ceb
|
9 |
-
- zh
|
10 |
-
- cs
|
11 |
-
- da
|
12 |
-
- en
|
13 |
-
- es
|
14 |
-
- fi
|
15 |
-
- fr
|
16 |
-
- de
|
17 |
-
- el
|
18 |
-
- ht
|
19 |
-
- he
|
20 |
-
- hi
|
21 |
-
- hu
|
22 |
-
- it
|
23 |
-
- ko
|
24 |
-
- la
|
25 |
-
- nl
|
26 |
-
- no
|
27 |
-
- pt
|
28 |
-
- rm
|
29 |
-
- ru
|
30 |
-
- sw
|
31 |
-
- ta
|
32 |
-
- th
|
33 |
-
- tr
|
34 |
-
- vi
|
35 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bibles.py
DELETED
@@ -1,249 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""Multilingual Bibles"""
|
16 |
-
import csv
|
17 |
-
|
18 |
-
import datasets
|
19 |
-
|
20 |
-
|
21 |
-
_CITATION = """
|
22 |
-
@InProceedings{--,
|
23 |
-
author = {---},
|
24 |
-
title = {---},
|
25 |
-
booktitle = {---},
|
26 |
-
year = 2021,
|
27 |
-
address = "---"
|
28 |
-
}
|
29 |
-
"""
|
30 |
-
|
31 |
-
_DESCRIPTION = """\
|
32 |
-
Multilingual Bibles
|
33 |
-
"""
|
34 |
-
|
35 |
-
|
36 |
-
_HOMEPAGE = "https://github.com/versae/bibles/"
|
37 |
-
|
38 |
-
BIBLES_BASE_URI = "https://huggingface.co/datasets/versae/bibles/resolve/main"
|
39 |
-
BIBLES = {
|
40 |
-
"validation": lambda config: f"{BIBLES_BASE_URI}/{config}_validation.csv",
|
41 |
-
"test": lambda config: f"{BIBLES_BASE_URI}/{config}_test.csv",
|
42 |
-
"train": lambda config: f"{BIBLES_BASE_URI}/{config}_train.csv"
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
class BiblesConfig(datasets.BuilderConfig):
|
47 |
-
"""BuilderConfig for NorNE."""
|
48 |
-
|
49 |
-
def __init__(self, **kwargs):
|
50 |
-
"""BuilderConfig for Bibles.
|
51 |
-
Args:
|
52 |
-
**kwargs: keyword arguments forwarded to super.
|
53 |
-
"""
|
54 |
-
super(BiblesConfig, self).__init__(**kwargs)
|
55 |
-
|
56 |
-
|
57 |
-
class Bibles(datasets.GeneratorBasedBuilder):
|
58 |
-
"""Bibles"""
|
59 |
-
|
60 |
-
BUILDER_CONFIGS = [
|
61 |
-
BiblesConfig(name="testament", version=datasets.Version("1.0.0"), description="Bibles testament dataset (full set)"),
|
62 |
-
BiblesConfig(name="genre", version=datasets.Version("1.0.0"), description="Bibles genre dataset (full set)"),
|
63 |
-
BiblesConfig(name="division", version=datasets.Version("1.0.0"), description="Bibles division dataset (full set)"),
|
64 |
-
]
|
65 |
-
|
66 |
-
def _info(self):
|
67 |
-
if self.config.name == "division":
|
68 |
-
labels = [
|
69 |
-
'Gospel',
|
70 |
-
'Historical',
|
71 |
-
'Letters',
|
72 |
-
'Pentateuch',
|
73 |
-
'Prophetic',
|
74 |
-
'Revelation',
|
75 |
-
'Wisdom'
|
76 |
-
]
|
77 |
-
languages = [
|
78 |
-
'ALB',
|
79 |
-
'ARA',
|
80 |
-
'AZB',
|
81 |
-
'BEL',
|
82 |
-
'BUL',
|
83 |
-
'CEB',
|
84 |
-
'CHI',
|
85 |
-
'CZE',
|
86 |
-
'DAN',
|
87 |
-
'ENG',
|
88 |
-
'ESP',
|
89 |
-
'FIN',
|
90 |
-
'FRE',
|
91 |
-
'GER',
|
92 |
-
'GRC',
|
93 |
-
'HAT',
|
94 |
-
'HEB',
|
95 |
-
'HIN',
|
96 |
-
'HUN',
|
97 |
-
'ITA',
|
98 |
-
'KOR',
|
99 |
-
'LAT',
|
100 |
-
'MAR',
|
101 |
-
'NL_',
|
102 |
-
'NOR',
|
103 |
-
'POR',
|
104 |
-
'RUM',
|
105 |
-
'RUS',
|
106 |
-
'SCR',
|
107 |
-
'SPA',
|
108 |
-
'SWE',
|
109 |
-
'TAM',
|
110 |
-
'TGL',
|
111 |
-
'THA',
|
112 |
-
'TUR',
|
113 |
-
'VIE',
|
114 |
-
'XKL',
|
115 |
-
]
|
116 |
-
elif self.config.name == "genre":
|
117 |
-
labels = [
|
118 |
-
'apocalyptic',
|
119 |
-
'gospel',
|
120 |
-
'historical',
|
121 |
-
'law',
|
122 |
-
'letter',
|
123 |
-
'lyric',
|
124 |
-
'prophecy',
|
125 |
-
'wisdom'
|
126 |
-
]
|
127 |
-
languages = [
|
128 |
-
'ALB',
|
129 |
-
'ARA',
|
130 |
-
'AZB',
|
131 |
-
'BEL',
|
132 |
-
'BUL',
|
133 |
-
'CEB',
|
134 |
-
'CHI',
|
135 |
-
'CZE',
|
136 |
-
'DAN',
|
137 |
-
'ENG',
|
138 |
-
'ESP',
|
139 |
-
'FIN',
|
140 |
-
'FRE',
|
141 |
-
'GER',
|
142 |
-
'GRC',
|
143 |
-
'HAT',
|
144 |
-
'HEB',
|
145 |
-
'HIN',
|
146 |
-
'HUN',
|
147 |
-
'ITA',
|
148 |
-
'KOR',
|
149 |
-
'LAT',
|
150 |
-
'MAR',
|
151 |
-
'NL_',
|
152 |
-
'NOR',
|
153 |
-
'POR',
|
154 |
-
'RUM',
|
155 |
-
'RUS',
|
156 |
-
'SCR',
|
157 |
-
'SPA',
|
158 |
-
'SWE',
|
159 |
-
'TAM',
|
160 |
-
'TGL',
|
161 |
-
'THA',
|
162 |
-
'TUR',
|
163 |
-
'VIE',
|
164 |
-
'XKL',
|
165 |
-
]
|
166 |
-
else: # self.config.name == "testament":
|
167 |
-
labels = ["new", "old"]
|
168 |
-
languages = [
|
169 |
-
'ALB',
|
170 |
-
'ARA',
|
171 |
-
'AZB',
|
172 |
-
'BEL',
|
173 |
-
'BUL',
|
174 |
-
'CEB',
|
175 |
-
'CHA',
|
176 |
-
'CHI',
|
177 |
-
'CZE',
|
178 |
-
'DAN',
|
179 |
-
'ENG',
|
180 |
-
'ESP',
|
181 |
-
'FIN',
|
182 |
-
'FRE',
|
183 |
-
'GER',
|
184 |
-
'GRC',
|
185 |
-
'HAT',
|
186 |
-
'HEB',
|
187 |
-
'HIN',
|
188 |
-
'HUN',
|
189 |
-
'ITA',
|
190 |
-
'KOR',
|
191 |
-
'LAT',
|
192 |
-
'MAR',
|
193 |
-
'NDS',
|
194 |
-
'NL_',
|
195 |
-
'NOR',
|
196 |
-
'PON',
|
197 |
-
'POR',
|
198 |
-
'RUM',
|
199 |
-
'RUS',
|
200 |
-
'SCR',
|
201 |
-
'SPA',
|
202 |
-
'SWE',
|
203 |
-
'TAM',
|
204 |
-
'TGL',
|
205 |
-
'THA',
|
206 |
-
'TUR',
|
207 |
-
'VIE',
|
208 |
-
'XKL',
|
209 |
-
]
|
210 |
-
self.labels = labels
|
211 |
-
return datasets.DatasetInfo(
|
212 |
-
description=_DESCRIPTION,
|
213 |
-
features=datasets.Features(
|
214 |
-
{
|
215 |
-
"text": datasets.Value("string"),
|
216 |
-
"label": datasets.ClassLabel(names=labels),
|
217 |
-
"language": datasets.Value("string"),
|
218 |
-
"year": datasets.Value("int16"),
|
219 |
-
"century": datasets.Value("string"),
|
220 |
-
"codebook": datasets.Value("string"),
|
221 |
-
}
|
222 |
-
),
|
223 |
-
supervised_keys=None,
|
224 |
-
homepage=_HOMEPAGE,
|
225 |
-
citation=_CITATION,
|
226 |
-
)
|
227 |
-
|
228 |
-
def _split_generators(self, dl_manager):
|
229 |
-
URLS = {key: BIBLES[key](self.config.name) for key in BIBLES.keys()}
|
230 |
-
downloaded_files = dl_manager.download(URLS)
|
231 |
-
return [
|
232 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
233 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["validation"]}),
|
234 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
235 |
-
]
|
236 |
-
|
237 |
-
def _generate_examples(self, filepath):
|
238 |
-
with open(filepath, encoding="utf-8") as csv_file:
|
239 |
-
csv_reader = csv.reader(csv_file, delimiter=",")
|
240 |
-
next(csv_reader) # skip header
|
241 |
-
for idx, (text, label, language, year, century, codebook) in enumerate(csv_reader):
|
242 |
-
yield int(idx), {
|
243 |
-
"text": text,
|
244 |
-
"label": self.labels.index(label),
|
245 |
-
"language": language,
|
246 |
-
"year": year,
|
247 |
-
"century": century,
|
248 |
-
"codebook": codebook,
|
249 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
division_validation.csv → division/bibles-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0cfa31aac3fd36c77e5bada384ed4475e40b2b5f47f78beae586b27177688221
|
3 |
+
size 5171210
|
division_train.csv → division/bibles-train.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:519838cee1df57ab9f4ac2ec970142d350f3c82dca9675455cde2a706be67267
|
3 |
+
size 41161027
|
division_test.csv → division/bibles-validation.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d671655b7a673ec5c611aa5316a1befd9a60444527084fc63cba1c84045255bc
|
3 |
+
size 5140581
|
genre_test.csv → genre/bibles-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4e73e17c58a7d64c5a5ddd601092ff6f16b4ff3116816c55f4cedde9a2fd665
|
3 |
+
size 20458937
|
books_labels.tar.gz → genre/bibles-train.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7c5204341296eaf596a6aa20788df66cb13240de172acdd7dc09cd068e1db362
|
3 |
+
size 163127447
|
genre/bibles-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ae6d440f4be59b52c1b5b9f795b5cb0222216d86524720a4408232eb6f464c7f
|
3 |
+
size 20406874
|
genre_train.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:bff71e1f1d07393c619ee83e6d1c144de07f9892771d3219491578003e356613
|
3 |
-
size 223940155
|
|
|
|
|
|
|
|
genre_validation.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9d018665c56b7da4a3bb1e461c2eea745dfa37c765b7c0eadae3992c81bedabd
|
3 |
-
size 28001872
|
|
|
|
|
|
|
|
testament/bibles-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e73bc56832a1af75799024f982f7cb99923f3cfd8fc69ca68187e8fe6f22587b
|
3 |
+
size 27547654
|
testament/bibles-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1f9e02d21643209a36bba0b29f7cf73f4f116843fc2e9de45306446bbd69788f
|
3 |
+
size 199794778
|
testament/bibles-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:896e991c18805594febde4eeddadae1ad793721c7c24002ec151bbaa20a1dba6
|
3 |
+
size 27537969
|
testament_test.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5ebd4cce764baa9541217ffcddc4dbb2eb4a96950e0c7e1269ae8aa757a99cee
|
3 |
-
size 37317191
|
|
|
|
|
|
|
|
testament_train.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:bba64106e1571f87a50deb05b628cadc4f5276ac6b36fcdc88ea08bb32f6c6c4
|
3 |
-
size 270671430
|
|
|
|
|
|
|
|
testament_validation.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5b79251677554073bf8b4f6c709ba56601ab9757df33f5091e3029b662329c9f
|
3 |
-
size 37330534
|
|
|
|
|
|
|
|