Set tag_map to None if it's not seen in the data by vocab

This commit is contained in:
Matthew Honnibal 2016-12-18 16:51:10 +01:00
parent 33996e770b
commit 6ee1df93c5

View File

@ -83,6 +83,8 @@ cdef class Vocab:
if tag_map is True and (path / 'vocab' / 'tag_map.json').exists():
with (path / 'vocab' / 'tag_map.json').open('r', encoding='utf8') as file_:
tag_map = json.load(file_)
elif tag_map is True:
tag_map = None
if lex_attr_getters is not None \
and oov_prob is True \
and (path / 'vocab' / 'oov_prob').exists():