amphora commited on
Commit
ff114f8
1 Parent(s): 1252ae5

Update csatqa.py

Browse files
Files changed (1) hide show
  1. csatqa.py +12 -11
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
- buffer.append({
74
- "question": data["question"],
75
- "context" : data["context"],
76
- "option#1": data["option#1"],
77
- "option#2": data["option#2"],
78
- "option#3": data["option#3"],
79
- "option#4": data["option#4"],
80
- "option#5": data["option#5"],
81
- "gold": data["gold"],
82
- "category": data["Category"],
83
- "human_peformance": data["Human_Peformance"]})
 
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