JeremyAlain
commited on
Commit
•
f0cd1eb
1
Parent(s):
02d81b5
loading script created
Browse files- 123_test.py +15 -16
123_test.py
CHANGED
@@ -131,19 +131,18 @@ class FewshotPretraining(datasets.GeneratorBasedBuilder):
|
|
131 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
132 |
print("generating {}".format(file_paths))
|
133 |
for file_path in file_paths:
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
}
|
|
|
131 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
132 |
print("generating {}".format(file_paths))
|
133 |
for file_path in file_paths:
|
134 |
+
data = pd.read_json(file_path, orient="records", lines=True)
|
135 |
+
for i in range(data.shape[0]):
|
136 |
+
row = data.iloc[i]
|
137 |
+
# Yields examples as (key, example) tuples
|
138 |
+
key = row["task"] + "_i"
|
139 |
+
yield key, {
|
140 |
+
"task": data["task"],
|
141 |
+
"input": data["input"],
|
142 |
+
"output": data["output"],
|
143 |
+
"options": data["options"],
|
144 |
+
"pageTitle": data["pageTitle"],
|
145 |
+
"outputColName": data["outputColName"],
|
146 |
+
"url": data["url"],
|
147 |
+
"wdcFile": data["wdcFile"],
|
148 |
+
}
|
|