From 840a9853a2d8624b65629c5589bf84f34f9eff4c Mon Sep 17 00:00:00 2001 From: pwalkow <pawel.walkowiak@hotmail.com> Date: Thu, 23 Nov 2023 10:10:00 +0100 Subject: [PATCH] Update logging --- src/dictionaries/morphosyntactic/ner_file.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dictionaries/morphosyntactic/ner_file.py b/src/dictionaries/morphosyntactic/ner_file.py index 809738f..19b0aae 100644 --- a/src/dictionaries/morphosyntactic/ner_file.py +++ b/src/dictionaries/morphosyntactic/ner_file.py @@ -7,6 +7,10 @@ from typing import List, Optional, Type, Dict from src.detections import DETECTION_CLASSES_MAP, Detection, MorphosyntacticInfoMixin from src.dictionaries.morphosyntactic.interface import MorphosyntacticDictionary +import logging + +_log = logging.getLogger(__name__) + class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary): """Morphosyntactic dictionary that uses a tsv file with NER tags as a source. @@ -113,9 +117,10 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary): ) word = lemma except IndexError as exp: - print(f"IndexError entry_type {entry_type} morpho_tag {morpho_tag}") - print(exp) - print(f"Dictionary {self._dictionary[entry_type][morpho_tag]}") + _log.info(f"IndexError entry_type " + f"{entry_type} morpho_tag {morpho_tag}") + _log.info(exp) + _log.info(f"Dictionary {self._dictionary[entry_type][morpho_tag]}") if word is None and self._always_replace: entry_type = random.choice(list(self._dictionary.keys())) -- GitLab