From acebd010331f63a3d9ac9b0e70620f0765f059b2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 2 May 2018 14:19:22 +0000 Subject: [PATCH] Set cildren from heads in finalize doc --- spacy/syntax/arc_eager.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 0220e4443..2dd269a53 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -20,6 +20,7 @@ from .transition_system cimport move_cost_func_t, label_cost_func_t from ..gold cimport GoldParse, GoldParseC from ..structs cimport TokenC from ..errors import Errors +from ..tokens.doc cimport Doc, set_children_from_heads # Calculate cost as gold/not gold. We don't use scalar value anyway. cdef int BINARY_COSTS = 1 @@ -530,8 +531,9 @@ cdef class ArcEager(TransitionSystem): if st._sent[i].head == 0: st._sent[i].dep = self.root_label - def finalize_doc(self, doc): + def finalize_doc(self, Doc doc): doc.is_parsed = True + set_children_from_heads(doc.c, doc.length) cdef int set_valid(self, int* output, const StateC* st) nogil: cdef bint[N_MOVES] is_valid