mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 20:30:24 +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:
|
elif st.B_(1).ent_iob == 3:
|
||||||
# If the next word is B, we can't B now
|
# If the next word is B, we can't B now
|
||||||
return False
|
return False
|
||||||
#elif st.B_(1).sent_start == 1:
|
elif st.B_(1).sent_start == 1:
|
||||||
# # Don't allow entities to extend across sentence boundaries
|
# Don't allow entities to extend across sentence boundaries
|
||||||
# return False
|
return False
|
||||||
# Don't allow entities to start on whitespace
|
# Don't allow entities to start on whitespace
|
||||||
elif Lexeme.get_struct_attr(st.B_(0).lex, IS_SPACE):
|
elif Lexeme.get_struct_attr(st.B_(0).lex, IS_SPACE):
|
||||||
return False
|
return False
|
||||||
|
@ -467,9 +467,9 @@ cdef class In:
|
||||||
# Otherwise, force acceptance, even if we're across a sentence
|
# Otherwise, force acceptance, even if we're across a sentence
|
||||||
# boundary or the token is whitespace.
|
# boundary or the token is whitespace.
|
||||||
return True
|
return True
|
||||||
#elif st.B(1) != -1 and st.B_(1).sent_start == 1:
|
elif st.B(1) != -1 and st.B_(1).sent_start == 1:
|
||||||
# # Don't allow entities to extend across sentence boundaries
|
# Don't allow entities to extend across sentence boundaries
|
||||||
# return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user