* Add warning for models not found in parser

This commit is contained in:
Matthew Honnibal 2015-07-08 20:02:13 +02:00
parent ef700401a6
commit 05b28ec9eb
1 changed files with 2 additions and 2 deletions

View File

@ -83,14 +83,14 @@ cdef class Parser:
self.model = Model(self.moves.n_moves, templates, model_dir) self.model = Model(self.moves.n_moves, templates, model_dir)
def __call__(self, Doc tokens): def __call__(self, Doc tokens):
if self.cfg.get('beam_width', 1) < 1: if self.cfg.get('beam_width', 0) < 1:
self._greedy_parse(tokens) self._greedy_parse(tokens)
else: else:
self._beam_parse(tokens) self._beam_parse(tokens)
def train(self, Doc tokens, GoldParse gold): def train(self, Doc tokens, GoldParse gold):
self.moves.preprocess_gold(gold) self.moves.preprocess_gold(gold)
if self.cfg.beam_width < 1: if self.cfg.get('beam_width', 0) < 1:
return self._greedy_train(tokens, gold) return self._greedy_train(tokens, gold)
else: else:
return self._beam_train(tokens, gold) return self._beam_train(tokens, gold)