mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Load features by string-name for backwards compatibility.
This commit is contained in:
parent
d3d1db800c
commit
d9ae2d68af
|
@ -82,6 +82,9 @@ cdef class Parser:
|
|||
def load(cls, path, Vocab vocab, moves_class):
|
||||
with (path / 'config.json').open() as file_:
|
||||
cfg = json.load(file_)
|
||||
# TODO: Remove this when we no longer need to support old-style models
|
||||
if isinstance(cfg.get('features'), basestring):
|
||||
cfg['features'] = get_templates(cfg['features'])
|
||||
moves = moves_class(vocab.strings, cfg['labels'])
|
||||
model = ParserModel(cfg['features'])
|
||||
if (path / 'model').exists():
|
||||
|
|
Loading…
Reference in New Issue
Block a user