diff --git a/spacy/pipeline.pxd b/spacy/pipeline.pxd index 84e47af5c..37b83fe47 100644 --- a/spacy/pipeline.pxd +++ b/spacy/pipeline.pxd @@ -1,12 +1,13 @@ from .syntax.parser cimport Parser +from .syntax.beam_parser cimport BeamParser from .syntax.ner cimport BiluoPushDown from .syntax.arc_eager cimport ArcEager from .tagger cimport Tagger -cdef class EntityRecognizer(Parser): +cdef class EntityRecognizer(BeamParser): pass -cdef class DependencyParser(Parser): +cdef class DependencyParser(BeamParser): pass diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index f3e51ade7..46d298d81 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -1,4 +1,5 @@ from .syntax.parser cimport Parser +from .syntax.beam_parser cimport BeamParser from .syntax.ner cimport BiluoPushDown from .syntax.arc_eager cimport ArcEager from .vocab cimport Vocab @@ -10,10 +11,10 @@ from .syntax.parser import get_templates as get_feature_templates from .attrs import DEP, ENT_TYPE -cdef class EntityRecognizer(Parser): +cdef class EntityRecognizer(BeamParser): """Annotate named entities on Doc objects.""" TransitionSystem = BiluoPushDown - + feature_templates = get_feature_templates('ner') def add_label(self, label): @@ -28,7 +29,7 @@ cdef class EntityRecognizer(Parser): self.vocab._serializer = None -cdef class DependencyParser(Parser): +cdef class DependencyParser(BeamParser): TransitionSystem = ArcEager feature_templates = get_feature_templates('basic')