mirror of https://github.com/explosion/spaCy.git
Try to fix augmentation
This commit is contained in:
parent
a2aa1f6882
commit
14c4da547f
|
@ -38,6 +38,9 @@ def orth_variants_augmenter(nlp, example, *, level: float = 0.0, lower: float =
|
||||||
orig_dict["token_annotation"],
|
orig_dict["token_annotation"],
|
||||||
lower=raw_text is not None and random.random() < lower,
|
lower=raw_text is not None and random.random() < lower,
|
||||||
)
|
)
|
||||||
|
if variant_text is None:
|
||||||
|
doc = Doc(nlp.vocab, words=variant_token_annot["words"])
|
||||||
|
else:
|
||||||
doc = nlp.make_doc(variant_text)
|
doc = nlp.make_doc(variant_text)
|
||||||
orig_dict["token_annotation"] = variant_token_annot
|
orig_dict["token_annotation"] = variant_token_annot
|
||||||
yield example.from_dict(doc, orig_dict)
|
yield example.from_dict(doc, orig_dict)
|
||||||
|
|
Loading…
Reference in New Issue