mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
Add __reduce__ methods on parser subclasses. Fixes pickling.
This commit is contained in:
parent
7cc9c3e9a6
commit
34bbad8e0e
|
@ -335,6 +335,9 @@ cdef class NeuralDependencyParser(NeuralParser):
|
||||||
name = 'parser'
|
name = 'parser'
|
||||||
TransitionSystem = ArcEager
|
TransitionSystem = ArcEager
|
||||||
|
|
||||||
|
def __reduce__(self):
|
||||||
|
return (NeuralDependencyParser, (self.vocab, self.moves, self.model), None, None)
|
||||||
|
|
||||||
|
|
||||||
cdef class NeuralEntityRecognizer(NeuralParser):
|
cdef class NeuralEntityRecognizer(NeuralParser):
|
||||||
name = 'entity'
|
name = 'entity'
|
||||||
|
@ -342,6 +345,10 @@ cdef class NeuralEntityRecognizer(NeuralParser):
|
||||||
|
|
||||||
nr_feature = 6
|
nr_feature = 6
|
||||||
|
|
||||||
|
def __reduce__(self):
|
||||||
|
return (NeuralEntityRecognizer, (self.vocab, self.moves, self.model), None, None)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cdef class BeamDependencyParser(BeamParser):
|
cdef class BeamDependencyParser(BeamParser):
|
||||||
TransitionSystem = ArcEager
|
TransitionSystem = ArcEager
|
||||||
|
|
Loading…
Reference in New Issue
Block a user