Datasets:
Tasks:
Text Classification
Size:
100K<n<1M
Commit
•
ef92e1a
1
Parent(s):
b6ff9d4
Update xnli_parallel.py
Browse files- xnli_parallel.py +1 -24
xnli_parallel.py
CHANGED
@@ -97,7 +97,7 @@ class XnliParallel(datasets.GeneratorBasedBuilder):
|
|
97 |
features = datasets.Features(
|
98 |
{
|
99 |
"text": datasets.Value("string"),
|
100 |
-
"label": datasets.Value("
|
101 |
# These are the features of your dataset like images, labels ...
|
102 |
}
|
103 |
)
|
@@ -163,22 +163,6 @@ class XnliParallel(datasets.GeneratorBasedBuilder):
|
|
163 |
},
|
164 |
),
|
165 |
]
|
166 |
-
|
167 |
-
"""
|
168 |
-
def _generate_examples(self, filepaths):
|
169 |
-
# This function returns the examples in the raw (text) form.
|
170 |
-
_key = 0
|
171 |
-
for filepath in filepaths:
|
172 |
-
# logger.info("generating examples from = %s", filepath)
|
173 |
-
with open(filepath, encoding="utf-8") as f:
|
174 |
-
_list = f.read().split('\n')
|
175 |
-
if _list[-1] == '':
|
176 |
-
_list = _list[:-1]
|
177 |
-
for i in _list:
|
178 |
-
data = json.loads(i)
|
179 |
-
yield _key, data
|
180 |
-
_key += 1
|
181 |
-
"""
|
182 |
|
183 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
184 |
def _generate_examples(self, filepath, split):
|
@@ -195,10 +179,3 @@ class XnliParallel(datasets.GeneratorBasedBuilder):
|
|
195 |
"text": data[0],
|
196 |
"label": data[1],
|
197 |
}
|
198 |
-
|
199 |
-
# else:
|
200 |
-
# yield key, {
|
201 |
-
# "sentence": data["sentence"],
|
202 |
-
# "option2": data["option2"],
|
203 |
-
# "second_domain_answer": "" if split == "test" else data["second_domain_answer"],
|
204 |
-
# }
|
|
|
97 |
features = datasets.Features(
|
98 |
{
|
99 |
"text": datasets.Value("string"),
|
100 |
+
"label": datasets.Value("int64"),
|
101 |
# These are the features of your dataset like images, labels ...
|
102 |
}
|
103 |
)
|
|
|
163 |
},
|
164 |
),
|
165 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
168 |
def _generate_examples(self, filepath, split):
|
|
|
179 |
"text": data[0],
|
180 |
"label": data[1],
|
181 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|