langchain_community.document_loaders.dataframe
.DataFrameLoader¶
- class langchain_community.document_loaders.dataframe.DataFrameLoader(data_frame: Any, page_content_column: str = 'text', engine: Literal['pandas', 'modin'] = 'pandas')[source]¶
加载`Pandas`数据框。
使用DataFrame对象进行初始化。
- 参数:
data_frame:Pandas DataFrame对象。 page_content_column:包含页面内容的列的名称。默认为”text”。
Methods
__init__
(data_frame[, page_content_column, ...])使用DataFrame对象进行初始化。
一个用于文档的惰性加载器。
aload
()将数据加载到文档对象中。
从数据框中延迟加载记录。
load
()将数据加载到文档对象中。
load_and_split
([text_splitter])加载文档并分割成块。块作为文档返回。
- Parameters
data_frame (Any) –
page_content_column (str) –
engine (Literal['pandas', 'modin']) –
- __init__(data_frame: Any, page_content_column: str = 'text', engine: Literal['pandas', 'modin'] = 'pandas')[source]¶
使用DataFrame对象进行初始化。
- 参数:
data_frame:Pandas DataFrame对象。 page_content_column:包含页面内容的列的名称。默认为”text”。
- Parameters
data_frame (Any) –
page_content_column (str) –
engine (Literal['pandas', 'modin']) –
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ¶
加载文档并分割成块。块作为文档返回。
不要覆盖此方法。应该被视为已弃用!
- 参数:
- text_splitter: 用于分割文档的TextSplitter实例。
默认为RecursiveCharacterTextSplitter。
- 返回:
文档列表。
- Parameters
text_splitter (Optional[TextSplitter]) –
- Return type
List[Document]