mirror of https://github.com/explosion/spaCy.git
Add merge_subtokens as parser post-process. Re #3830
This commit is contained in:
parent
3aceeeaaeb
commit
a931d72459
|
@ -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":
|
||||||
|
|
Loading…
Reference in New Issue