Adding year, century, and codebook
Browse files
bibles.py
CHANGED
@@ -217,6 +217,7 @@ class Bibles(datasets.GeneratorBasedBuilder):
|
|
217 |
"language": datasets.Value("string"),
|
218 |
"year": datasets.Value("int16"),
|
219 |
"century": datasets.Value("string"),
|
|
|
220 |
}
|
221 |
),
|
222 |
supervised_keys=None,
|
@@ -237,11 +238,12 @@ class Bibles(datasets.GeneratorBasedBuilder):
|
|
237 |
with open(filepath, encoding="utf-8") as csv_file:
|
238 |
csv_reader = csv.reader(csv_file, delimiter=",")
|
239 |
next(csv_reader) # skip header
|
240 |
-
for idx, (text, label, language, year, century) in enumerate(csv_reader):
|
241 |
yield int(idx), {
|
242 |
"text": text,
|
243 |
"label": self.labels.index(label),
|
244 |
"language": language,
|
245 |
"year": year,
|
246 |
"century": century,
|
|
|
247 |
}
|
|
|
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,
|
|
|
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 |
}
|