-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure AnalyzerEngine from file #1338
Comments
Hey ! Thanks for this PR. Can I use it to use an other transformer model ? Like this one : https://huggingface.co/Jean-Baptiste/camembert-ner I was thinkings about using a conf file yaml like this :
Can this work ? Without your PR, Thanks. |
Hi @GautierT, are you looking to run this through a REST API? presidio/presidio-analyzer/app.py Line 40 in 5bc4b67
Have this: class Server:
"""HTTP Server for calling Presidio Analyzer."""
def __init__(self):
fileConfig(Path(Path(__file__).parent, LOGGING_CONF_FILE))
self.logger = logging.getLogger("presidio-analyzer")
self.logger.setLevel(os.environ.get("LOG_LEVEL", self.logger.level))
self.app = Flask(__name__)
self.logger.info("Starting analyzer engine")
provider = NlpEngineProvider(conf_file=PATH_TO_CONF)
nlp_engine = provider.create_engine()
self.engine = AnalyzerEngine(nlp_engine=nlp_engine, supported_languages=["fr"])
self.logger.info(WELCOME_MESSAGE) |
Is your feature request related to a problem? Please describe.
In many use-cases, especially around the Docker based option, it is challenging to configure the
AnalyzerEngine
for a specific scenario. For example, in order to have an API supporting multiple languages, it is required to change the code in the app.py:presidio/presidio-analyzer/app.py
Line 40 in 4db5278
Having a way to configure which initial parameters are used (languages, nlp engine, recognizers, default score etc.) will allow a code-free configuration in both Docker based use-cases and for a more configurable Python pipeline.
Describe the solution you'd like
AnalyzerEngine
instanceDescribe alternatives you've considered
An alternative would be documentation of how to change
app.py
, but code would still have to be changed.Additional context
Presidio already has several conf file, e.g.:
The text was updated successfully, but these errors were encountered: