Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
feat: update paragraph merging logic and enhance block type handling in para_split
myhloli8056340cd734
diff --git a/mineru/backend/pipeline/model_json_to_middle_json.py b/mineru/backend/pipeline/model_json_to_middle_json.pyindex b46e7a15..7c9b0523 100644--- a/mineru/backend/pipeline/model_json_to_middle_json.py+++ b/mineru/backend/pipeline/model_json_to_middle_json.py@@ -171,7 +171,7 @@ def result_to_middle_json(model_list, images_list, pdf_doc, image_writer, lang=N"""formula_number优化"""_optimize_formula_number_blocks(middle_json["pdf_info"])- """分段"""+ """段落合并"""para_split(middle_json["pdf_info"])"""表格跨页合并"""diff --git a/mineru/backend/pipeline/para_split.py b/mineru/backend/pipeline/para_split.pyindex 45e8e66e..98239b1c 100644--- a/mineru/backend/pipeline/para_split.py+++ b/mineru/backend/pipeline/para_split.py@@ -25,7 +25,7 @@ def __process_blocks(blocks):current_block = blocks[i]# 如果当前块是 text 类型- if current_block['type'] == 'text':+ if current_block['type'] in [BlockType.TEXT, BlockType.INDEX]:current_block['bbox_fs'] = copy.deepcopy(current_block['bbox'])if 'lines' in current_block and len(current_block['lines']) > 0:current_block['bbox_fs'] = [@@ -57,6 +57,8 @@ def __process_blocks(blocks):def __is_list_or_index_block(block):+ if block['type'] == BlockType.INDEX:+ return BlockType.INDEX# 一个block如果是list block 应该同时满足以下特征# 1.block内有多个line 2.block 内有多个line左侧顶格写 3.block内有多个line 右侧不顶格(狗牙状)# 1.block内有多个line 2.block 内有多个line左侧顶格写 3.多个line以endflag结尾