From b32f581acb597de2e260cdf6d76ee6fb049f96c5 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 27 Mar 2015 15:21:06 +0100 Subject: [PATCH] * Fix bug in ArcEager.get_labels --- spacy/syntax/arc_eager.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 18c7ea8a9..78aaec60f 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -45,11 +45,11 @@ cdef class ArcEager(TransitionSystem): move_labels = {SHIFT: {'': True}, REDUCE: {'': True}, RIGHT: {}, LEFT: {}, BREAK: {'ROOT': True}} for raw_text, segmented, (ids, words, tags, heads, labels, iob) in gold_parses: - for i, (head, label) in enumerate(zip(heads, labels)): + for child, head, label in zip(ids, heads, labels): if label != 'ROOT': - if head > i: + if head < child: move_labels[RIGHT][label] = True - elif head < i: + elif head > child: move_labels[LEFT][label] = True return move_labels