mirror of https://github.com/explosion/spaCy.git
* Add warning for models not found in parser
This commit is contained in:
parent
f6a6c39ce8
commit
6218d8b389
|
@ -76,8 +76,8 @@ cdef class Parser:
|
||||||
elif not os.path.isdir(model_dir):
|
elif not os.path.isdir(model_dir):
|
||||||
self.cfg = Config(labels=[], features=[])
|
self.cfg = Config(labels=[], features=[])
|
||||||
print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory"
|
print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory"
|
||||||
|
else:
|
||||||
self.cfg = Config.read(model_dir, 'config')
|
self.cfg = Config.read(model_dir, 'config')
|
||||||
self.moves = transition_system(strings, self.cfg.labels)
|
self.moves = transition_system(strings, self.cfg.labels)
|
||||||
templates = get_templates(self.cfg.features)
|
templates = get_templates(self.cfg.features)
|
||||||
self.model = Model(self.moves.n_moves, templates, model_dir)
|
self.model = Model(self.moves.n_moves, templates, model_dir)
|
||||||
|
|
Loading…
Reference in New Issue