Datasets:
Update csatqa.py
Browse files
csatqa.py
CHANGED
@@ -70,17 +70,18 @@ class CSATQA(datasets.GeneratorBasedBuilder):
|
|
70 |
buffer = []
|
71 |
for key, row in enumerate(f):
|
72 |
data = json.loads(row)
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
84 |
|
85 |
for idx, dat in enumerate(buffer):
|
86 |
yield idx,dat
|
|
|
70 |
buffer = []
|
71 |
for key, row in enumerate(f):
|
72 |
data = json.loads(row)
|
73 |
+
if data["Category"] == self.config.name:
|
74 |
+
buffer.append({
|
75 |
+
"question": data["question"],
|
76 |
+
"context" : data["context"],
|
77 |
+
"option#1": data["option#1"],
|
78 |
+
"option#2": data["option#2"],
|
79 |
+
"option#3": data["option#3"],
|
80 |
+
"option#4": data["option#4"],
|
81 |
+
"option#5": data["option#5"],
|
82 |
+
"gold": data["gold"],
|
83 |
+
"category": data["Category"],
|
84 |
+
"human_peformance": data["Human_Peformance"]})
|
85 |
|
86 |
for idx, dat in enumerate(buffer):
|
87 |
yield idx,dat
|