* Check oov_prob file is present

This commit is contained in:
Matthew Honnibal 2015-07-26 16:36:38 +02:00
parent 847c08e411
commit eeaea25f0c
1 changed files with 6 additions and 1 deletions

View File

@ -81,10 +81,15 @@ class English(object):
self.data_dir = data_dir self.data_dir = data_dir
if path.exists(path.join(data_dir, 'vocab', 'oov_prob')):
oov_prob = float(open(path.join(data_dir, 'vocab', 'oov_prob')).read())
else:
oov_prob = None
self.vocab = Vocab(data_dir=path.join(data_dir, 'vocab') if data_dir else None, self.vocab = Vocab(data_dir=path.join(data_dir, 'vocab') if data_dir else None,
get_lex_props=get_lex_props, load_vectors=load_vectors, get_lex_props=get_lex_props, load_vectors=load_vectors,
pos_tags=POS_TAGS, pos_tags=POS_TAGS,
oov_prob=float(open(path.join(data_dir, 'vocab', 'oov_prob')).read())) oov_prob=oov_prob)
if Tagger is True: if Tagger is True:
Tagger = EnPosTagger Tagger = EnPosTagger
if Parser is True: if Parser is True: