fix: allow more flexibility in choosing models used for PII removal - #135
fix: allow more flexibility in choosing models used for PII removal#135dennyabrain wants to merge 6 commits into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@dennyabrain is this PR ready for review? |
|
@Prajna1999 You can start reviewing now. |
Summary
This PR allows configuring the model used for by recognizer within Presidio. This removed the issue with false positives in hinglish text messages.
We have added 2 new parameters to the config for PII validator - nlp_engine_type and model_name. A sample initialization of pii validator now looks like this -
Since it helps to pre-download the models used by the validator, we are doing so in the Dockerfile. For now I have downloaded both models - one used by nlp_engine_type="spacy" and nlp_engine_type="transformers", we can probably choose one or a few that suits us in production. The changes to Dockerfile are indicative of what sort of changes are needed to support this PR and can use further scrutiny and discussion with the larger team.
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Please add here if any other information is required for the reviewer.