Datasets:
Update DiaBLa.py
Browse files
DiaBLa.py
CHANGED
@@ -119,7 +119,7 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
119 |
),
|
120 |
'initiated_dialogue': datasets.Value('bool'),
|
121 |
'turn_number': datasets.Value('int64'),
|
122 |
-
'lang':
|
123 |
}
|
124 |
),
|
125 |
'user2': datasets.features.Sequence(
|
@@ -132,7 +132,7 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
132 |
),
|
133 |
'initiated_dialogue': datasets.Value('bool'),
|
134 |
'turn_number': datasets.Value('int64'),
|
135 |
-
'lang':
|
136 |
}
|
137 |
)
|
138 |
}
|
@@ -190,8 +190,9 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
190 |
dialogue_info_keys = ['start_time', 'end_time', 'scenario',
|
191 |
'user1', 'user2', 'translation_model',
|
192 |
'final_evaluation_user1', 'final_evaluation_user2']
|
193 |
-
for
|
194 |
-
|
|
|
195 |
if info_to_remove in dialogue[user]:
|
196 |
del dialogue[user][info_to_remove]
|
197 |
dialogue_info = {k: dialogue[k] for k in dialogue_info_keys}
|
|
|
119 |
),
|
120 |
'initiated_dialogue': datasets.Value('bool'),
|
121 |
'turn_number': datasets.Value('int64'),
|
122 |
+
'lang': ClassLabel(num_classes=2, names=['english', 'french']),
|
123 |
}
|
124 |
),
|
125 |
'user2': datasets.features.Sequence(
|
|
|
132 |
),
|
133 |
'initiated_dialogue': datasets.Value('bool'),
|
134 |
'turn_number': datasets.Value('int64'),
|
135 |
+
'lang': ClassLabel(num_classes=2, names=['english', 'french']),
|
136 |
}
|
137 |
)
|
138 |
}
|
|
|
190 |
dialogue_info_keys = ['start_time', 'end_time', 'scenario',
|
191 |
'user1', 'user2', 'translation_model',
|
192 |
'final_evaluation_user1', 'final_evaluation_user2']
|
193 |
+
for user in 'user1', 'user2':
|
194 |
+
dialogue[user]['lang'] = dialogue[user]['language']
|
195 |
+
for info_to_remove in ['eval-stage', 'useragent', 'language']:
|
196 |
if info_to_remove in dialogue[user]:
|
197 |
del dialogue[user][info_to_remove]
|
198 |
dialogue_info = {k: dialogue[k] for k in dialogue_info_keys}
|