Upload knessetCorpus.py
Browse files- knessetCorpus.py +6 -1
knessetCorpus.py
CHANGED
@@ -256,6 +256,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
256 |
]
|
257 |
|
258 |
def _generate_examples(self, data_files):
|
|
|
259 |
if "all_features_sentences" in self.config.name:
|
260 |
id_field_name = "sentence_id"
|
261 |
elif self.config.name == "protocols":
|
@@ -265,9 +266,13 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
265 |
elif self.config.name == "knessetMembers":
|
266 |
id_field_name = "person_id"
|
267 |
|
268 |
-
for i, filepath in enumerate(data_files
|
|
|
|
|
|
|
269 |
with open(filepath, encoding="utf-8") as f:
|
270 |
for line in f:
|
|
|
271 |
try:
|
272 |
row = json.loads(line)
|
273 |
except Exception as e:
|
|
|
256 |
]
|
257 |
|
258 |
def _generate_examples(self, data_files):
|
259 |
+
print(f'data_files:{data_files}')
|
260 |
if "all_features_sentences" in self.config.name:
|
261 |
id_field_name = "sentence_id"
|
262 |
elif self.config.name == "protocols":
|
|
|
266 |
elif self.config.name == "knessetMembers":
|
267 |
id_field_name = "person_id"
|
268 |
|
269 |
+
for i, filepath in enumerate(data_files):
|
270 |
+
print(f'i:{i}')
|
271 |
+
print(f'filepath: {filepath}')
|
272 |
+
|
273 |
with open(filepath, encoding="utf-8") as f:
|
274 |
for line in f:
|
275 |
+
print(f'line: {line}')
|
276 |
try:
|
277 |
row = json.loads(line)
|
278 |
except Exception as e:
|