diff --git a/convlab2/dst/dstc9/utils.py b/convlab2/dst/dstc9/utils.py index 2938f36f69e95434c4c51698bb6acd59e82dd61c..b68562317e9b85f532e496ddb7fb087dafcea4ee 100644 --- a/convlab2/dst/dstc9/utils.py +++ b/convlab2/dst/dstc9/utils.py @@ -69,7 +69,7 @@ def unify_value(value, subtask): ret[i] = unify_value(v, subtask) return ret - return { + value = { 'multiwoz': { '未提及': '', 'none': '', @@ -81,6 +81,8 @@ def unify_value(value, subtask): } }[subtask].get(value, value) + return ' '.join(value.strip().split()) + def eval_states(gt, pred, subtask): def exception(description, **kargs): @@ -135,7 +137,6 @@ def eval_states(gt, pred, subtask): return { 'status': 'ok', 'joint accuracy': joint_acc / joint_tot, - # 'slot accuracy': slot_acc / slot_tot, 'slot': { 'accuracy': slot_acc / slot_tot, 'precision': precision,