Datasets:
Robin Kurtz
commited on
Commit
•
703826a
1
Parent(s):
5972baf
fix label classes
Browse files- overlim.py +9 -9
overlim.py
CHANGED
@@ -425,10 +425,10 @@ class OverLim(datasets.GeneratorBasedBuilder):
|
|
425 |
def _info(self):
|
426 |
features = {feature: datasets.Value("string") for feature in self.config.features if feature != "label"}
|
427 |
if self.config.label_classes:
|
428 |
-
if self.config.task_name in ["cb", "mnli", "qnli", "rte"]:
|
429 |
-
|
430 |
-
else:
|
431 |
-
|
432 |
else:
|
433 |
features["label"] = datasets.Value("float32")
|
434 |
features["idx"] = datasets.Value("int32")
|
@@ -491,11 +491,11 @@ def _cast_label(label):
|
|
491 |
return label
|
492 |
except ValueError:
|
493 |
pass
|
494 |
-
try:
|
495 |
-
|
496 |
-
|
497 |
-
except ValueError:
|
498 |
-
|
499 |
return label
|
500 |
|
501 |
|
|
|
425 |
def _info(self):
|
426 |
features = {feature: datasets.Value("string") for feature in self.config.features if feature != "label"}
|
427 |
if self.config.label_classes:
|
428 |
+
#if self.config.task_name in ["cb", "mnli", "qnli", "rte"]:
|
429 |
+
# features["label"] = datasets.Value("string")
|
430 |
+
#else:
|
431 |
+
features["label"] = datasets.features.ClassLabel(names=self.config.label_classes)
|
432 |
else:
|
433 |
features["label"] = datasets.Value("float32")
|
434 |
features["idx"] = datasets.Value("int32")
|
|
|
491 |
return label
|
492 |
except ValueError:
|
493 |
pass
|
494 |
+
# try:
|
495 |
+
# label = int(bool(label))
|
496 |
+
# return label
|
497 |
+
# except ValueError:
|
498 |
+
# pass
|
499 |
return label
|
500 |
|
501 |
|