mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-11 09:00: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", {})
|
||||
doc_dict = example_dict.get("doc_annotation", {})
|
||||
for key, value in example_dict.items():
|
||||
if value:
|
||||
if key in ("token_annotation", "doc_annotation"):
|
||||
pass
|
||||
elif key == "ids":
|
||||
pass
|
||||
elif key in ("cats", "links") and value:
|
||||
elif key in ("cats", "links"):
|
||||
doc_dict[key] = value
|
||||
elif key in ("ner", "entities") and value:
|
||||
elif key in ("ner", "entities"):
|
||||
doc_dict["entities"] = value
|
||||
else:
|
||||
token_dict[key] = value
|
||||
|
|
Loading…
Reference in New Issue
Block a user