mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 02:16:32 +03:00
* Fix two bugs in feature calculation
This commit is contained in:
parent
918b820472
commit
763ef01575
|
@ -51,8 +51,8 @@ cdef inline void fill_token(atom_t* context, const TokenC* token) nogil:
|
||||||
# What we're doing here is picking a number where all bits are 1, e.g.
|
# What we're doing here is picking a number where all bits are 1, e.g.
|
||||||
# 15 is 1111, 63 is 111111 and doing bitwise AND, so getting all bits in
|
# 15 is 1111, 63 is 111111 and doing bitwise AND, so getting all bits in
|
||||||
# the source that are set to 1.
|
# the source that are set to 1.
|
||||||
context[4] = token.lex.cluster & 63
|
context[4] = token.lex.cluster & 15
|
||||||
context[5] = token.lex.cluster & 15
|
context[5] = token.lex.cluster & 63
|
||||||
context[6] = token.dep if has_head(token) else 0
|
context[6] = token.dep if has_head(token) else 0
|
||||||
context[7] = token.lex.prefix
|
context[7] = token.lex.prefix
|
||||||
context[8] = token.lex.suffix
|
context[8] = token.lex.suffix
|
||||||
|
@ -102,7 +102,7 @@ cdef int fill_context(atom_t* context, State* state) except -1:
|
||||||
if state.stack_len >= 2:
|
if state.stack_len >= 2:
|
||||||
context[S1_has_head] = has_head(get_s1(state)) + 1
|
context[S1_has_head] = has_head(get_s1(state)) + 1
|
||||||
if state.stack_len >= 3:
|
if state.stack_len >= 3:
|
||||||
context[S2_has_head] = has_head(get_s2(state))
|
context[S2_has_head] = has_head(get_s2(state)) + 1
|
||||||
|
|
||||||
|
|
||||||
ner = (
|
ner = (
|
||||||
|
@ -290,6 +290,7 @@ s0_n1 = (
|
||||||
(S0c6, S0p, N1c6, N1p),
|
(S0c6, S0p, N1c6, N1p),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
n0_n1 = (
|
n0_n1 = (
|
||||||
(N0W, N0p, N1W, N1p),
|
(N0W, N0p, N1W, N1p),
|
||||||
(N0W, N0p, N1p),
|
(N0W, N0p, N1p),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user