mirror of https://github.com/explosion/spaCy.git
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.
This commit is contained in:
parent
8eafe80450
commit
47a3ef06a6
|
@ -144,6 +144,7 @@ class BaseDefaults(object):
|
||||||
pipeline.append(nlp.tagger)
|
pipeline.append(nlp.tagger)
|
||||||
if nlp.parser:
|
if nlp.parser:
|
||||||
pipeline.append(nlp.parser)
|
pipeline.append(nlp.parser)
|
||||||
|
pipeline.append(Pseudoprojectivity.deprojectivize)
|
||||||
if nlp.entity:
|
if nlp.entity:
|
||||||
pipeline.append(nlp.entity)
|
pipeline.append(nlp.entity)
|
||||||
return pipeline
|
return pipeline
|
||||||
|
|
|
@ -427,8 +427,6 @@ cdef class ArcEager(TransitionSystem):
|
||||||
|
|
||||||
def finalize_doc(self, doc):
|
def finalize_doc(self, doc):
|
||||||
doc.is_parsed = True
|
doc.is_parsed = True
|
||||||
if doc.vocab.lang == 'de':
|
|
||||||
PseudoProjectivity.deprojectivize(doc)
|
|
||||||
|
|
||||||
cdef int set_valid(self, int* output, const StateC* st) nogil:
|
cdef int set_valid(self, int* output, const StateC* st) nogil:
|
||||||
cdef bint[N_MOVES] is_valid
|
cdef bint[N_MOVES] is_valid
|
||||||
|
|
Loading…
Reference in New Issue