Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsCallbacksModulesSecurityGuidesAdaptersDebuggingDeploymentEvaluationFallbacksLangSmithRun LLMs locallyModel comparisonPrivacyData anonymization with Microsoft PresidioReversible anonymizationMulti-language anonymizationQA with private data protectionPydantic compatibilitySafetyMoreGuidesPrivacyData anonymization with Microsoft PresidioQA with private data protectionOn this pageQA with private data protectionQA with private data protectionIn this notebook, we will look at building a basic system for question answering, based on private data. Before feeding the LLM with this data, we need to protect it so that it doesn't go to an external API (e.g. OpenAI, Anthropic). Then, after receiving the model output, we would like the data to be restored to its original form. Below you can observe an example flow of this QA system:In the following notebook, we will not go into the details of how the anonymizer works. If you are interested, please visit this part of the documentation.Quickstart‚ÄãIterative process of upgrading the anonymizer‚Äã# Install necessary packages# !pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker faiss-cpu tiktoken# ! python -m spacy download en_core_web_lgdocument_content = """Date: October 19, 2021 Witness: John Doe Subject: Testimony Regarding the Loss of Wallet Testimony Content: Hello Officer, My name is John Doe and on October 19, 2021, my wallet was stolen in the vicinity of Kilmarnock during a bike trip. This wallet contains some very important things to me. Firstly, the wallet contains my credit card with number 4111 1111 1111 1111, which is registered under my name and linked to my
Open In Colab
Open In Colab ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsCallbacksModulesSecurityGuidesAdaptersDebuggingDeploymentEvaluationFallbacksLangSmithRun LLMs locallyModel comparisonPrivacyData anonymization with Microsoft PresidioReversible anonymizationMulti-language anonymizationQA with private data protectionPydantic compatibilitySafetyMoreGuidesPrivacyData anonymization with Microsoft PresidioQA with private data protectionOn this pageQA with private data protectionQA with private data protectionIn this notebook, we will look at building a basic system for question answering, based on private data. Before feeding the LLM with this data, we need to protect it so that it doesn't go to an external API (e.g. OpenAI, Anthropic). Then, after receiving the model output, we would like the data to be restored to its original form. Below you can observe an example flow of this QA system:In the following notebook, we will not go into the details of how the anonymizer works. If you are interested, please visit this part of the documentation.Quickstart‚ÄãIterative process of upgrading the anonymizer‚Äã# Install necessary packages# !pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker faiss-cpu tiktoken# ! python -m spacy download en_core_web_lgdocument_content = """Date: October 19, 2021 Witness: John Doe Subject: Testimony Regarding the Loss of Wallet Testimony Content: Hello Officer, My name is John Doe and on October 19, 2021, my wallet was stolen in the vicinity of Kilmarnock during a bike trip. This wallet contains some very important things to me. Firstly, the wallet contains my credit card with number 4111 1111 1111 1111, which is registered under my name and linked to my