Fix loading of tagger.

This commit is contained in:
Matthew Honnibal 2016-10-18 19:33:04 +02:00
parent 76c815f40d
commit 45a6f9b9c7

View File

@ -70,10 +70,10 @@ class BaseDefaults(object):
def create_tagger(cls, nlp=None):
if nlp is None:
return Tagger(cls.create_vocab(), features=cls.tagger_features)
elif nlp.path is None or not (nlp.path / 'ner').exists():
elif nlp.path is None or not (nlp.path / 'pos').exists():
return Tagger(nlp.vocab, features=cls.tagger_features)
else:
return Tagger.load(nlp.path / 'ner', nlp.vocab)
return Tagger.load(nlp.path / 'pos', nlp.vocab)
@classmethod
def create_parser(cls, nlp=None):