Update TimeTravel.py
Browse files- 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":
|
158 |
-
"premise":
|
159 |
-
"initial":
|
160 |
-
"counterfactual":
|
161 |
-
"original_ending":
|
162 |
-
"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 |
}
|