* Add label features for NER parsing

This commit is contained in:
Matthew Honnibal 2014-11-12 23:55:10 +11:00
parent cf55b48ba6
commit 41dedfb14e
3 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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]

View File

@ -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)
) )