@jerryjliu0: 我们在 LlamaParse 中构建了版本跟踪功能。您现在可以提取 Word 风格的修订跟踪和审阅者评论作为附加…
摘要
LlamaParse 已添加版本跟踪功能,以提取 Word 风格的修订跟踪和审阅者评论作为结构化元数据,使 AI 代理能够访问文档的完整修订历史记录,从而增强法律和金融等行业中的协作。
查看缓存全文
缓存时间: 2026/08/20 08:56
我们在LlamaParse中构建了修订跟踪功能。现在,除了解析后的Markdown内容外,您还可以提取Word样式的跟踪更改和审阅者评论作为额外的结构化元数据。这使得您可以为下游AI代理提供文档的完整修订历史和变更,而不仅仅是最新状态的静态快照!这对法律、金融或其他行业中任何基于现有文件协作和迭代的知识工作都非常有帮助。请参阅我们的文档:https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#revision-tracking… 注册LlamaParse:https://cloud.llamaindex.ai/?utm_medium=socials&utm_source=twitter&utm_campaign=2026-aug-…
配置解析
来源:https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/
Parse拥有丰富的配置选项。本页是导航图:它展示了解析请求的结构,并记录了您可以设置的每一个选项。有关逐字段的完整参考,请参阅Parse API参考(https://developers.llamaindex.ai/reference/resources/parsing/methods/create)。要控制从解析作业返回的内容,请参阅检索结果(https://developers.llamaindex.ai/llamaparse/parse/guides/retrieving-results/)。
每个Parse请求都是一个JSON对象。只有三个字段是必需的——其余所有字段都是可选的:
{
// --- 必需 ---
"file_id": "", // 或 "source_url" — 二者必选其一
"tier": "agentic", // fast | cost_effective | agentic | agentic_plus
"version": "latest", // 日期版本字符串或 "latest"
// --- 可选 ---
"input_options": { /* 文件类型特定提示 */ },
"processing_options": { /* Parse如何处理文档 */ },
"agentic_options": { /* 配置agentic模型 */ },
"output_options": { /* Parse返回内容的形状 */ },
"crop_box": { /* 页面级裁剪 */ },
"page_ranges": { /* 仅解析特定页面 */ },
"disable_cache": false,
"processing_control": { /* 超时和失败模式 */ },
"webhook_configurations": [ /* 将结果推送到URL */ ],
"user_metadata": { /* 您附加到此作业的键/值标签 */ }
}
最简单的有效请求只需这三个字段——它们下面的所有字段都可以在需要时添加。
注意:
expand不是解析请求体的一部分。它是获取结果端点上的一个查询参数,用于控制返回哪些字段。SDK会为您处理此操作——当您向client.parsing.parse()传递expand=["markdown"]时,SDK会提交作业、轮询直到完成,然后使用正确的expand值检索结果。如果您直接使用REST API,请参阅检索结果(https://developers.llamaindex.ai/llamaparse/parse/guides/retrieving-results/)。
我在哪里配置X?
| 我想要… | 设置此项 |
|---|---|
| 仅解析特定页面 | page_ranges.target_pages (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#page-ranges)(顶级) |
| 从每页剥离页眉/页脚 | crop_box (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#crop-box)(顶级) |
| 强制重新解析(无缓存) | disable_cache: true (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#cache-control)(顶级) |
| 设置最大作业超时 | processing_control.timeouts.base_in_seconds (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#timeouts-and-failure-conditions)(顶级) |
| 将结果推送到webhook | webhook_configurations (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#webhook-configurations)(顶级) |
| 使用您自己的元数据标记作业 | user_metadata (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#user-metadata)(顶级) |
| 设置OCR语言 | processing_options.ocr_parameters.languages (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#ocr-languages) |
| 跳过水印文本 | processing_options.ignore.ignore_diagonal_text (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#skipping-content-patterns) |
| 启用图表解析 | processing_options.specialized_chart_parsing (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#specialized-chart-parsing) |
| 根据复杂性自动路由页面 | processing_options.cost_optimizer.enable (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#cost-optimizer) |
| 为每页解析质量评分 | processing_options.confidence_score_effort (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#confidence-score-high-effort) |
| 使用自定义提示引导 | agentic_options.custom_prompt (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#custom-prompt) |
| 获取HTML表格而非Markdown | output_options.markdown.tables.output_tables_as_markdown: false (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#markdown-output-options) |
| 将表格导出为XLSX | output_options.tables_as_spreadsheet.enable (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#tables-as-spreadsheet) |
| 获取每页截图 | output_options.images_to_save: ["screenshot"] (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#image-assets) |
| 保留空间布局 | output_options.spatial_text (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#spatial-text) |
| 获取单词/行/单元格边界框 | output_options.granular_bboxes (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#granular-bounding-boxs) |
| 提取Word跟踪更改和注释 | output_options.markdown.annotate_revisions (https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#revision-tracking) |
| 控制返回内容 | GET结果端点上的expand查询参数——请参阅检索结果(https://developers.llamaindex.ai/llamaparse/parse/guides/retrieving-results/) |
控制Parse如何读取您的文档——页面范围、裁剪框、文件类型特定控制和缓存行为。仅解析您需要的页面。跳过的每一页都不用付费。
API密钥: page_ranges——顶级。
max_pages(整数)——设置从第1页开始的总解析页数上限。target_pages(字符串)——以逗号分隔的1-based页面和范围,例如"1,3,5-10"。
{
"page_ranges": {
"max_pages": 5
}
}
{
"page_ranges": {
"target_pages": "1,3,7-12"
}
}
从每页剥离重复的页眉、页脚和边距装饰。四个数字(0.0–1.0),每个是从该边缘剥离的比例。
API密钥: crop_box——顶级。
{
"crop_box": {
"top": 0.1,
"bottom": 0.15
}
}
这是一个几何裁剪,不是内容过滤器。如果装饰在不同页面间移动,请改用基于内容的忽略规则(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#skipping-content-patterns)。
Parse默认缓存相同的请求。任何解析选项的更改都会自动破坏缓存。
API密钥: disable_cache——顶级布尔值。
{
"disable_cache": true
}
仅在基准测试、调试或验证版本锁定时禁用。
API密钥: input_options.html。Parse遍历DOM,提取可见内容,并生成干净的Markdown。这些控制会剥离不属于输出的噪声:
make_all_elements_visible——强制隐藏CSS内容可见。当文档部分位于display: none、visibility: hidden或JavaScript驱动的UI状态后时很有用。remove_navigation_elements——剥离菜单、面包屑、侧边栏导航和非内容性装饰。在解析真实网页而非手工构建的HTML文档时最有用。remove_fixed_elements——剥离粘性标题、浮动侧边栏和其他固定位置UI。
{
"input_options": {
"html": {
"make_all_elements_visible": true,
"remove_navigation_elements": true,
"remove_fixed_elements": true
}
}
}
电子表格(XLSX、CSV)
API密钥: input_options.spreadsheet。Parse处理布局不规范矩形表格的电子表格——一个工作表中堆叠多个逻辑表格、带有过时缓存值的公式等。
detect_sub_tables_in_sheets——查找并提取单个工作表中的子表格。如果您的电子表格有三个垂直堆叠的小表格,中间有空行,Parse会将每个检测为单独的表格,而不是合并它们。force_formula_computation_in_sheets——重新计算公式单元格,而不是使用缓存值。当文件已编辑但从未重新计算,或您正在解析带有占位符值的模板时启用。可能会减慢公式密集型工作表的解析速度。
{
"input_options": {
"spreadsheet": {
"detect_sub_tables_in_sheets": true,
"force_formula_computation_in_sheets": true
}
}
}
演示文稿(PPTX、Keynote)
API密钥: input_options.presentation。默认提取讲者备注——请求expand=["metadata"]以在每页幻灯片元数据中检索它们。
out_of_bounds_content——提取定位在可见幻灯片边界之外的内容。演示者有时会在可见区域外放置备注、草稿文本或参考图片。skip_embedded_data——跳过嵌入图表数据的提取。如果只需要幻灯片文本且图表数据提取减慢速度,请设置为true。
{
"input_options": {
"presentation": {
"out_of_bounds_content": true,
"skip_embedded_data": false
}
}
}
图像(相机照片)
API密钥: input_options.image。文档照片——在桌子上拍摄的收据、用手机拍的表单——到达时倾斜、被背景包围且光照不均。Parse可以在解析前清理这些:
camera_photo_correction——检测照片中的文档边界、裁剪它、透视校正,并平整不均匀的光照和阴影,使页面解析就像平面扫描一样。适用于JPEG、PNG、WebP和HEIC/HEIF输入(iPhone相机默认)。检测是保守的:已经看起来像干净扫描或屏幕截图的图像不会被修改,因此可以安全地启用在混合图像批处理上。
{
"input_options": {
"image": {
"camera_photo_correction": true
}
}
}
API密钥: input_options.pdf——请参阅API参考(https://developers.llamaindex.ai/reference/resources/parsing/methods/create)了解可用的PDF特定选项。
**塑造Parse返回的内容。**Parse可以从同一个作业中输出多种格式。
| 我想要… | 使用 |
|---|---|
| 干净的文本用于LLM | Markdown(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#markdown-output-options)(默认) |
| 保留空白的布局 | 空间文本(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#spatial-text) |
| 可下载XLSX的表格 | 表格作为电子表格(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#tables-as-spreadsheet) |
| 嵌入式图像、截图、布局裁剪 | 图像资产(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#image-assets) |
| 用于引用的印刷页码 | 印刷页码(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#printed-page-numbers) |
| 作为结构化数据的跟踪更改和注释 | 修订跟踪(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#revision-tracking) |
| 任何已解析文档的PDF副本 | 导出的PDF(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#exported-pdf) |
| 用于高亮和定位的单词/行/单元格边界框 | 粒度边界框(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#granular-bounding-boxes) |
| 推送到我服务器的结果 | Webhooks(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#webhook-configurations) |
Markdown输出选项
API密钥: output_options.markdown。
| 症状 | 旋钮 |
|---|---|
| 下游需要HTML表格 | output_tables_as_markdown: false |
| 表格跨多页 | merge_continued_tables: true |
| 图像转录而非引用 | inline_images: true |
| 想要Markdown中的链接目标 | annotate_links: true |
| 文档有跟踪更改或注释 | annotate_revisions: true(https://developers.llamaindex.ai/llamaparse/parse/guides/configuring-parse/#revision-tracking) |
| 表格单元格中的空白 | compact_markdown_tables: true |
| 多行单元格内容 | markdown_table_multiline_separator: "\n" |
{
"output_options": {
"markdown": {
"annotate_links": true,
"inline_images": true,
"tables": {
"merge_continued_tables": true,
"output_tables_as_markdown": false
}
}
}
}
修订跟踪
提取Word样式的跟踪更改和审阅者注释作为与解析内容并列的结构化数据——更改了什么、谁更改的、它在页面和Markdown中的位置。
API密钥: output_options.markdown.annotate_revisions。通过expand=["items"]检索。
{
"output_options": {
"markdown": {
"annotate_revisions": true
}
}
}
适用于包含跟踪更改或注释的Word文档,以及从Word导出或打印、且标记可见的PDF——包括扫描副本。非英文版本的Word产生的修订气泡也会被识别。
启用时,items结果中的每页都可以携带一个revisions数组。每个修订都有类型(inserted、deleted、formatted、moved_from、moved_to或comment)、其适用的目标文本、修订或注释内容(如果可用)、作者、目标文本和已打印修订气泡的边界框,以及将目标链接到该页最终Markdown的字符偏移量。有关完整的响应形状,请参阅项目页面上的修订(https://developers.llamaindex.ai/llamaparse/parse/guides/retrieving-results/#items)。
在Parse操场中,提取的修订在运行后出现在修订选项卡中。
层级限制: 修订依赖于items结果,该结果在fast层级上不可用。
空间文本
使用空白保留视觉定位。用于表单、CAD绘图、多列布局、收据。
API密钥: output_options.spatial_text。通过expand=["text"]检索。
标志:preserve_layout_alignment_across_pages、preserve_very_small_text、do_not_unroll_columns。
表格作为电子表格
生成XLSX文件——每个表格一个工作表。
API密钥: output_options.tables_as_spreadsheet。通过expand=["xlsx_content_metadata"]检索。
{
"output_options": {
"tables_as_spreadsheet": {
"enable": true
}
}
}
图像资产
API密钥: output_options.images_to_save——枚举数组:"screenshot"、"embedded"、"layout"。通过expand=["images_content_metadata"]检索。
{
"output_options": {
"images_to_save": ["screenshot", "embedded"]
}
}
印刷页码
(原文截断)
相似文章
@llama_index: 大多数解析器将修订跟踪视为噪音。结果:一个被删除的条款会作为活跃文本返回,而你的流水线读取…
LlamaParse 现在处理文档中的修订跟踪,提供最终状态的干净 markdown 以及编辑、删除和评论的结构化数据,解决解析器误解修订跟踪的问题。
@jerryjliu0:我们当前的核心使命是利用 AI 解决文档 OCR 问题。我们所有的产品线,从商业产品(LlamaParse)到……
LlamaIndex 对其官网进行了全面改版,并重申了以 AI 驱动文档 OCR 的核心使命,旗下产品涵盖商业产品 LlamaParse 以及开源工具 LiteParse 和 ParseBench。LlamaParse 采用基于 VLM 的智能文档理解技术,可大规模处理复杂版式、表格、图表及手写文字。
@jerryjliu0: 我们已在 LlamaParse 中构建了以下文档检索端点:* 混合搜索(grep + 向量搜索)* 文件 g…
LlamaParse 引入了新的文档检索端点,包括混合搜索、文件 grep、文件 find 和文件 read,旨在提高非结构化文档上的智能检索质量。
@jerryjliu0: 文档解析中最难的部分之一是实现细粒度的归因和边界框。这让你能够将文本定位到…
LlamaParse 现在支持多层边界框(区域级、行级、词级),用于细粒度的文档文本归因,提高了发票、研究报告等文档的可审计性。
@jerryjliu0: 我们构建了一个用于尽职调查的AI代理,带有精确到源页面的审计追踪,您可以将其作为模板使用…
LlamaIndex的Jerry Liu演示了如何使用LiteParse构建一个财务尽职调查AI代理。LiteParse是一个免费的开源PDF解析器,能够提供精确引用和边界框坐标,从而在代理工作流中实现信任和透明度。