diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 7213fbbf7..3f2bc7c65 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -378,7 +378,10 @@ cdef class ArcEager(TransitionSystem): st.fast_forward() cdef int finalize_state(self, StateC* st) nogil: - pass + cdef int i + for i in range(st.length): + if st._sent[i].head == 0 and st._sent[i].dep == 0: + st._sent[i].dep = self.root_label cdef int set_valid(self, int* output, const StateC* st) nogil: cdef bint[N_MOVES] is_valid