File size: 11,368 Bytes
757cc78
 
3f9023f
 
 
9373819
3f9023f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9373819
3f9023f
 
0b2de2e
 
757cc78
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# DialogZoo
## Data construction
To replicate data construction, three steps are required:
* Download data: ```bash scripts/download.sh```
* Convert origin data into our unified format: ```bash scripts/convert_to_unified.sh```
```
{
    # Optional values: `single` or `multi`. Indicates whether it is a single-turn or multi-turn dialogue.
    "turn": str,

    # The domains involved in the dialogue (a list because some dialogues involve multiple domains).
    "domain": [],

    # The language of the dialogue, based on the original dataset annotations (e.g., en, fr, etc.).
    "locale": str,

    # The dialogue, represented as a list where each element is a dictionary for a single turn.
    "dialog": [
        {
            # The roles involved in each turn. Some datasets may have multiple roles per turn, so it's a list.
            # For datasets without role annotations:
            #   * Use `ROLE` for single-turn data.
            #   * Use `ROLE1`, `ROLE2`, etc., for multi-turn data.
            "roles": [str, ...],

            # The text of the current turn.
            "utterance": str,
            
            # Used for the "answer" in QA tasks.
            "start": int,
            "end": int,
            "dialog_turn": int

            # Rewritten text corresponding to the current turn.
            "rewritten": str,

            # Dialogue state, represented as a list where each element includes:
            #   Domain: Some datasets constrain slot-value pairs within specific domains.
            #   Intent: Some datasets constrain slot-value pairs within specific intents.
            #   Slot-value pairs: A list where each element includes a slot and its corresponding values.
            #     Slot name: A string.
            #     Values: A list where a slot may have multiple values.
            #       Each value includes four parts: the value itself, the normalized value, 
            #       the character index in the current turn's text, and more.
            #     Relation: Some slots are equal to a value, while others are greater than a value. 
            #       Defaults to "equal" if not specified.
            #   Requested slots: A list of slots that need to be queried but are not filled in the current state.
            "belief_state": [
                {
                    # Intent
                    "intent": str,
                    # Slot-value pairs
                    "informed_slot_value_table": [
                        {
                            # Slot name
                            "slot": str,
                            # Values
                            "values": [{
                                # Actual value
                                "value": str,
                                # Normalized value
                                "cononical_value": str
                            }, ...],
                            # Slot-value relation
                            "relation": str,
                        },
                        ...
                    ],
                    # Requested slots
                    "requested_slots": [],
                    # Domain
                    "domain": str,
                }, ...
            ],

            # Dialogue actions, represented as a list where each element includes:
            #   Domain: Some datasets constrain slot-value pairs within specific domains.
            #   Action: The actions involved in the current turn.
            #   Slot-value pairs: Same as in dialogue state.
            "dialog_acts": [
                {
                    # Action
                    "act": str,
                    # Slot-value pairs
                    "slot_value_table": [
                        {
                            # Slot name
                            "slot": str,
                            # Slot-value relation
                            "relation": str,
                            # Values
                            "values": [
                                {
                                    # Actual value
                                    "value": str,
                                    # Normalized value
                                    "cononical_value": str,
                                    # Start position
                                    "start": int,
                                    # End position
                                    "end": int,
                                },...
                            ]
                        },
                        ...
                    ],
                    # Domain
                    "domain": str,
                },
                ...
            ],
            
            # Slot filling
            "slots_to_fill": {
                "intent": str,
                "slot_value_table": [
                    {
                        "slot": str,
                        "values": [
                            {
                                "value": str,
                                "start": int,
                                "end": int
                            }
                        ],
                        "relation": str, # '=', '<=', and so on
                    }
                ]
            },
            
            # Named entity recognition
            "named_entity_recognition": [
                {
                    "type": str,
                    "values": [
                        {
                            "value": str,
                            "start": int,
                            "end": int
                        }, ...
                    ]
                }, ...
            ],

            "characters": [
                {
                    "value": str,
                    "start": int,
                    "end": int
                }
            ]
            
            # Intent detection
            "active_intents": [str],

            # Query
            "query" {
                ...
            },
            
            # Query result
            "querying_result": {
               ...
            },

            # Recorded satisfied main items
            "main_items": [],

            # Aspect Sentiment Triplet Extraction task, represented as a list where each element includes three parts:
            #   Target entity.
            #   Related sentiment.
            #   Words reflecting the sentiment.
            "aspects": [
                {
                    # Target entity
                    "target": {
                        # Entity value
                        "value": str,
                        # Start position in the current turn's text
                        "start": int,
                        # End position in the current turn's text
                        "end": int
                    },
                    
                    # Category of the target entity
                    "category": str,
                    
                    # Words reflecting the sentiment
                    "opinion": {
                        # Sentiment word
                        "value": str,
                        # Start position in the current turn's text
                        "start": int,
                        # End position in the current turn's text
                        "end": int
                    },
                    # Related sentiment
                    "sentiment": str
                }
            ],

            "emotions": [
                {
                    "emotion": str,
                    "sentiment": "positive", "negative", or "ambiguous",
                    "evidences": [
                        {
                            "turn": int,
                            "span": str,
                            "start": int,
                            "end": int
                        }
                    ],
                    "evidence_types": [str]
                }
            ],

            "kg_label": str,
            
            # Knowledge that may be required for each turn, used to select knowledge.
            "knowledge_to_select": str,
            
            # SQL
            "sql": str,
            
            # Rewritten text
            "rewritten": str,
            
            "roles_to_select": [str],
        },

    ],

    # Summary derived from the entire dialogue.
    "summary": str,

    # Entity relations determined from the entire dialogue.
    "instance_relations": [
        {
            "instance1": str,
            "instance2": str,
            "relations": [
                {
                    "relation": str,
                    "trigger": str
                }, ...
            ]
        }, ...
    ]
    
    # Role relations determined from the entire dialogue.
    "role_relations": [
        {
            "turn": int,
            "relation": str
        }
    ],
    
    # Used in FriendsPersona to determine a character's persona based on the entire dialogue.
    "role_personas": [
        {
            "name": str,
            "personas": [
                {
                    "persona": str,
                    "sentiment": int
                }, ...
            ]
        }
    ],

    # External knowledge required for the dialogue.
    "knowledge": {
        # `text`, `persona`, `kg`, or `schema`.
        "type": str,

        # For `text`.
        "value": str,

        # For `persona`, persona of all roles, used for personachat.
        "value": [
            {
                # Role name, matching the dialogue turn.
                "role": str,

                # Persona description, which may include several sentences.
                "description": []
            },
            ...
        ]

        # For `kg`.
        "value": {
            # `directed` or `undirected`.
            "direction": str,

            # Graph.
            "graph": [
                {
                    # Source node.
                    "source": str,

                    # Target node.
                    "target": str,

                    # Relation.
                    "relation": str
                },
                ...
            ]
        }

        # For `schema`.
        "value": {
            ...
        }

        # For `dialogue`.
        "value": {
            "dialog": [],
            "relations": []
        }
        
        # For `wiki`.
        "value": {
            ...
        }
        
        # For `sql`.
        "value": [
            {
                "turn": int, 
                "sql": str,
                "result": ...
            }, ...
        ],
        
        # For dialogues based on specific article excerpts, this field indicates the article and section titles.
        "value": {
            "article title": str,
            "section title": str
        },
    }
}

```
* Linearize: ```bash scripts/convert_to_seq.sh```

The processed data is located at ```DialogZoo.tar```.

## Data statistics
|ID|  MRC| ER| MCQA| QCR| RRR| CI| SF|DCRG|CC |ABSA |T2S |DST |DT |DS |SP  |NLI|Total|
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
 |34,963 | 368,490 | 135,356 | 196,620 | 33,192 | 5,037 | 36,385 | 104,100 | 390,463 | 262,876 | 17,328 | 30,220 | 298,358 | 60,563 | 27,192 | 31,279 | 169,654 | 2,202,076|