Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/version3.x/pipeline_usage/PP-StructureV3.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,8 @@ for res in output:
markdown_list.append(md_info)
markdown_images.append(md_info.get("markdown_images", {}))

markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
markdown_result = pipeline.concatenate_markdown_pages(markdown_list)
markdown_texts = markdown_result["markdown_texts"]

mkd_file_path = output_path / f"{Path(input_file).stem}.md"
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -2853,7 +2854,7 @@ If enabled, the cell detection model will not be used, and only the table struct
<td><code>markdown_list</code></td>
<td><code>list</code></td>
<td>List of markdown data for each page.</td>
<td>Returns the merged markdown text and image list.</td>
<td>Returns a <code>MarkdownResult</code> object. Access <code>result["markdown_texts"]</code> to get the merged Markdown text. Save images separately from each page's <code>markdown_images</code>.</td>
</tr>
</table>

Expand Down Expand Up @@ -2954,7 +2955,7 @@ If enabled, the cell detection model will not be used, and only the table struct
<li>Calling <code>save_to_json()</code> saves the above content to the specified <code>save_path</code>. If it’s a directory, the saved path will be <code>save_path/{your_img_basename}_res.json</code>. If it’s a file, it saves directly. Numpy arrays are converted to lists since JSON doesn't support them.</li>
<li>Calling <code>save_to_img()</code> saves visual results to the specified <code>save_path</code>. If a directory, various visualizations such as layout detection, OCR, and reading order are saved. If a file, only the last image is saved and others are overwritten.</li>
<li>Calling <code>save_to_markdown()</code> saves converted markdown files to <code>save_path/{your_img_basename}.md</code>. For PDF input, it's recommended to specify a directory to avoid file overwriting.</li>
<li>Calling <code>concatenate_markdown_pages()</code> merges multi-page markdown results from the <code>PP-StructureV3 pipeline</code> into a single document and returns the merged content.</li>
<li>Calling <code>concatenate_markdown_pages()</code> merges multi-page markdown results from the <code>PP-StructureV3 pipeline</code> into a single document and returns a <code>MarkdownResult</code> object. Use <code>result["markdown_texts"]</code> to get the merged Markdown text.</li>

Additionally, you can access the prediction results and visual images through the following attributes:

Expand Down
7 changes: 4 additions & 3 deletions docs/version3.x/pipeline_usage/PP-StructureV3.md
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,8 @@ for res in output:
markdown_list.append(md_info)
markdown_images.append(md_info.get("markdown_images", {}))

markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
markdown_result = pipeline.concatenate_markdown_pages(markdown_list)
markdown_texts = markdown_result["markdown_texts"]

mkd_file_path = output_path / f"{Path(input_file).stem}.md"
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -2743,7 +2744,7 @@ for item in markdown_images:
<td><code>markdown_list</code></td>
<td><code>list</code></td>
<td>包含每一页Markdown数据的列表。</td>
<td>返回处理后的Markdown文本和图像列表。</td>
<td>返回 <code>MarkdownResult</code> 对象,通过 <code>result["markdown_texts"]</code> 获取合并后的Markdown文本。图像需从各页的 <code>markdown_images</code> 中单独保存。</td>
</tr>
</table>

Expand Down Expand Up @@ -2844,7 +2845,7 @@ for item in markdown_images:
<li>调用<code>save_to_json()</code> 方法会将上述内容保存到指定的 <code>save_path</code> 中,如果指定为目录,则保存的路径为<code>save_path/{your_img_basename}_res.json</code>,如果指定为文件,则直接保存到该文件中。由于 json 文件不支持保存numpy数组,因此会将其中的 <code>numpy.array</code> 类型转换为列表形式。</li>
<li>调用<code>save_to_img()</code> 方法会将可视化结果保存到指定的 <code>save_path</code> 中,如果指定为目录,则会将版面区域检测可视化图像、全局OCR可视化图像、版面阅读顺序可视化图像等内容保存,如果指定为文件,则直接保存到该文件中。(产线通常包含较多结果图片,不建议直接指定为具体的文件路径,否则多张图会被覆盖,仅保留最后一张图)</li>
<li>调用<code>save_to_markdown()</code> 方法会将转化后的 Markdown 文件保存到指定的 <code>save_path</code> 中,保存的文件路径为<code>save_path/{your_img_basename}.md</code>,如果输入是 PDF 文件,建议直接指定目录,否责多个 markdown 文件会被覆盖。
调用 <code>concatenate_markdown_pages()</code> 方法将 <code>PP-StructureV3 pipeline</code> 输出的多页Markdown内容<code>markdown_list</code>合并为单个完整文档,并返回合并后的Markdown内容。</li>
调用 <code>concatenate_markdown_pages()</code> 方法将 <code>PP-StructureV3 pipeline</code> 输出的多页Markdown内容<code>markdown_list</code>合并为单个完整文档,并返回 <code>MarkdownResult</code> 对象。使用 <code>result["markdown_texts"]</code> 获取合并后的Markdown文本。</li>
</ul>
此外,也支持通过属性获取带结果的可视化图像和预测结果,具体如下:
<table>
Expand Down