From a931d72459ab83c4583a995b8b433bd2470087f7 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 7 Jun 2019 20:40:41 +0200 Subject: [PATCH] Add merge_subtokens as parser post-process. Re #3830 --- spacy/pipeline/pipes.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/pipeline/pipes.pyx b/spacy/pipeline/pipes.pyx index 7043c1647..f16a1a21e 100644 --- a/spacy/pipeline/pipes.pyx +++ b/spacy/pipeline/pipes.pyx @@ -13,6 +13,7 @@ from thinc.v2v import Affine, Maxout, Softmax from thinc.misc import LayerNorm from thinc.neural.util import to_categorical, copy_array +from .functions import merge_subtokens from ..tokens.doc cimport Doc from ..syntax.nn_parser cimport Parser from ..syntax.ner cimport BiluoPushDown @@ -1000,7 +1001,7 @@ cdef class DependencyParser(Parser): @property def postprocesses(self): - return [nonproj.deprojectivize] + return [nonproj.deprojectivize, merge_subtokens] def add_multitask_objective(self, target): if target == "cloze":