Datasets:
Update csatqa.py
Browse files
csatqa.py
CHANGED
@@ -55,7 +55,7 @@ class CSATQA(datasets.GeneratorBasedBuilder):
|
|
55 |
train_path = dl_manager.download_and_extract("./data/csatqa_eval.json")
|
56 |
return [
|
57 |
datasets.SplitGenerator(
|
58 |
-
|
59 |
gen_kwargs={
|
60 |
"filepath": train_path,
|
61 |
},
|
@@ -64,6 +64,9 @@ class CSATQA(datasets.GeneratorBasedBuilder):
|
|
64 |
|
65 |
def _generate_examples(self, filepath):
|
66 |
with open(filepath, encoding="utf-8") as f:
|
|
|
67 |
for key, row in enumerate(f):
|
68 |
data = json.loads(row)
|
69 |
-
|
|
|
|
|
|
55 |
train_path = dl_manager.download_and_extract("./data/csatqa_eval.json")
|
56 |
return [
|
57 |
datasets.SplitGenerator(
|
58 |
+
name=datasets.Split.TRAIN,
|
59 |
gen_kwargs={
|
60 |
"filepath": train_path,
|
61 |
},
|
|
|
64 |
|
65 |
def _generate_examples(self, filepath):
|
66 |
with open(filepath, encoding="utf-8") as f:
|
67 |
+
buffer = []
|
68 |
for key, row in enumerate(f):
|
69 |
data = json.loads(row)
|
70 |
+
buffer.append({"context":data["context"]})
|
71 |
+
for idx, dat in enumerate(buffer):
|
72 |
+
yield idx,dat
|