Docling
DoclingReader #
Bases: BasePydanticReader
Docling 阅读器。
将 PDF, DOCX 和其他文档格式提取为 LlamaIndex 文档,格式可以是 Markdown 或 JSON 序列化的 Docling 原生格式。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
export_type
|
Literal[markdown, json]
|
要导出的类型。默认为 "markdown"。 |
必需的 |
doc_converter
|
DocumentConverter
|
要使用的 Docling 转换器。默认工厂: |
必需的 |
md_export_kwargs
|
Dict[str, Any]
|
Markdown 导出时使用的 Kwargs。默认为 |
必需的 |
id_func
|
(DocIDGenCallable, 可选): 要使用的文档 ID 生成函数。默认值: |
必需的 |
源代码位于 llama-index-integrations/readers/llama-index-readers-docling/llama_index/readers/docling/base.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
lazy_load_data #
lazy_load_data(file_path: str | Path | Iterable[str] | Iterable[Path], extra_info: dict | None = None, fs: Optional[AbstractFileSystem] = None) -> Iterable[Document]
从给定源延迟加载。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
file_path
|
str | Path | Iterable[str] | Iterable[Path]
|
文档文件源,可以是单个字符串(URL 或本地文件)或 pathlib.Path — 或其可迭代对象 |
必需的 |
extra_info
|
dict | None
|
任何要包含的预先存在的元数据。默认为 None。 |
无
|
返回值
类型 | 描述 |
---|---|
Iterable[Document]
|
Iterable[LIDocument]: 创建的 LlamaIndex 文档的可迭代对象。 |
源代码位于 llama-index-integrations/readers/llama-index-readers-docling/llama_index/readers/docling/base.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|