mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-25 11:23:40 +03:00
Merge pull request #1364 from Destygo/master
Fixed NER model loading bug
This commit is contained in:
commit
eb72eae258
|
@ -147,6 +147,9 @@ cdef class Parser:
|
||||||
# TODO: remove this shim when we don't have to support older data
|
# TODO: remove this shim when we don't have to support older data
|
||||||
if 'labels' in cfg and 'actions' not in cfg:
|
if 'labels' in cfg and 'actions' not in cfg:
|
||||||
cfg['actions'] = cfg.pop('labels')
|
cfg['actions'] = cfg.pop('labels')
|
||||||
|
# Convert string keys to int
|
||||||
|
if cfg.get('actions'):
|
||||||
|
cfg['actions'] = {int(action_name): labels for action_name, labels in cfg['actions'].items()}
|
||||||
# TODO: remove this shim when we don't have to support older data
|
# TODO: remove this shim when we don't have to support older data
|
||||||
for action_name, labels in dict(cfg.get('actions', {})).items():
|
for action_name, labels in dict(cfg.get('actions', {})).items():
|
||||||
# We need this to be sorted
|
# We need this to be sorted
|
||||||
|
|
Loading…
Reference in New Issue
Block a user