This commit is contained in:
ly119399
2022-06-20 16:49:32 +08:00
parent d0b33eade8
commit 6f8910dbcb

View File

@@ -169,8 +169,8 @@ class MultiWOZVocab(object):
if include_oov:
if self._word2idx.get(word, None) is None:
raise ValueError(
'Unknown word: %s. Vocabulary should include oovs here.' %
word)
'Unknown word: %s. Vocabulary should include oovs here.'
% word)
return self._word2idx[word]
else:
word = '<unk>' if word not in self._word2idx else word