Update files from the datasets library (from 1.6.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.6.0
xnli.py
CHANGED
@@ -16,7 +16,6 @@
|
|
16 |
# Lint as: python3
|
17 |
"""XNLI: The Cross-Lingual NLI Corpus."""
|
18 |
|
19 |
-
from __future__ import absolute_import, division, print_function
|
20 |
|
21 |
import collections
|
22 |
import csv
|
@@ -194,7 +193,8 @@ class Xnli(datasets.GeneratorBasedBuilder):
|
|
194 |
file = open(filepath, encoding="utf-8")
|
195 |
reader = csv.DictReader(file, delimiter="\t", quoting=csv.QUOTE_NONE)
|
196 |
for row_idx, row in enumerate(reader):
|
197 |
-
|
|
|
198 |
"premise": row["premise"],
|
199 |
"hypothesis": row["hypo"],
|
200 |
"label": row["label"].replace("contradictory", "contradiction"),
|
|
|
16 |
# Lint as: python3
|
17 |
"""XNLI: The Cross-Lingual NLI Corpus."""
|
18 |
|
|
|
19 |
|
20 |
import collections
|
21 |
import csv
|
|
|
193 |
file = open(filepath, encoding="utf-8")
|
194 |
reader = csv.DictReader(file, delimiter="\t", quoting=csv.QUOTE_NONE)
|
195 |
for row_idx, row in enumerate(reader):
|
196 |
+
key = str(file_idx) + "_" + str(row_idx)
|
197 |
+
yield key, {
|
198 |
"premise": row["premise"],
|
199 |
"hypothesis": row["hypo"],
|
200 |
"label": row["label"].replace("contradictory", "contradiction"),
|