|
# 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| |