Skip to content
Snippets Groups Projects
Commit eeae7d61 authored by Bartlomiej's avatar Bartlomiej
Browse files

Fix check tokens and keys from spans ner

parent 6f2ec546
Branches
No related tags found
1 merge request!11Clarin json support
Pipeline #14319 passed
...@@ -79,7 +79,7 @@ class WiktorNERInputParser(InputParser): ...@@ -79,7 +79,7 @@ class WiktorNERInputParser(InputParser):
annotations = [] annotations = []
# Morphosyntactic annotations # Morphosyntactic annotations
if content.tokens: if content.tokens():
for token in content.tokens(): for token in content.tokens():
if token.lexemes: if token.lexemes:
for lexeme in token.lexemes: for lexeme in token.lexemes:
...@@ -99,7 +99,7 @@ class WiktorNERInputParser(InputParser): ...@@ -99,7 +99,7 @@ class WiktorNERInputParser(InputParser):
) )
) )
# NER annotations # NER annotations
if content.spans: if 'ner' in content.get_span_types():
for entity in content.spans('ner'): for entity in content.spans('ner'):
if entity.type: if entity.type:
annotations.append( annotations.append(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment