small bug fix

This commit is contained in:
svlandeg 2020-06-17 23:33:51 +02:00
parent d6c4dd6eea
commit 40b2b21eef

View File

@ -243,16 +243,17 @@ 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 key in ("token_annotation", "doc_annotation"): if value:
pass if key in ("token_annotation", "doc_annotation"):
elif key == "ids": pass
pass elif key == "ids":
elif key in ("cats", "links") and value: pass
doc_dict[key] = value elif key in ("cats", "links"):
elif key in ("ner", "entities") and value: doc_dict[key] = value
doc_dict["entities"] = value elif key in ("ner", "entities"):
else: doc_dict["entities"] = value
token_dict[key] = value else:
token_dict[key] = value
# Remap keys # Remap keys
remapping = { remapping = {
"words": "ORTH", "words": "ORTH",