anjalyjayakrishnan commited on
Commit
91099c4
·
1 Parent(s): 75474dd
Files changed (1) hide show
  1. test.py +14 -11
test.py CHANGED
@@ -144,15 +144,18 @@ class Test(datasets.GeneratorBasedBuilder):
144
 
145
  def _generate_examples(self, filepath):
146
  print("**********", filepath)
147
- with open(filepath, encoding="utf-8") as f:
148
- for key, row in enumerate(f):
149
- print("---------------------------------")
150
- print(key, type(key))
151
- print(row, type(row))
152
- data = json.loads(row)
153
- print(data)
154
- yield key, {
155
- "sentence": data["sentence"],
156
- "path": data["path"],
157
- }
 
 
 
158
 
 
144
 
145
  def _generate_examples(self, filepath):
146
  print("**********", filepath)
147
+ with open(filepath) as f:
148
+ data = json.load(f)
149
+ print(data)
150
+ # with open(filepath, encoding="utf-8") as f:
151
+ # for key, row in enumerate(f):
152
+ # print("---------------------------------")
153
+ # print(key, type(key))
154
+ # print(row, type(row))
155
+ # data = json.loads(row)
156
+ # print(data)
157
+ # yield key, {
158
+ # "sentence": data["sentence"],
159
+ # "path": data["path"],
160
+ # }
161