mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-06 14:40:34 +03:00
Update morphologizer
This commit is contained in:
parent
af1b5f129b
commit
82810b9846
|
@ -51,9 +51,9 @@ class Morphologizer(Tagger):
|
|||
def begin_training(self, get_examples=lambda: [], pipeline=None, sgd=None,
|
||||
**kwargs):
|
||||
for example in get_examples():
|
||||
for i, morph in enumerate(example.token_annotation.morphs):
|
||||
pos = example.token_annotation.get_pos(i)
|
||||
morph = Morphology.feats_to_dict(morph)
|
||||
for i, token in enumerate(example.reference):
|
||||
pos = token.pos_
|
||||
morph = token.morph
|
||||
norm_morph = self.vocab.strings[self.vocab.morphology.add(morph)]
|
||||
if pos:
|
||||
morph["POS"] = pos
|
||||
|
|
Loading…
Reference in New Issue
Block a user