This commit is contained in:
ly119399
2022-06-12 23:31:45 +08:00
parent 55f8bb9769
commit c400684327
3 changed files with 10 additions and 7 deletions

View File

@@ -202,7 +202,7 @@ class MultiWozDB(object):
':'
) # raise error if time value is not xx:xx format
v = int(h) * 60 + int(m)
except:
except Exception:
match = False
break
time = int(db_ent[s].split(':')[0]) * 60 + int(
@@ -243,7 +243,12 @@ class MultiWozDB(object):
flag = True
for key, val in constraints.items():
if val == '' or val == 'dontcare' or val == 'not mentioned' or val == "don't care" or val == 'dont care' or val == "do n't care":
if val == '' \
or val == 'dontcare' \
or val == 'not mentioned' \
or val == "don't care" \
or val == 'dont care' \
or val == "do n't care":
pass
else:
if flag:
@@ -270,7 +275,7 @@ class MultiWozDB(object):
try: # "select * from attraction where name = 'queens college'"
print(sql_query)
return self.sql_dbs[domain].execute(sql_query).fetchall()
except:
except Exception:
return [] # TODO test it

View File

@@ -2,11 +2,10 @@
import unittest
from tests.case.nlp.dialog_generation_case import test_case
from maas_lib.preprocessors import DialogGenerationPreprocessor
from maas_lib.utils.constant import Fields, InputFields
from maas_lib.utils.logger import get_logger
from tests.case.nlp.dialog_generation_case import test_case
logger = get_logger()

View File

@@ -2,11 +2,10 @@
import unittest
from tests.case.nlp.dialog_intent_case import test_case
from maas_lib.preprocessors import DialogIntentPreprocessor
from maas_lib.utils.constant import Fields, InputFields
from maas_lib.utils.logger import get_logger
from tests.case.nlp.dialog_intent_case import test_case
logger = get_logger()