wza commited on
Commit
cb56a5d
1 Parent(s): 205cbd3

Update TimeTravel.py

Browse files
Files changed (1) hide show
  1. TimeTravel.py +7 -6
TimeTravel.py CHANGED
@@ -153,11 +153,12 @@ class TimeTravel(datasets.GeneratorBasedBuilder):
153
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
154
  with open(filepath, encoding="utf-8") as f:
155
  for key, row in enumerate(f):
 
156
  yield key, {
157
- "story_id": row["story_id"],
158
- "premise": row["premise"],
159
- "initial": row["initial"],
160
- "counterfactual": row["counterfactual"],
161
- "original_ending": row["original_ending"],
162
- "edited_ending": row["edited_ending"],
163
  }
 
153
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
154
  with open(filepath, encoding="utf-8") as f:
155
  for key, row in enumerate(f):
156
+ data = json.loads(row)
157
  yield key, {
158
+ "story_id": data["story_id"],
159
+ "premise": data["premise"],
160
+ "initial": data["initial"],
161
+ "counterfactual": data["counterfactual"],
162
+ "original_ending": data["original_ending"],
163
+ "edited_ending": data["edited_ending"],
164
  }