mirror of https://github.com/explosion/spaCy.git
* Fix assignment of root label to words left as root implicitly, after parsing ends.
This commit is contained in:
parent
7c2d2deaa7
commit
77609588b6
|
@ -378,7 +378,10 @@ cdef class ArcEager(TransitionSystem):
|
||||||
st.fast_forward()
|
st.fast_forward()
|
||||||
|
|
||||||
cdef int finalize_state(self, StateC* st) nogil:
|
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 int set_valid(self, int* output, const StateC* st) nogil:
|
||||||
cdef bint[N_MOVES] is_valid
|
cdef bint[N_MOVES] is_valid
|
||||||
|
|
Loading…
Reference in New Issue