Igor
commited on
Commit
·
66b86ce
1
Parent(s):
d1f7b01
Update daiso.py
Browse files
daiso.py
CHANGED
@@ -1388,17 +1388,20 @@ class DAISO(datasets.GeneratorBasedBuilder):
|
|
1388 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
1389 |
features = {feature: datasets.Value("string") for feature in self.config.features}
|
1390 |
if self.config.label_classes:
|
1391 |
-
|
|
|
1392 |
set(['OOD' if label == 'null' or label is None or label == 'None' or label == 'OOD' else label for label in
|
1393 |
-
list(self.config.label_classes.keys())]
|
|
|
1394 |
))
|
|
|
1395 |
features["Label_ISO"] = datasets.features.ClassLabel(
|
1396 |
names=list(set([map.get("ISO", "OOD") for map in self.config.label_classes.values()])))
|
1397 |
|
1398 |
# Add the missing features
|
1399 |
features["Dialogue_Act_Base"] = datasets.Value("string")
|
1400 |
-
|
1401 |
-
|
1402 |
|
1403 |
features["Idx"] = datasets.Value("int32")
|
1404 |
features["Speaker_Id"] = datasets.features.ClassLabel(names=self.config.speakers)
|
@@ -1483,7 +1486,7 @@ class DAISO(datasets.GeneratorBasedBuilder):
|
|
1483 |
label = example["Dialogue_Act"]
|
1484 |
example["Label"] = label
|
1485 |
example["Label_ISO"] = self.config.label_classes.get(label,{}).get("ISO","OOD")
|
1486 |
-
|
1487 |
|
1488 |
if "Speaker" in example:
|
1489 |
speaker = example["Speaker"]
|
|
|
1388 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
1389 |
features = {feature: datasets.Value("string") for feature in self.config.features}
|
1390 |
if self.config.label_classes:
|
1391 |
+
|
1392 |
+
labels = list(
|
1393 |
set(['OOD' if label == 'null' or label is None or label == 'None' or label == 'OOD' else label for label in
|
1394 |
+
list(self.config.label_classes.keys())]
|
1395 |
+
features["Label"] = datasets.features.ClassLabel(names = labels)
|
1396 |
))
|
1397 |
+
|
1398 |
features["Label_ISO"] = datasets.features.ClassLabel(
|
1399 |
names=list(set([map.get("ISO", "OOD") for map in self.config.label_classes.values()])))
|
1400 |
|
1401 |
# Add the missing features
|
1402 |
features["Dialogue_Act_Base"] = datasets.Value("string")
|
1403 |
+
features["Label_Base"] = datasets.features.ClassLabel(
|
1404 |
+
names=list(set([self.config.label_classes.map.get("base", "OOD") for map in values()])))
|
1405 |
|
1406 |
features["Idx"] = datasets.Value("int32")
|
1407 |
features["Speaker_Id"] = datasets.features.ClassLabel(names=self.config.speakers)
|
|
|
1486 |
label = example["Dialogue_Act"]
|
1487 |
example["Label"] = label
|
1488 |
example["Label_ISO"] = self.config.label_classes.get(label,{}).get("ISO","OOD")
|
1489 |
+
example["Label_Base"] = self.config.label_classes.get(label,{}).get("base","OOD")
|
1490 |
|
1491 |
if "Speaker" in example:
|
1492 |
speaker = example["Speaker"]
|