* Fix bug in NER transition system, that sometimes left no valid moves

This commit is contained in:
Matthew Honnibal 2015-11-08 16:19:12 +01:00
parent ab5aac5b2f
commit 44fbdc7260

View File

@ -170,6 +170,9 @@ cdef class Begin:
return False
elif preset_ent_iob == 3 and st.B_(0).ent_type != label:
return False
# If the next word is B or O, we can't B now
elif st.B_(1).ent_iob == 2 or st.B_(1).ent_iob == 3:
return False
# Don't allow entities to extend across sentence boundaries
elif st.B_(1).sent_start:
return False