Update paws-x-all.py
Browse files- paws-x-all.py +11 -11
paws-x-all.py
CHANGED
@@ -170,15 +170,15 @@ class PAWSX(datasets.GeneratorBasedBuilder):
|
|
170 |
),
|
171 |
]
|
172 |
|
173 |
-
def _generate_examples(self,
|
174 |
"""Yields examples."""
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
170 |
),
|
171 |
]
|
172 |
|
173 |
+
def _generate_examples(self, filepaths, split):
|
174 |
"""Yields examples."""
|
175 |
+
for f_id_, filepath in enumerate(filepaths):
|
176 |
+
with open(filepath, encoding="utf-8") as f:
|
177 |
+
data = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
|
178 |
+
for id_, row in enumerate(data):
|
179 |
+
yield f"{id_}{f_id_}", {
|
180 |
+
"id": row["id"],
|
181 |
+
"sentence1": row["sentence1"],
|
182 |
+
"sentence2": row["sentence2"],
|
183 |
+
"label": row["label"],
|
184 |
+
}
|