ReversibleAnonymizerBase#
- class langchain_experimental.data_anonymizer.base.ReversibleAnonymizerBase[source]#
Base abstract class for reversible anonymizers.
Methods
__init__
()anonymize
(text[,Β language,Β allow_list])Anonymize text.
deanonymize
(text_to_deanonymize[,Β ...])Deanonymize text
Abstract method to reset deanonymizer mapping
- __init__()#
- 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
- deanonymize(text_to_deanonymize: str, deanonymizer_matching_strategy: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Dict[str, str]]], str] = <function exact_matching_strategy>) str [source]#
Deanonymize text
- Parameters:
text_to_deanonymize (str) β
deanonymizer_matching_strategy (Callable[[str, Dict[str, Dict[str, str]]], str]) β
- Return type:
str