mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-18 23:59:12 +03:00
1 parent
b14b65d62a
commit
f64522fbaf
2 files changed
+8
No files matched your search
@@ -47,3 +47,7 @@ class ReversibleAnonymizerBase(AnonymizerBase):
|
||||
deanonymizer_matching_strategy: Callable[[str, MappingDataType], str],
|
||||
) -> str:
|
||||
"""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
|
||||
|
||||
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:
|
||||
"""Save the deanonymizer mapping to a JSON or YAML file.
|
||||
|
||||
|
||||
Reference in new issue
Block a user