diff --git a/data/unified_datasets/README.md b/data/unified_datasets/README.md index cad25dd88b709db837a112831f89dadab3302342..ba6d170bccee649e7563dc622521977c83e67dcb 100644 --- a/data/unified_datasets/README.md +++ b/data/unified_datasets/README.md @@ -78,8 +78,8 @@ We first introduce the unified format of `ontology` and `dialogues`. To transfor - `domains`: (*list*) involved domains in this dialogue. - `goal`: (*dict*) - `description`: (*str*, could be empty) a string describes the user goal. - - `constraints`: (*dict*, could be empty) same format as dialogue state of involved domains but with only filled slots as constraints. - - `requirements`: (*dict*, could be empty) same format as dialogue state of involved domains but with only empty required slots. + - `inform`: (*dict*, could be empty) same format as dialogue state of involved domains but with only filled slots as constraints. + - `request`: (*dict*, could be empty) same format as dialogue state of involved domains but with only empty requested slots. - `turns`: (*list* of *dict*) - `speaker`: (*str*) "user" or "system". - `utterance`: (*str*) diff --git a/data/unified_datasets/check.py b/data/unified_datasets/check.py index 7a0568dd20b24affe83151a1a709e3798ee309dc..321ede9190c37e419eefc71897fb207609797649 100644 --- a/data/unified_datasets/check.py +++ b/data/unified_datasets/check.py @@ -162,16 +162,16 @@ def check_dialogues(name, dialogues, ontology): goal = dialogue['goal'] assert isinstance(goal['description'], str), f'{dialogue_id}\tgoal description {goal["description"]} should be string' - assert isinstance(goal['constraints'], dict), f'{dialogue_id}\tgoal constraints {goal["constraints"]} should be dict' - assert isinstance(goal['requirements'], dict), f'{dialogue_id}\tgoal requirements {goal["requirements"]} should be dict' - for domain_name, domain in goal['constraints'].items(): + assert isinstance(goal['inform'], dict), f'{dialogue_id}\tgoal inform {goal["inform"]} should be dict' + assert isinstance(goal['request'], dict), f'{dialogue_id}\tgoal request {goal["request"]} should be dict' + for domain_name, domain in goal['inform'].items(): for slot_name, value in domain.items(): - check_dsv(domain_name, slot_name, value, prefix=f'{dialogue_id}:goal:constraints') - assert value != "", f'{dialogue_id}\tshould set non-empty value in goal constraints {goal["constraints"]}' - for domain_name, domain in goal['requirements'].items(): + check_dsv(domain_name, slot_name, value, prefix=f'{dialogue_id}:goal:inform') + assert value != "", f'{dialogue_id}\tshould set non-empty value in goal inform {goal["inform"]}' + for domain_name, domain in goal['request'].items(): for slot_name, value in domain.items(): - check_dsv(domain_name, slot_name, value, prefix=f'{dialogue_id}:goal:requirements') - assert value == "", f'{dialogue_id}\tshould set empty value in goal requirements {goal["requirements"]}' + check_dsv(domain_name, slot_name, value, prefix=f'{dialogue_id}:goal:request') + assert value == "", f'{dialogue_id}\tshould set empty value in goal request {goal["request"]}' turns = dialogue['turns'] cur_stat['utterances'] += len(turns)