Add operators to the anonymizer
Parameters
operators – Operators to add to the anonymizer.
add_recognizer(recognizer: EntityRecognizer) → None¶
Add a recognizer to the analyzer
Parameters
recognizer – Recognizer to add to the analyzer.
anonymize(text: str, language: Optional[str] = None, allow_list: Optional[List[str]] = None) → str¶
Anonymize text
deanonymize(text_to_deanonymize: str, deanonymizer_matching_strategy: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Dict[str, str]]], str] = <function exact_matching_strategy>) → str¶
Deanonymize text
load_deanonymizer_mapping(file_path: Union[Path, str]) → None[source]¶
Load the deanonymizer mapping from a JSON or YAML file.
Parameters
file_path – Path to file to load the mapping from.
Example:
.. code-block:: python
anonymizer.load_deanonymizer_mapping(file_path=”path/mapping.json”)
reset_deanonymizer_mapping() → None[source]¶
Reset the deanonymizer mapping
save_deanonymizer_mapping(file_path: Union[Path, str]) → None[source]¶
Save the deanonymizer mapping to a JSON or YAML file.
Parameters
file_path – Path to file to save the mapping to.
Example:
.. code-block:: python
anonymizer.save_deanonymizer_mapping(file_path=”path/mapping.json”)