2016-01-30 16:31:12 +03:00
|
|
|
from thinc.linear.avgtron cimport AveragedPerceptron
|
2016-05-26 20:06:10 +03:00
|
|
|
from thinc.neural.nn cimport NeuralNet
|
2016-07-20 17:28:02 +03:00
|
|
|
from thinc.linear.features cimport ConjunctionExtracter
|
2016-05-26 20:06:10 +03:00
|
|
|
from thinc.base cimport Model
|
2016-01-30 16:31:12 +03:00
|
|
|
from thinc.extra.eg cimport Example
|
2016-07-20 17:28:02 +03:00
|
|
|
from thinc.typedefs cimport weight_t
|
|
|
|
from thinc.structs cimport FeatureC
|
2015-06-02 01:28:02 +03:00
|
|
|
|
2015-11-06 19:24:30 +03:00
|
|
|
from .stateclass cimport StateClass
|
2014-12-16 00:06:04 +03:00
|
|
|
from .arc_eager cimport TransitionSystem
|
2015-07-13 21:20:58 +03:00
|
|
|
from ..tokens.doc cimport Doc
|
|
|
|
from ..structs cimport TokenC
|
2016-07-20 17:28:02 +03:00
|
|
|
from thinc.structs cimport NeuralNetC, ExampleC
|
2016-02-01 10:34:55 +03:00
|
|
|
from ._state cimport StateC
|
2015-11-06 19:24:30 +03:00
|
|
|
|
|
|
|
|
2016-05-26 20:06:10 +03:00
|
|
|
cdef class ParserNeuralNet(NeuralNet):
|
2016-07-20 17:28:02 +03:00
|
|
|
cdef ConjunctionExtracter extracter
|
|
|
|
cdef void set_featuresC(self, ExampleC* eg, const void* _state) nogil
|
|
|
|
|
2014-12-16 00:06:04 +03:00
|
|
|
|
2016-05-26 20:06:10 +03:00
|
|
|
cdef class ParserPerceptron(AveragedPerceptron):
|
2016-07-20 17:28:02 +03:00
|
|
|
cdef void set_featuresC(self, ExampleC* eg, const void* _state) nogil
|
|
|
|
|
2016-05-26 20:06:10 +03:00
|
|
|
|
2016-07-20 17:28:02 +03:00
|
|
|
cdef class ParserNeuralNetEnsemble(ParserNeuralNet):
|
|
|
|
cdef object _models
|
|
|
|
cdef NeuralNetC** _models_c
|
|
|
|
cdef int** _masks
|
|
|
|
cdef int _nr_model
|
2016-05-26 20:06:10 +03:00
|
|
|
|
2016-07-20 17:28:02 +03:00
|
|
|
|
2015-06-02 01:53:49 +03:00
|
|
|
cdef class Parser:
|
2016-07-20 17:28:02 +03:00
|
|
|
cdef readonly Model model
|
2015-02-23 22:04:53 +03:00
|
|
|
cdef readonly TransitionSystem moves
|
2016-03-01 12:09:08 +03:00
|
|
|
cdef int _projectivize
|
2016-01-30 22:27:07 +03:00
|
|
|
|
2016-05-26 20:06:10 +03:00
|
|
|
cdef int parseC(self, TokenC* tokens, int length, int nr_feat, int nr_class) with gil
|