From 47a3ef06a69607c747ae4b7d0f34ec37635c6317 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 31 Mar 2017 12:30:14 +0200 Subject: [PATCH] Unhack deprojetivization, moving it into pipeline Previously the deprojectivize() call was attached to the transition system, and only called for German. Instead it should be a separate process, called after the parser. This makes it available for any language. Closes #898. --- spacy/language.py | 1 + spacy/syntax/arc_eager.pyx | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index a90e580ca..920a4c4c8 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -144,6 +144,7 @@ class BaseDefaults(object): pipeline.append(nlp.tagger) if nlp.parser: pipeline.append(nlp.parser) + pipeline.append(Pseudoprojectivity.deprojectivize) if nlp.entity: pipeline.append(nlp.entity) return pipeline diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index bea0c9b45..93bc21e22 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -427,8 +427,6 @@ cdef class ArcEager(TransitionSystem): def finalize_doc(self, doc): doc.is_parsed = True - if doc.vocab.lang == 'de': - PseudoProjectivity.deprojectivize(doc) cdef int set_valid(self, int* output, const StateC* st) nogil: cdef bint[N_MOVES] is_valid