mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-29 01:48:57 +00:00
parent
b14b65d62a
commit
f64522fbaf
@ -47,3 +47,7 @@ class ReversibleAnonymizerBase(AnonymizerBase):
|
|||||||
deanonymizer_matching_strategy: Callable[[str, MappingDataType], str],
|
deanonymizer_matching_strategy: Callable[[str, MappingDataType], str],
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Abstract method to deanonymize text"""
|
"""Abstract method to deanonymize text"""
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def reset_deanonymizer_mapping(self) -> None:
|
||||||
|
"""Abstract method to reset deanonymizer mapping"""
|
||||||
|
@ -313,6 +313,10 @@ class PresidioReversibleAnonymizer(PresidioAnonymizerBase, ReversibleAnonymizerB
|
|||||||
|
|
||||||
return text_to_deanonymize
|
return text_to_deanonymize
|
||||||
|
|
||||||
|
def reset_deanonymizer_mapping(self) -> None:
|
||||||
|
"""Reset the deanonymizer mapping"""
|
||||||
|
self._deanonymizer_mapping = DeanonymizerMapping()
|
||||||
|
|
||||||
def save_deanonymizer_mapping(self, file_path: Union[Path, str]) -> None:
|
def save_deanonymizer_mapping(self, file_path: Union[Path, str]) -> None:
|
||||||
"""Save the deanonymizer mapping to a JSON or YAML file.
|
"""Save the deanonymizer mapping to a JSON or YAML file.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user