mirror of https://github.com/explosion/spaCy.git
Don't expect parser model
This commit is contained in:
parent
ee6fa106da
commit
e07b9665f7
|
@ -80,8 +80,9 @@ cdef class ParserModel(AveragedPerceptron):
|
||||||
cdef class Parser:
|
cdef class Parser:
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, path, Vocab vocab, moves_class):
|
def load(cls, path, Vocab vocab, moves_class):
|
||||||
with (path / 'config.json').open() as file_:
|
if (path / 'config.json').exists():
|
||||||
cfg = json.load(file_)
|
with (path / 'config.json').open() as file_:
|
||||||
|
cfg = json.load(file_)
|
||||||
moves = moves_class(vocab.strings, cfg['labels'])
|
moves = moves_class(vocab.strings, cfg['labels'])
|
||||||
templates = get_templates(cfg['features'])
|
templates = get_templates(cfg['features'])
|
||||||
model = ParserModel(templates)
|
model = ParserModel(templates)
|
||||||
|
|
Loading…
Reference in New Issue