Add merge_subtokens as parser post-process. Re #3830

This commit is contained in:
Matthew Honnibal 2019-06-07 20:40:41 +02:00
parent 3aceeeaaeb
commit a931d72459
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ from thinc.v2v import Affine, Maxout, Softmax
from thinc.misc import LayerNorm from thinc.misc import LayerNorm
from thinc.neural.util import to_categorical, copy_array from thinc.neural.util import to_categorical, copy_array
from .functions import merge_subtokens
from ..tokens.doc cimport Doc from ..tokens.doc cimport Doc
from ..syntax.nn_parser cimport Parser from ..syntax.nn_parser cimport Parser
from ..syntax.ner cimport BiluoPushDown from ..syntax.ner cimport BiluoPushDown
@ -1000,7 +1001,7 @@ cdef class DependencyParser(Parser):
@property @property
def postprocesses(self): def postprocesses(self):
return [nonproj.deprojectivize] return [nonproj.deprojectivize, merge_subtokens]
def add_multitask_objective(self, target): def add_multitask_objective(self, target):
if target == "cloze": if target == "cloze":