diff --git a/convlab/nlg/template/multiwoz/nlg.py b/convlab/nlg/template/multiwoz/nlg.py index c72c752b850b14bc781b1a436c5369ed9f9233cc..f83a6db4e2ad6f77f9bdc154cfda7bf2db0ff2c5 100755 --- a/convlab/nlg/template/multiwoz/nlg.py +++ b/convlab/nlg/template/multiwoz/nlg.py @@ -11,6 +11,7 @@ from convlab.nlg import NLG from convlab.nlg.template.multiwoz.noise_functions import delete_random_token, random_token_permutation, spelling_noise from convlab.util.multiwoz.multiwoz_slot_trans import REF_SYS_DA from convlab.util import relative_import_module_from_unified_datasets +from convlab.policy.rule.multiwoz.policy_agenda_multiwoz import unified_format, act_dict_to_flat_tuple reverse_da = relative_import_module_from_unified_datasets('multiwoz21', 'preprocess.py', 'reverse_da') @@ -166,9 +167,9 @@ class TemplateNLG(NLG): Returns: generated sentence """ - if isinstance(dialog_acts, dict): - # dialog acts are in the unified format - dialog_acts = reverse_da(dialog_acts) + dialog_acts = unified_format(dialog_acts) + dialog_acts = reverse_da(dialog_acts) + dialog_acts = act_dict_to_flat_tuple(dialog_acts) dialog_acts = self.noisy_dialog_acts( dialog_acts) if self.is_user else dialog_acts dialog_acts = self.sorted_dialog_act(dialog_acts)