Skip to content

Commit

Permalink
use logger instead of print in recogniser
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaykarle committed Aug 7, 2024
1 parent 17f7939 commit a5c1094
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/recognizer/flair_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
2. https://huggingface.co/spaces/presidio/presidio_demo/blob/main/flair_recognizer.py
'''
import logging
from typing import Optional, List, Tuple, Set

from presidio_analyzer import (
Expand Down Expand Up @@ -62,10 +63,10 @@ def __init__(
elif model and not model_path:
self.model = model
elif not model and model_path:
print(f"Loading model from {model_path}")
logging.info(f"Loading model from {model_path}")
self.model = SequenceTagger.load(model_path)
else:
print(f"Loading model for language {supported_language}")
logging.info(f"Loading model for language {supported_language}")
self.model = SequenceTagger.load(
self.MODEL_LANGUAGES.get(supported_language)
)
Expand Down

0 comments on commit a5c1094

Please sign in to comment.