mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 12:20:20 +03:00
ner: re-enable sentence boundary checks
This commit is contained in:
parent
11ae4cc3d3
commit
5fd369b9e9
|
@ -387,9 +387,9 @@ cdef class Begin:
|
|||
elif st.B_(1).ent_iob == 3:
|
||||
# If the next word is B, we can't B now
|
||||
return False
|
||||
#elif st.B_(1).sent_start == 1:
|
||||
# # Don't allow entities to extend across sentence boundaries
|
||||
# return False
|
||||
elif st.B_(1).sent_start == 1:
|
||||
# Don't allow entities to extend across sentence boundaries
|
||||
return False
|
||||
# Don't allow entities to start on whitespace
|
||||
elif Lexeme.get_struct_attr(st.B_(0).lex, IS_SPACE):
|
||||
return False
|
||||
|
@ -467,9 +467,9 @@ cdef class In:
|
|||
# Otherwise, force acceptance, even if we're across a sentence
|
||||
# boundary or the token is whitespace.
|
||||
return True
|
||||
#elif st.B(1) != -1 and st.B_(1).sent_start == 1:
|
||||
# # Don't allow entities to extend across sentence boundaries
|
||||
# return False
|
||||
elif st.B(1) != -1 and st.B_(1).sent_start == 1:
|
||||
# Don't allow entities to extend across sentence boundaries
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user