mirror of https://github.com/explosion/spaCy.git
* Check for directory presence before loading annotators
This commit is contained in:
parent
da4821fc14
commit
5b41744270
|
@ -95,15 +95,15 @@ class English(object):
|
||||||
|
|
||||||
self.tokenizer = Tokenizer(self.vocab, path.join(data_dir, 'tokenizer'))
|
self.tokenizer = Tokenizer(self.vocab, path.join(data_dir, 'tokenizer'))
|
||||||
|
|
||||||
if Tagger:
|
if Tagger and path.exists(path.join(data_dir, 'pos')):
|
||||||
self.tagger = Tagger(self.vocab.strings, data_dir)
|
self.tagger = Tagger(self.vocab.strings, data_dir)
|
||||||
else:
|
else:
|
||||||
self.tagger = None
|
self.tagger = None
|
||||||
if Parser:
|
if Parser and path.exists(path.join(data_dir, 'deps')):
|
||||||
self.parser = Parser(self.vocab.strings, path.join(data_dir, 'deps'))
|
self.parser = Parser(self.vocab.strings, path.join(data_dir, 'deps'))
|
||||||
else:
|
else:
|
||||||
self.parser = None
|
self.parser = None
|
||||||
if Entity:
|
if Entity and path.exists(path.join(data_dir, 'ner')):
|
||||||
self.entity = Entity(self.vocab.strings, path.join(data_dir, 'ner'))
|
self.entity = Entity(self.vocab.strings, path.join(data_dir, 'ner'))
|
||||||
else:
|
else:
|
||||||
self.entity = None
|
self.entity = None
|
||||||
|
|
Loading…
Reference in New Issue