mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-11 17:10:36 +03:00
small bug fix
This commit is contained in:
parent
d6c4dd6eea
commit
40b2b21eef
|
@ -243,13 +243,14 @@ def _fix_legacy_dict_data(example_dict):
|
||||||
token_dict = example_dict.get("token_annotation", {})
|
token_dict = example_dict.get("token_annotation", {})
|
||||||
doc_dict = example_dict.get("doc_annotation", {})
|
doc_dict = example_dict.get("doc_annotation", {})
|
||||||
for key, value in example_dict.items():
|
for key, value in example_dict.items():
|
||||||
|
if value:
|
||||||
if key in ("token_annotation", "doc_annotation"):
|
if key in ("token_annotation", "doc_annotation"):
|
||||||
pass
|
pass
|
||||||
elif key == "ids":
|
elif key == "ids":
|
||||||
pass
|
pass
|
||||||
elif key in ("cats", "links") and value:
|
elif key in ("cats", "links"):
|
||||||
doc_dict[key] = value
|
doc_dict[key] = value
|
||||||
elif key in ("ner", "entities") and value:
|
elif key in ("ner", "entities"):
|
||||||
doc_dict["entities"] = value
|
doc_dict["entities"] = value
|
||||||
else:
|
else:
|
||||||
token_dict[key] = value
|
token_dict[key] = value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user