langchain_community.document_transformers.doctran_text_qa
.DoctranQATransformer¶
- class langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer(openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None)[source]¶
使用doctran从文本文档中提取问答。
- 参数
openai_api_key (可选[str]) – OpenAI API密钥。也可以通过环境变量
OPENAI_API_KEY
指定。openai_api_model (可选[str]) –
示例
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)
方法
__init__
([openai_api_key, openai_api_model])atransform_documents
(documents, **kwargs)异步转换文档列表。
transform_documents
(documents, **kwargs)使用doctran从文本文档中提取问答。
- __init__(openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None) None [source]¶
- 参数
openai_api_key (可选[str]) –
openai_api_model (可选[str]) –
- 返回类型
None