microsoft / presidio

Context aware, pluggable and customizable data protection and de-identification SDK for text and images
https://microsoft.github.io/presidio
MIT License
3.92k stars 580 forks source link

Failed to get recognizers hash #272

Closed gknor closed 4 years ago

gknor commented 4 years ago

Hi, example of Python code from documentation doesn't work: https://github.com/microsoft/presidio/blob/master/docs/deploy.md

from analyzer import AnalyzerEngine

engine = AnalyzerEngine()

text = "My name is David and I live in Miami"

response = engine.analyze(correlation_id=0,
                          text = text,
                          entities=[],
                          language='en',
                          all_fields=True,
                          score_threshold=0.5)

It fails with the following error code:

ERROR:root:Failed to get recognizers hash

In my opinion it is due to NotImplementedError in ApplyGetHash function.

omri374 commented 4 years ago

Hi @gknor, When using presidio-analyzer as a Python package, it does not use the Recognizer Store which stores recognizers added by an API. However this shouldn't raise an error so we're looking into it and will update shortly.

omri374 commented 4 years ago

@gknor could you please verify that the process fails and not just writes an error message? See this line (surrounded in try/except): https://github.com/microsoft/presidio/blob/2d8c7d33df2f9eeccfa639198b00e272630eb0db/presidio-analyzer/analyzer/recognizer_registry/recognizers_store_api.py#L42

gknor commented 4 years ago

Hi @omri374. You are right, it just writes error message. It confused me and I didn't try to check if the variable response is being created. I'm sorry for the confusion. It's my mistake 😳

omri374 commented 4 years ago

@balteravishay worth changing log level if we run presidio-anayzer as a standalone Python package