mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
* Add label features for NER parsing
This commit is contained in:
parent
cf55b48ba6
commit
41dedfb14e
|
@ -133,6 +133,8 @@ cpdef enum:
|
||||||
N2_pos
|
N2_pos
|
||||||
N2_sense
|
N2_sense
|
||||||
|
|
||||||
|
E_label
|
||||||
|
|
||||||
E0_sic
|
E0_sic
|
||||||
E0_cluster
|
E0_cluster
|
||||||
E0_pos
|
E0_pos
|
||||||
|
|
|
@ -63,6 +63,7 @@ cdef int fill_context(atom_t* context, State* s, Tokens tokens) except -1:
|
||||||
|
|
||||||
cdef atom_t[5] ent_vals
|
cdef atom_t[5] ent_vals
|
||||||
if entity_is_open(s):
|
if entity_is_open(s):
|
||||||
|
context[E_label] = s.curr.label
|
||||||
context[E0_sic] = tokens.lex[s.curr.start].sic
|
context[E0_sic] = tokens.lex[s.curr.start].sic
|
||||||
context[E0_cluster] = tokens.lex[s.curr.start].cluster
|
context[E0_cluster] = tokens.lex[s.curr.start].cluster
|
||||||
context[E0_pos] = tokens.pos[s.curr.start]
|
context[E0_pos] = tokens.pos[s.curr.start]
|
||||||
|
|
|
@ -93,6 +93,14 @@ STATE = (
|
||||||
(E0_sic, E1_pos,),
|
(E0_sic, E1_pos,),
|
||||||
(E0_pos, E1_sic,),
|
(E0_pos, E1_sic,),
|
||||||
(E0_pos, E1_pos),
|
(E0_pos, E1_pos),
|
||||||
|
|
||||||
|
(E_label,),
|
||||||
|
(E_label, W_sic),
|
||||||
|
(E_label, W_pos),
|
||||||
|
(E_label, W_cluster),
|
||||||
|
(E_label, E0_sic, W_sic),
|
||||||
|
(E_label, E0_pos, W_pos),
|
||||||
|
(E_label, E0_cluster, W_pos)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user