Update xnli.py
Browse files
xnli.py
CHANGED
@@ -86,36 +86,16 @@ class Xnli(datasets.GeneratorBasedBuilder):
|
|
86 |
description=f"Plain text import of XNLI for the {lang} language",
|
87 |
)
|
88 |
for lang in _LANGUAGES
|
89 |
-
]
|
90 |
-
XnliConfig(
|
91 |
-
name="all_languages",
|
92 |
-
language="all_languages",
|
93 |
-
version=datasets.Version("1.1.0", ""),
|
94 |
-
description="Plain text import of XNLI for all languages",
|
95 |
-
)
|
96 |
-
]
|
97 |
-
|
98 |
def _info(self):
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
),
|
108 |
-
"label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
|
109 |
-
}
|
110 |
-
)
|
111 |
-
else:
|
112 |
-
features = datasets.Features(
|
113 |
-
{
|
114 |
-
"premise": datasets.Value("string"),
|
115 |
-
"hypothesis": datasets.Value("string"),
|
116 |
-
"label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
|
117 |
-
}
|
118 |
-
)
|
119 |
return datasets.DatasetInfo(
|
120 |
description=_DESCRIPTION,
|
121 |
features=features,
|
@@ -136,15 +116,6 @@ class Xnli(datasets.GeneratorBasedBuilder):
|
|
136 |
train_dir = os.path.join(dl_dirs["train_data"], "XNLI-MT-1.0", "multinli")
|
137 |
testval_dir = os.path.join(dl_dirs["testval_data"], "XNLI-1.0")
|
138 |
return [
|
139 |
-
datasets.SplitGenerator(
|
140 |
-
name=datasets.Split.TRAIN,
|
141 |
-
gen_kwargs={
|
142 |
-
"filepaths": [
|
143 |
-
os.path.join(train_dir, f"multinli.train.{lang}.tsv") for lang in self.config.languages
|
144 |
-
],
|
145 |
-
"data_format": "XNLI-MT",
|
146 |
-
},
|
147 |
-
),
|
148 |
datasets.SplitGenerator(
|
149 |
name=datasets.Split.TEST,
|
150 |
gen_kwargs={"filepaths": [os.path.join(testval_dir, "xnli.test.tsv")], "data_format": "XNLI"},
|
|
|
86 |
description=f"Plain text import of XNLI for the {lang} language",
|
87 |
)
|
88 |
for lang in _LANGUAGES
|
89 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
def _info(self):
|
91 |
+
|
92 |
+
features = datasets.Features(
|
93 |
+
{
|
94 |
+
"premise": datasets.Value("string"),
|
95 |
+
"hypothesis": datasets.Value("string"),
|
96 |
+
"label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
|
97 |
+
}
|
98 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
return datasets.DatasetInfo(
|
100 |
description=_DESCRIPTION,
|
101 |
features=features,
|
|
|
116 |
train_dir = os.path.join(dl_dirs["train_data"], "XNLI-MT-1.0", "multinli")
|
117 |
testval_dir = os.path.join(dl_dirs["testval_data"], "XNLI-1.0")
|
118 |
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
datasets.SplitGenerator(
|
120 |
name=datasets.Split.TEST,
|
121 |
gen_kwargs={"filepaths": [os.path.join(testval_dir, "xnli.test.tsv")], "data_format": "XNLI"},
|