From b4c5c0e1aa0f2e4ba0567a7cd3e6dc2660785aa0 Mon Sep 17 00:00:00 2001 From: zhuqi <zqwerty@users.noreply.github.com> Date: Thu, 24 Sep 2020 19:56:25 +0800 Subject: [PATCH] Maintenance (#129) * add test set example for dstc9 (multiwoz_zh, crosswoz_en) * update new_goal_model.pkl * update crosswoz auto_sys_template_nlg * add postcode as special case for NLU tokenization * fix lower case for int value in nlg.py --- convlab2/nlg/template/multiwoz/nlg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/convlab2/nlg/template/multiwoz/nlg.py b/convlab2/nlg/template/multiwoz/nlg.py index 1329275..9cb0f26 100755 --- a/convlab2/nlg/template/multiwoz/nlg.py +++ b/convlab2/nlg/template/multiwoz/nlg.py @@ -200,7 +200,8 @@ class TemplateNLG(NLG): sentences += sentence else: for slot, value in slot_value_pairs: - value_lower = value.lower() + if isinstance(value, str): + value_lower = value.lower() if value in ["do nt care", "do n't care", "dontcare"]: sentence = 'I don\'t care about the {} of the {}'.format(slot, dialog_act.split('-')[0]) elif self.is_user and dialog_act.split('-')[1] == 'inform' and slot == 'choice' and value_lower == 'any': -- GitLab