mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Expect the parser data, if parser.load() is called.
This commit is contained in:
parent
bb4f201ad2
commit
8e7df3c4ca
|
@ -80,9 +80,8 @@ 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):
|
||||||
if (path / 'config.json').exists():
|
with (path / 'config.json').open() as file_:
|
||||||
with (path / 'config.json').open() as file_:
|
cfg = json.load(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
Block a user