From eeae7d6190c8035e4a6761bbde44de6e3a2261b4 Mon Sep 17 00:00:00 2001 From: Bartlomiej <bartlomiej.piotr.bojanowski@gmail.com> Date: Tue, 24 Oct 2023 08:54:11 +0200 Subject: [PATCH] Fix check tokens and keys from spans ner --- src/input_parsers/wiktor_ner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input_parsers/wiktor_ner.py b/src/input_parsers/wiktor_ner.py index affbba4..8642bfa 100644 --- a/src/input_parsers/wiktor_ner.py +++ b/src/input_parsers/wiktor_ner.py @@ -79,7 +79,7 @@ class WiktorNERInputParser(InputParser): annotations = [] # Morphosyntactic annotations - if content.tokens: + if content.tokens(): for token in content.tokens(): if token.lexemes: for lexeme in token.lexemes: @@ -99,7 +99,7 @@ class WiktorNERInputParser(InputParser): ) ) # NER annotations - if content.spans: + if 'ner' in content.get_span_types(): for entity in content.spans('ner'): if entity.type: annotations.append( -- GitLab