PresidioAnonymizerBase#

class langchain_experimental.data_anonymizer.presidio.PresidioAnonymizerBase(analyzed_fields: List[str] | None = None, operators: Dict[str, OperatorConfig] | None = None, languages_config: Dict | None = None, add_default_faker_operators: bool = True, faker_seed: int | None = None)[source]#

Base Anonymizer using Microsoft Presidio.

See more: https://microsoft.github.io/presidio/

Parameters:

Methods

__init__([analyzed_fields,Β operators,Β ...])

param analyzed_fields:

List of fields to detect and then anonymize.

add_operators(operators)

Add operators to the anonymizer

add_recognizer(recognizer)

Add a recognizer to the analyzer

anonymize(text[,Β language,Β allow_list])

Anonymize text.

__init__(analyzed_fields: List[str] | None = None, operators: Dict[str, OperatorConfig] | None = None, languages_config: Dict | None = None, add_default_faker_operators: bool = True, faker_seed: int | None = None)[source]#
Parameters:
add_operators(operators: Dict[str, OperatorConfig]) β†’ None[source]#

Add operators to the anonymizer

Parameters:

operators (Dict[str, OperatorConfig]) – Operators to add to the anonymizer.

Return type:

None

add_recognizer(recognizer: EntityRecognizer) β†’ None[source]#

Add a recognizer to the analyzer

Parameters:

recognizer (EntityRecognizer) – Recognizer to add to the analyzer.

Return type:

None

anonymize(text: str, language: str | None = None, allow_list: List[str] | None = None) β†’ str#

Anonymize text.

Parameters:
  • text (str) –

  • language (str | None) –

  • allow_list (List[str] | None) –

Return type:

str