Datasets:
Update DiaBLa.py
Browse files
DiaBLa.py
CHANGED
@@ -67,100 +67,7 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
67 |
'norm': datasets.Value('string'),
|
68 |
'mt': datasets.Value('string'),
|
69 |
'ref': datasets.Value('string'),
|
70 |
-
|
71 |
-
{
|
72 |
-
'eval-judgment': ClassLabel(num_classes=3, names=['poor', 'medium', 'perfect']),
|
73 |
-
'eval-verbatim': datasets.Value('string'),
|
74 |
-
'eval-problems': datasets.features.Sequence(
|
75 |
-
[
|
76 |
-
ClassLabel(num_classes=6, names=['coherence', 'grammar', 'meaning', 'word choice', 'style', 'other'])
|
77 |
-
]
|
78 |
-
),
|
79 |
-
'lang': ClassLabel(num_classes=2, names=['english', 'french']),
|
80 |
-
}
|
81 |
-
),
|
82 |
-
'dialogue_meta': datasets.features.Sequence(
|
83 |
-
{
|
84 |
-
'start_time': datasets.Value('string'),
|
85 |
-
'end_time' : datasets.Value('string'),
|
86 |
-
'translation_model': datasets.Value('string'),
|
87 |
-
'final_evaluation_user1': datasets.features.Sequence(
|
88 |
-
{
|
89 |
-
'style': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
90 |
-
'coherence': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
91 |
-
'grammaticality': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
92 |
-
'meaning': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
93 |
-
'word_choice': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent'])
|
94 |
-
}
|
95 |
-
),
|
96 |
-
'final_evaluation_user2': datasets.features.Sequence(
|
97 |
-
{
|
98 |
-
'style': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
99 |
-
'coherence': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
100 |
-
'grammaticality': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
101 |
-
'meaning': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent']),
|
102 |
-
'word_choice': ClassLabel(num_classes=4, names=['poor', 'average', 'good', 'excellent'])
|
103 |
-
}
|
104 |
-
),
|
105 |
-
'scenario': datasets.features.Sequence(
|
106 |
-
[
|
107 |
-
[
|
108 |
-
datasets.Value("string")
|
109 |
-
]
|
110 |
-
]
|
111 |
-
),
|
112 |
-
'user1': datasets.features.Sequence(
|
113 |
-
{
|
114 |
-
'rolenum': datasets.Value('int64'),
|
115 |
-
'role': datasets.features.Sequence(
|
116 |
-
[
|
117 |
-
datasets.Value('string')
|
118 |
-
]
|
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(
|
126 |
-
{
|
127 |
-
'rolenum': datasets.Value('int64'),
|
128 |
-
'role': datasets.features.Sequence(
|
129 |
-
[
|
130 |
-
datasets.Value('string')
|
131 |
-
]
|
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 |
-
}
|
139 |
-
),
|
140 |
-
'dialogue_history': datasets.features.Sequence(
|
141 |
-
[
|
142 |
-
datasets.features.Sequence(
|
143 |
-
{
|
144 |
-
'id': datasets.Value('string'),
|
145 |
-
'orig': datasets.Value('string'),
|
146 |
-
'norm': datasets.Value('string'),
|
147 |
-
'mt': datasets.Value('string'),
|
148 |
-
'ref': datasets.Value('string'),
|
149 |
-
'utterance_meta': datasets.features.Sequence(
|
150 |
-
{
|
151 |
-
'eval-judgment': ClassLabel(num_classes=3, names=['poor', 'medium', 'perfect']),
|
152 |
-
'eval-verbatim': datasets.Value("string"),
|
153 |
-
'eval-problems': datasets.features.Sequence(
|
154 |
-
[
|
155 |
-
ClassLabel(num_classes=6, names=['coherence', 'grammar', 'meaning', 'word choice', 'style', 'other'])
|
156 |
-
]
|
157 |
-
),
|
158 |
-
'lang': ClassLabel(num_classes=2, names=['english', 'french']),
|
159 |
-
}
|
160 |
-
),
|
161 |
-
}),
|
162 |
-
]
|
163 |
-
)
|
164 |
}
|
165 |
),
|
166 |
# TODO?
|
@@ -225,11 +132,11 @@ class Diabla(datasets.GeneratorBasedBuilder):
|
|
225 |
'mt': mt_text,
|
226 |
'id': id_,
|
227 |
'ref': reference_text,
|
228 |
-
'utterance_meta': utterance_info
|
229 |
}
|
230 |
|
231 |
# add to history (without dialogue info and history)
|
232 |
dialogue_history.append(utterance_instance.copy())
|
233 |
-
utterance_instance['dialogue_meta'] = dialogue_info
|
234 |
-
utterance_instance['dialogue_history'] = dialogue_history
|
235 |
yield id_, utterance_instance
|
|
|
67 |
'norm': datasets.Value('string'),
|
68 |
'mt': datasets.Value('string'),
|
69 |
'ref': datasets.Value('string'),
|
70 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
),
|
73 |
# TODO?
|
|
|
132 |
'mt': mt_text,
|
133 |
'id': id_,
|
134 |
'ref': reference_text,
|
135 |
+
#'utterance_meta': utterance_info
|
136 |
}
|
137 |
|
138 |
# add to history (without dialogue info and history)
|
139 |
dialogue_history.append(utterance_instance.copy())
|
140 |
+
#utterance_instance['dialogue_meta'] = dialogue_info
|
141 |
+
#utterance_instance['dialogue_history'] = dialogue_history
|
142 |
yield id_, utterance_instance
|