2014-12-30 10:20:15 +00:00
|
|
|
from libc.stdint cimport uint8_t
|
|
|
|
|
|
|
|
from cymem.cymem cimport Pool
|
|
|
|
|
|
|
|
from thinc.learner cimport LinearModel
|
2015-05-26 20:17:15 +00:00
|
|
|
from thinc.features cimport Extractor, Feature
|
2014-12-30 10:20:15 +00:00
|
|
|
from thinc.typedefs cimport atom_t, feat_t, weight_t, class_t
|
2015-11-04 16:53:03 +00:00
|
|
|
from thinc.api cimport Example, ExampleC
|
2014-12-30 10:20:15 +00:00
|
|
|
|
|
|
|
from preshed.maps cimport PreshMapArray
|
|
|
|
|
2015-07-18 20:39:57 +00:00
|
|
|
from .typedefs cimport hash_t
|
2014-12-30 10:20:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class Model:
|
2015-06-30 12:26:32 +00:00
|
|
|
cdef readonly int n_classes
|
|
|
|
cdef readonly int n_feats
|
2015-05-26 20:17:15 +00:00
|
|
|
|
2015-06-01 22:27:07 +00:00
|
|
|
cdef const weight_t* score(self, atom_t* context) except NULL
|
2015-07-14 21:47:03 +00:00
|
|
|
cdef int set_scores(self, weight_t* scores, atom_t* context) nogil
|
2014-12-31 08:40:59 +00:00
|
|
|
|
2014-12-30 10:20:15 +00:00
|
|
|
cdef object model_loc
|
2015-10-12 08:33:11 +00:00
|
|
|
cdef object _templates
|
2014-12-30 10:20:15 +00:00
|
|
|
cdef Extractor _extractor
|
2015-11-04 16:53:03 +00:00
|
|
|
cdef Example _eg
|
2014-12-30 10:20:15 +00:00
|
|
|
cdef LinearModel _model
|