Skip to content
Snippets Groups Projects
Commit 840a9853 authored by Paweł Walkowiak's avatar Paweł Walkowiak
Browse files

Update logging

parent 23c05436
Branches
Tags
1 merge request!13Fix anonymizer errors
Pipeline #15158 passed with stages
in 1 minute and 38 seconds
...@@ -7,6 +7,10 @@ from typing import List, Optional, Type, Dict ...@@ -7,6 +7,10 @@ from typing import List, Optional, Type, Dict
from src.detections import DETECTION_CLASSES_MAP, Detection, MorphosyntacticInfoMixin from src.detections import DETECTION_CLASSES_MAP, Detection, MorphosyntacticInfoMixin
from src.dictionaries.morphosyntactic.interface import MorphosyntacticDictionary from src.dictionaries.morphosyntactic.interface import MorphosyntacticDictionary
import logging
_log = logging.getLogger(__name__)
class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary): class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
"""Morphosyntactic dictionary that uses a tsv file with NER tags as a source. """Morphosyntactic dictionary that uses a tsv file with NER tags as a source.
...@@ -113,9 +117,10 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary): ...@@ -113,9 +117,10 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
) )
word = lemma word = lemma
except IndexError as exp: except IndexError as exp:
print(f"IndexError entry_type {entry_type} morpho_tag {morpho_tag}") _log.info(f"IndexError entry_type "
print(exp) f"{entry_type} morpho_tag {morpho_tag}")
print(f"Dictionary {self._dictionary[entry_type][morpho_tag]}") _log.info(exp)
_log.info(f"Dictionary {self._dictionary[entry_type][morpho_tag]}")
if word is None and self._always_replace: if word is None and self._always_replace:
entry_type = random.choice(list(self._dictionary.keys())) entry_type = random.choice(list(self._dictionary.keys()))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment