amphora commited on
Commit
d2c0e70
·
1 Parent(s): 603ef6b

Update csatqa.py

Browse files
Files changed (1) hide show
  1. csatqa.py +11 -4
csatqa.py CHANGED
@@ -62,11 +62,18 @@ class CSATQA(datasets.GeneratorBasedBuilder):
62
  ),
63
  ]
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
 
62
  ),
63
  ]
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
73
+
74
  def _generate_examples(self, filepath):
75
  with open(filepath, encoding="utf-8") as f:
 
76
  for key, row in enumerate(f):
77
  data = json.loads(row)
78
+ if data["Category"] == self.config.name:
79
+ yield key, data