From 37e9955acd713e453010703e712afdf03ec98f0d Mon Sep 17 00:00:00 2001 From: zqwerty <zhuq96@hotmail.com> Date: Sun, 14 Mar 2021 17:21:32 +0800 Subject: [PATCH] small fix. slot=none or value=dontcare is OK, solve #177 --- convlab2/dst/rule/multiwoz/dst.py | 2 +- convlab2/dst/rule/multiwoz/dst_util.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/convlab2/dst/rule/multiwoz/dst.py b/convlab2/dst/rule/multiwoz/dst.py index 9575bbb..025c4d7 100755 --- a/convlab2/dst/rule/multiwoz/dst.py +++ b/convlab2/dst/rule/multiwoz/dst.py @@ -56,7 +56,7 @@ class RuleDST(DST): self.state['belief_state'][domain]['book'][k.lower()] = value elif k == 'trainID' and domain == 'train': self.state['belief_state'][domain]['book'][k] = normalize_value(self.value_dict, domain, k, value) - else: + elif k != 'none': # raise Exception('unknown slot name <{}> of domain <{}>'.format(k, domain)) with open('unknown_slot.log', 'a+') as f: f.write('unknown slot name <{}> of domain <{}>\n'.format(k, domain)) diff --git a/convlab2/dst/rule/multiwoz/dst_util.py b/convlab2/dst/rule/multiwoz/dst_util.py index 560d8ca..0378b37 100755 --- a/convlab2/dst/rule/multiwoz/dst_util.py +++ b/convlab2/dst/rule/multiwoz/dst_util.py @@ -77,11 +77,12 @@ def normalize_value(value_set, domain, slot, value): v = special_match(domain, slot, value) if v is not None: return v - _log( - 'Failed: domain {} slot {} value {}, raw value returned.'.format( - domain, - slot, - value)) + if v != 'dontcare': + _log( + 'Failed: domain {} slot {} value {}, raw value returned.'.format( + domain, + slot, + value)) return value -- GitLab