Datasets:
Update DiaBLa.py
Browse files
DiaBLa.py
CHANGED
@@ -61,14 +61,21 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
61 |
description=_DESCRIPTION,
|
62 |
features=datasets.Features(
|
63 |
{
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
69 |
{
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
),
|
74 |
}
|
@@ -120,15 +127,15 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
120 |
normalised_text = utterance['normalised_version']
|
121 |
id_ = dialogue_name + '_' + utterance_id
|
122 |
utterance_instance = {
|
123 |
-
'
|
124 |
-
'
|
125 |
-
'
|
126 |
'id': id_,
|
127 |
-
'
|
128 |
-
'
|
129 |
}
|
130 |
# add to history (without dialogue info and history)
|
131 |
dialogue_history.append(utterance_instance.copy())
|
132 |
-
utterance_instance['
|
133 |
utterance_instance['dialogue_history'] = dialogue_history
|
134 |
yield id_, utterance_instance
|
|
|
61 |
description=_DESCRIPTION,
|
62 |
features=datasets.Features(
|
63 |
{
|
64 |
+
'id': datasets.Value("string"),
|
65 |
+
'orig': datasets.Value("string"),
|
66 |
+
'norm': datasets.Value("string"),
|
67 |
+
'mt': datasets.Value("string"),
|
68 |
+
'ref': datasets.Value("string"),
|
69 |
+
'utterance_meta': datasets.features.Sequence(
|
70 |
{
|
71 |
+
'judgment': ClassLabel(num_classes=3, names=['poor', 'medium', 'perfect']
|
72 |
+
'verbatim': datasets.Value("string"),
|
73 |
+
'problems': datasets.features.Sequence(
|
74 |
+
[
|
75 |
+
ClassLabel(num_classes=5,
|
76 |
+
names=['coherence', 'grammar', 'meaning', 'word choice', 'style']
|
77 |
+
]
|
78 |
+
)
|
79 |
}
|
80 |
),
|
81 |
}
|
|
|
127 |
normalised_text = utterance['normalised_version']
|
128 |
id_ = dialogue_name + '_' + utterance_id
|
129 |
utterance_instance = {
|
130 |
+
'orig': original_text,
|
131 |
+
'norm': normalised_text,
|
132 |
+
'mt': mt_text,
|
133 |
'id': id_,
|
134 |
+
'ref': reference_text,
|
135 |
+
'utterance_meta': utterance_info
|
136 |
}
|
137 |
# add to history (without dialogue info and history)
|
138 |
dialogue_history.append(utterance_instance.copy())
|
139 |
+
utterance_instance['dialogue_meta'] = utterance_info
|
140 |
utterance_instance['dialogue_history'] = dialogue_history
|
141 |
yield id_, utterance_instance
|