text: Skip to main contentğŸ¦œï¸�ğŸ”— LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKIntegrationsCallbacksChat modelsDocument loadersDocument transformersDoctran Extract PropertiesDoctran Interrogate DocumentsDoctran Translate Documentshtml2textOpenAI Functions Metadata TaggerLLMsMemoryRetrieversText embedding modelsAgent toolkitsToolsVector storesGrouped by providerIntegrationsDocument transformersDoctran Interrogate DocumentsOn this pageDoctran Interrogate DocumentsDocuments used in a vector store knowledge base are typically stored in narrative or conversational format. However, most user queries are in question format. If we convert documents into Q&A format before vectorizing them, we can increase the liklihood of retrieving relevant documents, and decrease the liklihood of retrieving irrelevant documents.We can accomplish this using the Doctran library, which uses OpenAI's function calling feature to "interrogate" documents.See this notebook for benchmarks on vector similarity scores for various queries based on raw documents versus interrogated documents.pip install doctranimport jsonfrom langchain.schema import Documentfrom langchain.document_transformers import DoctranQATransformerfrom dotenv import load_dotenvload_dotenv()    TrueInputâ€‹This is the document we'll interrogatesample_text = """[Generated with ChatGPT]Confidential Document - For Internal Use OnlyDate: July 1, 2023Subject: Updates and Discussions on Various TopicsDear Team,I hope this email finds you well. In this document, I would like to provide you with some important updates and discuss various topics that require our attention. Please treat the information contained herein as highly confidential.Security and Privacy MeasuresAs part of our ongoing commitment to ensure the security and privacy of our customers' data, we have implemented robust measures across all our systems. We would like to commend John Doe (email: john.doe@example.com)