From dcce9ca3f374c5d6cc401be9ac521a28b1c4c4a2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 11 Mar 2017 07:00:20 -0600 Subject: [PATCH] Use beam parser --- spacy/pipeline.pxd | 5 +++-- spacy/pipeline.pyx | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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')