original data and then substitutes it.Between anonymization and deanonymization user can perform different operations, for example, passing the output to LLM.Quickstart‚Äã# Install necessary packages# ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker# ! python -m spacy download en_core_web_lgPresidioReversibleAnonymizer is not significantly different from its predecessor (PresidioAnonymizer) in terms of anonymization:from langchain_experimental.data_anonymizer import PresidioReversibleAnonymizeranonymizer = PresidioReversibleAnonymizer(    analyzed_fields=["PERSON", "PHONE_NUMBER", "EMAIL_ADDRESS", "CREDIT_CARD"],    # Faker seed is used here to make sure the same fake data is generated for the test purposes    # In production, it is recommended to remove the faker_seed parameter (it will default to None)    faker_seed=42,)anonymizer.anonymize(    "My name is Slim Shady, call me at 313-666-7440 or email me at real.slim.shady@gmail.com. "    "By the way, my card number is: 4916 0387 9536 0861")    'My name is Maria Lynch, call me at 7344131647 or email me at jamesmichael@example.com. By the way, my card number is: 4838637940262'This is what the full string we want to deanonymize looks like:# We know this data, as we set the faker_seed parameterfake_name = "Maria Lynch"fake_phone = "7344131647"fake_email = "jamesmichael@example.com"fake_credit_card = "4838637940262"anonymized_text = f"""{fake_name} recently lost his wallet. Inside is some cash and his credit card with the number {fake_credit_card}. If you would find it, please call at {fake_phone} or write an email here: {fake_email}.{fake_name} would be very grateful!"""print(anonymized_text)    Maria Lynch recently lost his wallet.     Inside is some cash and his credit card with the number 4838637940262.     If you would find it, please call at 7344131647 or write an email here: jamesmichael@example.com.    Maria Lynch would be very grateful!And now, using the
Open In Colab
Open In Colab ->: original data and then substitutes it.Between anonymization and deanonymization user can perform different operations, for example, passing the output to LLM.Quickstart‚Äã# Install necessary packages# ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker# ! python -m spacy download en_core_web_lgPresidioReversibleAnonymizer is not significantly different from its predecessor (PresidioAnonymizer) in terms of anonymization:from langchain_experimental.data_anonymizer import PresidioReversibleAnonymizeranonymizer = PresidioReversibleAnonymizer(    analyzed_fields=["PERSON", "PHONE_NUMBER", "EMAIL_ADDRESS", "CREDIT_CARD"],    # Faker seed is used here to make sure the same fake data is generated for the test purposes    # In production, it is recommended to remove the faker_seed parameter (it will default to None)    faker_seed=42,)anonymizer.anonymize(    "My name is Slim Shady, call me at 313-666-7440 or email me at real.slim.shady@gmail.com. "    "By the way, my card number is: 4916 0387 9536 0861")    'My name is Maria Lynch, call me at 7344131647 or email me at jamesmichael@example.com. By the way, my card number is: 4838637940262'This is what the full string we want to deanonymize looks like:# We know this data, as we set the faker_seed parameterfake_name = "Maria Lynch"fake_phone = "7344131647"fake_email = "jamesmichael@example.com"fake_credit_card = "4838637940262"anonymized_text = f"""{fake_name} recently lost his wallet. Inside is some cash and his credit card with the number {fake_credit_card}. If you would find it, please call at {fake_phone} or write an email here: {fake_email}.{fake_name} would be very grateful!"""print(anonymized_text)    Maria Lynch recently lost his wallet.     Inside is some cash and his credit card with the number 4838637940262.     If you would find it, please call at 7344131647 or write an email here: jamesmichael@example.com.    Maria Lynch would be very grateful!And now, using the