From 9f4ad8fdfb70414c284fb5e877139e9517acab00 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 20 Mar 2015 01:15:27 +0100 Subject: [PATCH] * Assign root words the ROOT label via the Break transition. Something is still wrong here... --- spacy/syntax/arc_eager.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 2c1157216..461d4f5f7 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -43,7 +43,7 @@ cdef class ArcEager(TransitionSystem): @classmethod def get_labels(cls, gold_parses): move_labels = {SHIFT: {'': True}, REDUCE: {'': True}, RIGHT: {}, - LEFT: {}, BREAK: {'': True}} + LEFT: {}, BREAK: {'ROOT': True}} for raw_text, segmented, (ids, tags, heads, labels, iob) in gold_parses: for i, (head, label) in enumerate(zip(heads, labels)): if label != 'ROOT': @@ -138,7 +138,7 @@ cdef int _do_break(const Transition* self, State* state) except -1: state.sent[state.i-1].sent_end = True while state.stack_len != 0: if get_s0(state).head == 0: - get_s0(state).dep = 0 + get_s0(state).dep = self.label state.stack -= 1 state.stack_len -= 1 if not at_eol(state):