From 823dda6dc93eb7201b35836701c879ecb9415ec0 Mon Sep 17 00:00:00 2001
From: zqwerty <zhuq96@hotmail.com>
Date: Tue, 30 Nov 2021 03:41:30 +0000
Subject: [PATCH] rename goal:inform&request

---
 data/unified_datasets/README.md |  4 ++--
 data/unified_datasets/check.py  | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/data/unified_datasets/README.md b/data/unified_datasets/README.md
index cad25dd8..ba6d170b 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 7a0568dd..321ede91 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)
-- 
GitLab