mirror of https://github.com/explosion/spaCy.git
Fixes for morphologizer
This commit is contained in:
parent
afa227e25b
commit
c4df89ab90
|
@ -304,7 +304,7 @@ def get_token_conllu(token, i):
|
|||
replacements = {"one": "1", "two": "2", "three": "3"}
|
||||
for feat in features:
|
||||
if not feat.startswith("begin") and not feat.startswith("end"):
|
||||
key, value = feat.split("_")
|
||||
key, value = feat.split("_", 1)
|
||||
value = replacements.get(value, value)
|
||||
feat_str.append("%s=%s" % (key, value.title()))
|
||||
if not feat_str:
|
||||
|
@ -342,7 +342,7 @@ def load_nlp(corpus, config, vectors=None):
|
|||
|
||||
|
||||
def initialize_pipeline(nlp, docs, golds, config, device):
|
||||
nlp.add_pipe(nlp.create_pipe("tagger", set_morphology=False))
|
||||
nlp.add_pipe(nlp.create_pipe("tagger", config={"set_morphology": False}))
|
||||
nlp.add_pipe(nlp.create_pipe("morphologizer"))
|
||||
nlp.add_pipe(nlp.create_pipe("parser"))
|
||||
assert not nlp.get_pipe("tagger").set_morphology
|
||||
|
|
Loading…
Reference in New Issue