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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# DialogZoo
|
2 |
+
|
3 |
+
To replicate data construction, three steps are required:
|
4 |
+
* Download data: ```bash scripts/download.sh```
|
5 |
+
* Convert origin data into our unified format: ```bash scripts/convert_to_unified.sh```
|
6 |
+
```
|
7 |
+
{
|
8 |
+
# Optional values: `single` or `multi`. Indicates whether it is a single-turn or multi-turn dialogue.
|
9 |
+
"turn": str,
|
10 |
+
|
11 |
+
# The domains involved in the dialogue (a list because some dialogues involve multiple domains).
|
12 |
+
"domain": [],
|
13 |
+
|
14 |
+
# The language of the dialogue, based on the original dataset annotations (e.g., en, fr, etc.).
|
15 |
+
"locale": str,
|
16 |
+
|
17 |
+
# The dialogue, represented as a list where each element is a dictionary for a single turn.
|
18 |
+
"dialog": [
|
19 |
+
{
|
20 |
+
# The roles involved in each turn. Some datasets may have multiple roles per turn, so it's a list.
|
21 |
+
# For datasets without role annotations:
|
22 |
+
# * Use `ROLE` for single-turn data.
|
23 |
+
# * Use `ROLE1`, `ROLE2`, etc., for multi-turn data.
|
24 |
+
"roles": [str, ...],
|
25 |
+
|
26 |
+
# The text of the current turn.
|
27 |
+
"utterance": str,
|
28 |
+
|
29 |
+
# Used for the "answer" in QA tasks.
|
30 |
+
"start": int,
|
31 |
+
"end": int,
|
32 |
+
"dialog_turn": int
|
33 |
+
|
34 |
+
# Rewritten text corresponding to the current turn.
|
35 |
+
"rewritten": str,
|
36 |
+
|
37 |
+
# Dialogue state, represented as a list where each element includes:
|
38 |
+
# Domain: Some datasets constrain slot-value pairs within specific domains.
|
39 |
+
# Intent: Some datasets constrain slot-value pairs within specific intents.
|
40 |
+
# Slot-value pairs: A list where each element includes a slot and its corresponding values.
|
41 |
+
# Slot name: A string.
|
42 |
+
# Values: A list where a slot may have multiple values.
|
43 |
+
# Each value includes four parts: the value itself, the normalized value,
|
44 |
+
# the character index in the current turn's text, and more.
|
45 |
+
# Relation: Some slots are equal to a value, while others are greater than a value.
|
46 |
+
# Defaults to "equal" if not specified.
|
47 |
+
# Requested slots: A list of slots that need to be queried but are not filled in the current state.
|
48 |
+
"belief_state": [
|
49 |
+
{
|
50 |
+
# Intent
|
51 |
+
"intent": str,
|
52 |
+
# Slot-value pairs
|
53 |
+
"informed_slot_value_table": [
|
54 |
+
{
|
55 |
+
# Slot name
|
56 |
+
"slot": str,
|
57 |
+
# Values
|
58 |
+
"values": [{
|
59 |
+
# Actual value
|
60 |
+
"value": str,
|
61 |
+
# Normalized value
|
62 |
+
"cononical_value": str
|
63 |
+
}, ...],
|
64 |
+
# Slot-value relation
|
65 |
+
"relation": str,
|
66 |
+
},
|
67 |
+
...
|
68 |
+
],
|
69 |
+
# Requested slots
|
70 |
+
"requested_slots": [],
|
71 |
+
# Domain
|
72 |
+
"domain": str,
|
73 |
+
}, ...
|
74 |
+
],
|
75 |
+
|
76 |
+
# Dialogue actions, represented as a list where each element includes:
|
77 |
+
# Domain: Some datasets constrain slot-value pairs within specific domains.
|
78 |
+
# Action: The actions involved in the current turn.
|
79 |
+
# Slot-value pairs: Same as in dialogue state.
|
80 |
+
"dialog_acts": [
|
81 |
+
{
|
82 |
+
# Action
|
83 |
+
"act": str,
|
84 |
+
# Slot-value pairs
|
85 |
+
"slot_value_table": [
|
86 |
+
{
|
87 |
+
# Slot name
|
88 |
+
"slot": str,
|
89 |
+
# Slot-value relation
|
90 |
+
"relation": str,
|
91 |
+
# Values
|
92 |
+
"values": [
|
93 |
+
{
|
94 |
+
# Actual value
|
95 |
+
"value": str,
|
96 |
+
# Normalized value
|
97 |
+
"cononical_value": str,
|
98 |
+
# Start position
|
99 |
+
"start": int,
|
100 |
+
# End position
|
101 |
+
"end": int,
|
102 |
+
},...
|
103 |
+
]
|
104 |
+
},
|
105 |
+
...
|
106 |
+
],
|
107 |
+
# Domain
|
108 |
+
"domain": str,
|
109 |
+
},
|
110 |
+
...
|
111 |
+
],
|
112 |
+
|
113 |
+
# Slot filling
|
114 |
+
"slots_to_fill": {
|
115 |
+
"intent": str,
|
116 |
+
"slot_value_table": [
|
117 |
+
{
|
118 |
+
"slot": str,
|
119 |
+
"values": [
|
120 |
+
{
|
121 |
+
"value": str,
|
122 |
+
"start": int,
|
123 |
+
"end": int
|
124 |
+
}
|
125 |
+
],
|
126 |
+
"relation": str, # '=', '<=', and so on
|
127 |
+
}
|
128 |
+
]
|
129 |
+
},
|
130 |
+
|
131 |
+
# Named entity recognition
|
132 |
+
"named_entity_recognition": [
|
133 |
+
{
|
134 |
+
"type": str,
|
135 |
+
"values": [
|
136 |
+
{
|
137 |
+
"value": str,
|
138 |
+
"start": int,
|
139 |
+
"end": int
|
140 |
+
}, ...
|
141 |
+
]
|
142 |
+
}, ...
|
143 |
+
],
|
144 |
+
|
145 |
+
"characters": [
|
146 |
+
{
|
147 |
+
"value": str,
|
148 |
+
"start": int,
|
149 |
+
"end": int
|
150 |
+
}
|
151 |
+
]
|
152 |
+
|
153 |
+
# Intent detection
|
154 |
+
"active_intents": [str],
|
155 |
+
|
156 |
+
# Query
|
157 |
+
"query" {
|
158 |
+
...
|
159 |
+
},
|
160 |
+
|
161 |
+
# Query result
|
162 |
+
"querying_result": {
|
163 |
+
...
|
164 |
+
},
|
165 |
+
|
166 |
+
# Recorded satisfied main items
|
167 |
+
"main_items": [],
|
168 |
+
|
169 |
+
# Aspect Sentiment Triplet Extraction task, represented as a list where each element includes three parts:
|
170 |
+
# Target entity.
|
171 |
+
# Related sentiment.
|
172 |
+
# Words reflecting the sentiment.
|
173 |
+
"aspects": [
|
174 |
+
{
|
175 |
+
# Target entity
|
176 |
+
"target": {
|
177 |
+
# Entity value
|
178 |
+
"value": str,
|
179 |
+
# Start position in the current turn's text
|
180 |
+
"start": int,
|
181 |
+
# End position in the current turn's text
|
182 |
+
"end": int
|
183 |
+
},
|
184 |
+
|
185 |
+
# Category of the target entity
|
186 |
+
"category": str,
|
187 |
+
|
188 |
+
# Words reflecting the sentiment
|
189 |
+
"opinion": {
|
190 |
+
# Sentiment word
|
191 |
+
"value": str,
|
192 |
+
# Start position in the current turn's text
|
193 |
+
"start": int,
|
194 |
+
# End position in the current turn's text
|
195 |
+
"end": int
|
196 |
+
},
|
197 |
+
# Related sentiment
|
198 |
+
"sentiment": str
|
199 |
+
}
|
200 |
+
],
|
201 |
+
|
202 |
+
"emotions": [
|
203 |
+
{
|
204 |
+
"emotion": str,
|
205 |
+
"sentiment": "positive", "negative", or "ambiguous",
|
206 |
+
"evidences": [
|
207 |
+
{
|
208 |
+
"turn": int,
|
209 |
+
"span": str,
|
210 |
+
"start": int,
|
211 |
+
"end": int
|
212 |
+
}
|
213 |
+
],
|
214 |
+
"evidence_types": [str]
|
215 |
+
}
|
216 |
+
],
|
217 |
+
|
218 |
+
"kg_label": str,
|
219 |
+
|
220 |
+
# Knowledge that may be required for each turn, used to select knowledge.
|
221 |
+
"knowledge_to_select": str,
|
222 |
+
|
223 |
+
# SQL
|
224 |
+
"sql": str,
|
225 |
+
|
226 |
+
# Rewritten text
|
227 |
+
"rewritten": str,
|
228 |
+
|
229 |
+
"roles_to_select": [str],
|
230 |
+
},
|
231 |
+
|
232 |
+
],
|
233 |
+
|
234 |
+
# Summary derived from the entire dialogue.
|
235 |
+
"summary": str,
|
236 |
+
|
237 |
+
# Entity relations determined from the entire dialogue.
|
238 |
+
"instance_relations": [
|
239 |
+
{
|
240 |
+
"instance1": str,
|
241 |
+
"instance2": str,
|
242 |
+
"relations": [
|
243 |
+
{
|
244 |
+
"relation": str,
|
245 |
+
"trigger": str
|
246 |
+
}, ...
|
247 |
+
]
|
248 |
+
}, ...
|
249 |
+
]
|
250 |
+
|
251 |
+
# Role relations determined from the entire dialogue.
|
252 |
+
"role_relations": [
|
253 |
+
{
|
254 |
+
"turn": int,
|
255 |
+
"relation": str
|
256 |
+
}
|
257 |
+
],
|
258 |
+
|
259 |
+
# Used in FriendsPersona to determine a character's persona based on the entire dialogue.
|
260 |
+
"role_personas": [
|
261 |
+
{
|
262 |
+
"name": str,
|
263 |
+
"personas": [
|
264 |
+
{
|
265 |
+
"persona": str,
|
266 |
+
"sentiment": int
|
267 |
+
}, ...
|
268 |
+
]
|
269 |
+
}
|
270 |
+
],
|
271 |
+
|
272 |
+
# External knowledge required for the dialogue.
|
273 |
+
"knowledge": {
|
274 |
+
# `text`, `persona`, `kg`, or `schema`.
|
275 |
+
"type": str,
|
276 |
+
|
277 |
+
# For `text`.
|
278 |
+
"value": str,
|
279 |
+
|
280 |
+
# For `persona`, persona of all roles, used for personachat.
|
281 |
+
"value": [
|
282 |
+
{
|
283 |
+
# Role name, matching the dialogue turn.
|
284 |
+
"role": str,
|
285 |
+
|
286 |
+
# Persona description, which may include several sentences.
|
287 |
+
"description": []
|
288 |
+
},
|
289 |
+
...
|
290 |
+
]
|
291 |
+
|
292 |
+
# For `kg`.
|
293 |
+
"value": {
|
294 |
+
# `directed` or `undirected`.
|
295 |
+
"direction": str,
|
296 |
+
|
297 |
+
# Graph.
|
298 |
+
"graph": [
|
299 |
+
{
|
300 |
+
# Source node.
|
301 |
+
"source": str,
|
302 |
+
|
303 |
+
# Target node.
|
304 |
+
"target": str,
|
305 |
+
|
306 |
+
# Relation.
|
307 |
+
"relation": str
|
308 |
+
},
|
309 |
+
...
|
310 |
+
]
|
311 |
+
}
|
312 |
+
|
313 |
+
# For `schema`.
|
314 |
+
"value": {
|
315 |
+
...
|
316 |
+
}
|
317 |
+
|
318 |
+
# For `dialogue`.
|
319 |
+
"value": {
|
320 |
+
"dialog": [],
|
321 |
+
"relations": []
|
322 |
+
}
|
323 |
+
|
324 |
+
# For `wiki`.
|
325 |
+
"value": {
|
326 |
+
...
|
327 |
+
}
|
328 |
+
|
329 |
+
# For `sql`.
|
330 |
+
"value": [
|
331 |
+
{
|
332 |
+
"turn": int,
|
333 |
+
"sql": str,
|
334 |
+
"result": ...
|
335 |
+
}, ...
|
336 |
+
],
|
337 |
+
|
338 |
+
# For dialogues based on specific article excerpts, this field indicates the article and section titles.
|
339 |
+
"value": {
|
340 |
+
"article title": str,
|
341 |
+
"section title": str
|
342 |
+
},
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
```
|
347 |
+
* Linearize: ```bash scripts/convert_to_seq.sh```
|