diff --git a/convlab/evaluator/multiwoz_eval.py b/convlab/evaluator/multiwoz_eval.py index 62770bb44b83155917420dddbf7dc53a9221d1b0..75c4f2195f0541aa378404d34b09b3050b5a60b0 100755 --- a/convlab/evaluator/multiwoz_eval.py +++ b/convlab/evaluator/multiwoz_eval.py @@ -162,7 +162,7 @@ class MultiWozEvaluator(Evaluator): new_acts = list() for intent, domain, slot, value in da_turn: - if intent.lower() == 'book': + if intent.lower() == 'book' and not value: ref = [_value for _intent, _domain, _slot, _value in da_turn if _domain == domain and _intent.lower() == 'inform' and _slot.lower() == 'ref'] ref = ref[0] if ref else '' value = ref diff --git a/convlab/util/multiwoz/lexicalize.py b/convlab/util/multiwoz/lexicalize.py index 1e5f7ce69eb046e391d752533d024cf9b766ff66..8fd794a3aa6fd7fe641c94fec6d7ea3ee6e99c60 100755 --- a/convlab/util/multiwoz/lexicalize.py +++ b/convlab/util/multiwoz/lexicalize.py @@ -87,7 +87,7 @@ def lexicalize_da(meta, entities, state, requestable): pair[1] = entities[domain][n][slot.capitalize()] elif slot_old in entities[domain][n]: pair[1] = entities[domain][n][slot_old] - elif slot in state[domain]: + elif state.get(domain) is not None and slot in state.get(domain): pair[1] = state[domain][slot] else: pair[1] = 'not available'