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: add support for SEAL block type in bbox drawing and update image handling in markdown content
myhloli09fc22fcc20e
diff --git a/mineru/backend/pipeline/pipeline_middle_json_mkcontent.py b/mineru/backend/pipeline/pipeline_middle_json_mkcontent.pyindex 49a3b136..dc464a35 100644--- a/mineru/backend/pipeline/pipeline_middle_json_mkcontent.py+++ b/mineru/backend/pipeline/pipeline_middle_json_mkcontent.py@@ -32,7 +32,14 @@ def make_blocks_to_markdown(paras_of_layout,if para_block['lines'][0]['spans'][0].get('content', ''):para_text = merge_para_with_text(para_block)else:- para_text += f""+ para_text = f""+ elif para_type == BlockType.SEAL:+ if len(para_block['lines']) == 0 or len(para_block['lines'][0]['spans']) == 0:+ continue+ para_text = f""+ if para_block['lines'][0]['spans'][0].get('content', []):+ content = " ".join(para_block['lines'][0]['spans'][0]['content'])+ para_text += f" \n{content}"elif para_type == BlockType.IMAGE:if mode == MakeMode.NLP_MD:continuediff --git a/mineru/utils/draw_bbox.py b/mineru/utils/draw_bbox.pyindex ef3cd762..9a93ebbf 100644--- a/mineru/utils/draw_bbox.py+++ b/mineru/utils/draw_bbox.py@@ -188,6 +188,8 @@ def draw_layout_bbox(pdf_info, pdf_bytes, out_path, filename):elif nested_block["type"] == BlockType.CHART_FOOTNOTE:bbox = nested_block["bbox"]imgs_footnote.append(bbox)+ elif block["type"] == BlockType.SEAL:+ imgs_body.append(bbox)elif block["type"] == BlockType.TITLE:titles.append(bbox)elif block["type"] in [BlockType.TEXT, BlockType.REF_TEXT, BlockType.ABSTRACT]: