DoctranQATransformer#
- class langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer(openai_api_key: str | None = None, openai_api_model: str | None = None)[source]#
Extract QA from text documents using doctran.
- Parameters:
openai_api_key (str | None) β OpenAI API key. Can also be specified via environment variable
OPENAI_API_KEY
.openai_api_model (str | None) β
Example
from langchain_community.document_transformers import DoctranQATransformer # Pass in openai_api_key or set env var OPENAI_API_KEY qa_transformer = DoctranQATransformer() transformed_document = await qa_transformer.atransform_documents(documents)
Methods
__init__
([openai_api_key,Β openai_api_model])atransform_documents
(documents,Β **kwargs)Asynchronously transform a list of documents.
transform_documents
(documents,Β **kwargs)Extracts QA from text documents using doctran.
- __init__(openai_api_key: str | None = None, openai_api_model: str | None = None) None [source]#
- Parameters:
openai_api_key (str | None) β
openai_api_model (str | None) β
- Return type:
None
Examples using DoctranQATransformer