2014-11-04 16:37:59 +03:00
|
|
|
from cymem.cymem cimport Pool
|
|
|
|
|
|
|
|
from thinc.learner cimport LinearModel
|
|
|
|
from thinc.features cimport Extractor
|
|
|
|
from thinc.typedefs cimport atom_t, feat_t, weight_t, class_t
|
|
|
|
|
2014-11-05 12:45:29 +03:00
|
|
|
from .typedefs cimport hash_t
|
|
|
|
from .context cimport Slots
|
2014-11-04 16:37:59 +03:00
|
|
|
from .tokens cimport Tokens
|
|
|
|
|
|
|
|
|
2014-11-04 19:42:14 +03:00
|
|
|
cpdef enum TagType:
|
2014-11-04 16:37:59 +03:00
|
|
|
POS
|
|
|
|
ENTITY
|
|
|
|
SENSE
|
|
|
|
|
|
|
|
|
|
|
|
cdef class Tagger:
|
|
|
|
cpdef int set_tags(self, Tokens tokens) except -1
|
|
|
|
cpdef class_t predict(self, int i, Tokens tokens) except 0
|
2014-11-09 07:18:33 +03:00
|
|
|
cpdef int tell_answer(self, list gold) except -1
|
2014-11-04 16:37:59 +03:00
|
|
|
|
|
|
|
cpdef readonly Pool mem
|
|
|
|
cpdef readonly Extractor extractor
|
|
|
|
cpdef readonly LinearModel model
|
|
|
|
|
|
|
|
cpdef readonly TagType tag_type
|
|
|
|
cpdef readonly list tag_names
|
|
|
|
|
|
|
|
cdef class_t _guess
|
2014-11-05 12:45:29 +03:00
|
|
|
cdef atom_t* _context_flat
|
|
|
|
cdef Slots _context_slots
|
2014-11-04 16:37:59 +03:00
|
|
|
cdef feat_t* _feats
|
|
|
|
cdef weight_t* _values
|
|
|
|
cdef weight_t* _scores
|