From 24f3c2dae0a7b15ef883df410c5980a098d27242 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=BD=97=E5=B4=9A=E9=AA=81?= <function2@qq.com>
Date: Tue, 6 Oct 2020 19:25:28 +0800
Subject: [PATCH] deal with white charater in XLDST evaluation (#145)

* update sumbt translation train result with evaluation mode set

* update extract values

* automatically download sumbt model

* dstc9 eval

* dstc9 xldst evaluation

* modify example

* add .gitignore

* remove precision, recall, f1

* release 250 test data

* revise evaluation

* fix file submission example

* update precision, recall, f1 calculation

* minor change

* fix a database typo

* use selectedResults for missing name

* add value unification

* 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