mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-11 08:42:28 +03:00
Fix parser labels in pipeline
This commit is contained in:
parent
01b42c531f
commit
4bb73b1a93
|
@ -28,14 +28,14 @@ cdef class DependencyParser(Parser):
|
||||||
@classmethod
|
@classmethod
|
||||||
def blank(cls, Vocab vocab, **cfg):
|
def blank(cls, Vocab vocab, **cfg):
|
||||||
if 'actions' not in cfg:
|
if 'actions' not in cfg:
|
||||||
cfg['actions'] = {1: {'': True}, 2: {'': True}, 3: {}, 4: {},
|
cfg['actions'] = {0: {'': True}, 1: {'': True}, 2: {}, 3: {},
|
||||||
5: {'ROOT': True}}
|
4: {'ROOT': True}}
|
||||||
for label in cfg.get('left_labels', []):
|
for label in cfg.get('left_labels', []):
|
||||||
cfg['actions'][3][label] = True
|
cfg['actions'][2][label] = True
|
||||||
for label in cfg.get('right_labels', []):
|
for label in cfg.get('right_labels', []):
|
||||||
cfg['actions'][4][label] = True
|
cfg['actions'][3][label] = True
|
||||||
for label in cfg.get('break_labels', []):
|
for label in cfg.get('break_labels', []):
|
||||||
cfg['actions'][5][label] = True
|
cfg['actions'][4][label] = True
|
||||||
return Parser.blank(vocab, ArcEager, **cfg)
|
return Parser.blank(vocab, ArcEager, **cfg)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user