From f795fcf4f276ce313c86f9a989d99f77129f3e55 Mon Sep 17 00:00:00 2001
From: function2 <function2@qq.com>
Date: Tue, 6 Oct 2020 11:35:36 +0800
Subject: [PATCH] fix white character issue #144

---
 convlab2/dst/dstc9/utils.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/convlab2/dst/dstc9/utils.py b/convlab2/dst/dstc9/utils.py
index 2938f36..b685623 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,
-- 
GitLab