qfa.adapters.presidio_anonymizer#
Presidio-based anonymisation adapter.
Implements AnonymizationPort by delegating to Microsoft Presidio’s
analyzer and anonymizer engines. Owns the heavy spaCy-backed pipelines
so the application service layer never imports Presidio directly.
Functions
|
Detect the language of |
Classes
|
- qfa.adapters.presidio_anonymizer.detect_language(text: str) str[source]#
Detect the language of
textand return a Presidio-compatible language code.If the detected language isn’t in our pre-defined list of SpaCy models, return “xx”.
- class qfa.adapters.presidio_anonymizer.PresidioAnonymizer[source]#
Bases:
AnonymizationPortAnonymizationPortimplementation backed by Presidio.Replaces detected entities with stable placeholders of the form
<ENTITY_TYPE_N>(e.g.<PERSON_0>,<LOCATION_1>) so the same value gets the same placeholder within a singleanonymizecall.DATE_TIMEentities are preserved verbatim — they carry relevant context for analysis without identifying individuals.