A document layout ranking method based on hierarchical mask mechanism

CN122618014APending Publication Date: 2026-08-21TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610581937.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-29
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

但此类方法存在计算开销大、推理速度慢、部署复杂等问题,难以满足实际大规模文档处理的需求

Benefits of technology

1、复杂布局排序准确率显著提升:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122618014A_ABST
    Figure CN122618014A_ABST
Patent Text Reader

Abstract

The application provides a document layout sorting method based on a hierarchical mask mechanism, which comprises the following steps: S1, constructing a content block set C={B i |i=1..N} based on a document detection model to extract document image bounding box coordinates and category labels; S2, extracting special layout content blocks with category labels of graphics, tables and titles from the content block set C and performing mask preprocessing to generate text category content blocks and special layout mask content blocks containing bounding box coordinates and category labels; S3, performing multi-granularity segmentation on content blocks with category labels of text category in the content block set C; S4, for each atomic region, implementing a sorting process of mask content blocks M j by multi-stage semantic filtering and adaptive distance measurement through the category labels and bounding boxes of the special layout mask content blocks and the multi-column text mask content blocks; S5, performing global reordering on all atomic region content blocks according to the rules of ascending order of sequential index labels, descending order of label priority, ascending order of the vertical coordinate y1 of the upper left corner of the bounding box and ascending order of the horizontal coordinate x1 of the upper left corner of the bounding box, and reassigning sequential index labels to the content blocks to complete content block reordering; and S6, outputting the sorted content blocks and their sequences; the application significantly improves the sorting accuracy and processing efficiency of complex layout documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document image processing and understanding, and particularly to a document layout sorting method based on a hierarchical masking mechanism. This method is applicable to scenarios such as document reading order recovery, structured information extraction, and document digitization, and is especially suitable for the efficient sorting of documents with complex layouts (such as multi-column, nested, and cross-page content). Background Technology

[0002] Document reading order restoration is one of the core tasks in document image understanding, aiming to arrange content blocks (such as text, tables, and graphics) in a document image in an orderly manner according to human reading habits. Existing technologies mainly include: 1. Traditional geometric heuristic methods, such as the XY-Cut algorithm, which recursively segments the page through horizontal and vertical projection. While effective for simple layouts, it is prone to segmentation failures and order errors in complex structures such as multi-column, nested, L-shaped, and multi-column layouts. This is mainly due to its rigid threshold and lack of semantic modeling of the content. Figure 2 , Figure 3 As shown. 2. Deep learning-based methods, such as the LayoutLM series and LayoutReader, can fuse visual and textual features and achieve high performance through large-scale training. However, these methods suffer from high computational overhead, slow inference speed, and complex deployment, making them difficult to meet the needs of large-scale document processing in practice. The shortcomings of existing methods are: traditional methods have low accuracy under complex layouts and lack modeling of semantic structures; deep learning methods are insufficient in terms of efficiency, interpretability, and ease of use; and there is still no efficient and universal solution for content sorting problems under complex layouts (such as L-shaped, multi-column, and nested layouts). Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of existing technologies. This invention provides a document layout sorting method based on a hierarchical masking mechanism. The method first pre-masks special layout elements (such as titles, tables, and graphics) in the document image, effectively avoiding the segmentation failure of the traditional XY-Cut algorithm in complex layouts (such as multi-column, L-shaped, nested, etc.). Subsequently, a multi-granularity segmentation strategy is adopted, through cross-layout processing, geometric pre-segmentation, and density-driven refinement, to achieve adaptive recursive projection segmentation of content blocks. Combining semantic tags and bounding box coordinates, multi-stage semantic filtering and adaptive distance metrics are used to sort the content blocks, significantly improving the sorting accuracy and processing efficiency of documents with complex layouts.

[0004] To achieve the above objectives, this invention proposes a document layout sorting method based on a hierarchical masking mechanism, comprising: A document layout sorting method based on a hierarchical masking mechanism includes the following steps: S1 extracts the bounding box coordinates and category labels of document images based on a document detection model, and constructs a content block set C={B i |i=1..N}; S2 extracts special layout content blocks with category labels of graphics, tables, and titles from the content block set C and performs mask preprocessing to generate text content blocks with bounding box coordinates and category labels, as well as special layout mask content blocks. S3 performs multi-granularity segmentation on content blocks in the content block set C whose category label is text, including: 31. Divide the text content block into single-column text content blocks and multi-column text content blocks, and then perform masking on the multi-column text content blocks to obtain multi-column text mask content blocks to complete the cross-processing process; 32. Calculate the distance between the bounding box coordinates of the special layout mask content block and the bounding box coordinates of the nearest single-column text content block, identify the central element and isolated graphic components in the special layout content block, and complete the geometric segmentation process of dividing the original page into several atomic regions. 33. For each atomic region, the segmentation axis is dynamically selected based on the content density ratio of the single-column text content blocks. The single-column text content blocks within the region are recursively projected and segmented until each region contains only a single content block. Then, a sequential index label is added to each content block according to its level depth in the recursive tree to obtain the masked content block set M. j and the sorted single-column text content block set G j Density-driven refinement process; For each atomic region, S4 uses multi-stage semantic filtering and adaptive distance metrics to obtain the category labels and bounding boxes of special layout mask content blocks and multi-column text mask content blocks to form a mask content block set M. j The sorting process; S5 performs a global reordering of all atomic region content blocks according to the rules of ascending order of sequential index labels, descending order of label priority, ascending order of the y1 coordinate of the top left corner of the bounding box, and ascending order of the x1 coordinate of the top left corner of the bounding box, and then reassigns sequential index labels to the content blocks to complete the content block reordering. S6 outputs the sorted content blocks and their order.

[0005] Further, step 31 divides the text content block into single-column text content blocks and multi-column text content blocks, and then performs masking processing on the multi-column text content blocks to obtain multi-column text mask content blocks, completing the cross-processing process, including: 310 Traverse all text content blocks B i Calculate the orientation of each content block. If the vertical length (y2) i -y1 i ) / Horizontal length (x2) i -x1 iIf the ratio is less than 2, it is in the horizontal direction; otherwise, it is in the vertical direction. 311 Determine whether the width W of each content block is greater than the adaptive threshold. If the number of overlapping blocks projected in that direction is greater than 2, then B is determined. i Multi-column text is considered text, while single-column text is considered text; wherein: the adaptive threshold for: Wherein, scaling factor The recommended value is 1.3; Median(w) is the width w of the bounding box of all content blocks with text as the category label. i =x2 i -x1 i of the median.

[0006] Further, step 32 calculates the distance between the bounding box coordinates of the special layout mask content block and the bounding box coordinates of the nearest single-column text content block, identifies the central element and isolated graphic components in the special layout content block, and completes the geometric segmentation process of dividing the original page into several atomic regions, including: 321 Traverse the content block set C containing content blocks B with category labels of graphics, tables, and titles. i Calculate the center point of its bounding box ( , ); 322 Calculate content block B according to the following formula i To all text content blocks B labeled as text t Bounding box center point ( , The Euclidean distance is selected by choosing the minimum distance d. min =min d(B i B t ); If d min <D isolate And the content block bounding box width w i Greater than the isolated length threshold If there is no text on either side of the content block, then content block B is determined to be... i An isolated graphical component, denoted as B. ig By isolating graphics component B ig The coordinates divide the original page region [0,h,0,w] into multiple atomic regions R. ; where: D isolate The isolated distance threshold; h is the page height, w is the page width; the isolated length threshold for: Wherein, scaling factor The recommended value is 1.5; Median(w) is the width w of the bounding box of all content blocks with text as category labels. i =x2 i -x1 i of the median.

[0007] Furthermore, in step 33, the segmentation axis is dynamically selected for each atomic region based on the content density ratio of the single-column text content blocks. The single-column text content blocks within the region are recursively projected and segmented until each region contains only a single content block. Then, a sequential index label is added to each content block according to its level depth in the recursive tree to obtain a sorted set G of single-column text content blocks. j and the set of unsorted masked content blocks M j Density-driven refinement process; including: 331 Initialize the list of regions to be segmented R list for 332 loop from R list Take a region R from j Each R j The set of single-column text content blocks is P. j The set of masked content blocks is M j ; 333 Statistics R j Content density ratio within the region: Density R =Area RP / Area RM ; Among them: Area RP Area of ​​a single-column text content block: Area RP =∑(R P .x2-R P .x1) (R P .y2-R P .y1); Area RM Mask content block area: Area RM =∑(R M .x2-R M .x1) (R M .y2-R M .y1); If Density R >=T density Prioritize horizontal segmentation (along the Y-axis): Calculate the single-column text content block B within the region. iIn the projection histogram on the Y-axis, find the Y-coordinate with the smallest projection value as the dividing point y. cut ; along y=y cut The horizontal line divides region R into two sub-regions, upper and lower. top and R bottom ; Project along the X-axis, project along the Y-axis, ... until each region contains only one single-column text content block; then, add a sequential index label block_index to each content block according to its level depth in the recursive tree; If Density R <T density Prioritize vertical segmentation (along the X-axis): Calculate the single-column text content block B within the calculated area. i In the projection histogram on the X-axis, find the X-coordinate with the smallest projection value as the dividing point x. cut Along x=x cut The vertical line divides region R into two sub-regions, left and right. left and R right Next, the region is segmented by projection along the Y-axis, then by projection along the X-axis, and so on, until each region contains only one single-column text content block. Then, a sequential index label block_index is added to each content block according to its level depth in the recursive tree. When R list When empty, the entire page has been divided into a series of atomic regions j, each containing a sorted set of single-column text content blocks G. j and the set of unsorted masked content blocks M j。

[0008] Furthermore, the content block detection employs the PP-DocLayout document detection model to obtain bounding box coordinates and category labels, whereby the category labels include text, titles, tables, and graphics. Further, the multi-stage semantic filtering includes sorting content blocks according to label priority, with the priority order being multi-column text masks, titles, tables, and graphics. Further, the weight parameters of the adaptive distance metric are optimized through a grid search of large-scale document samples. Further, the output sorting result is in a structured data format.

[0009] Beneficial effects 1. Significantly improved sorting accuracy for complex layouts: Based on the DocBench-100 dataset, in complex layout scenarios, the block-level BLEU-4 index is improved from 0.749 of the traditional XY-Cut algorithm to 0.986, which is 28.5% higher than the deep learning method LayoutReader (0.701). It achieves near-perfect reading order alignment (Kendall's τ coefficient 0.996) and effectively solves the segmentation failure problem of complex structures such as multi-column, L-shaped and multi-column layouts.

[0010] 2. Outstanding processing efficiency, suitable for large-scale scenarios: With an Intel® Xeon® Gold 6326 CPU (2.90GHz) and 256GB of memory, the inference speed reaches 514.5 FPS, a 23x improvement over LayoutReader (22 FPS) and a 5.6% improvement over the pure geometric method XY-Cut (487 FPS). Semantic filtering reduces redundant recursive processing, achieving industrial-grade deployment capabilities with both high accuracy and high throughput.

[0011] 3. The project is highly feasible and has both explainability and scalability: Without requiring complex neural network training, this lightweight framework based on bounding box coordinates and shallow semantic labels can be directly integrated into existing document processing workflows (such as the PP-DocLayout detection model). The algorithm logic follows a hierarchical mechanism of "pre-masking-segmentation-matching," and the parameters at each stage (such as the adaptive threshold β=1.3) can be dynamically optimized through grid search, supporting generalized adaptation to cross-domain documents (newspapers, academic papers, financial reports). Attached Figure Description

[0012] Figure 1 A flowchart of document image processing integrated with XY-Cut++: showing document image input, layout detection, premasking, multi-granularity segmentation, cross-modal matching, and result output.

[0013] Figure 2 The XY-Cut recursive segmentation process and fault example diagram under complex layout: This shows the incorrect order of the traditional XY-Cut method under complex layout. The correct reading order should be ①③②④⑤⑥⑦.

[0014] Figure 3 Schematic diagram of XY-Cut segmentation failure under L-shaped input: This diagram illustrates the segmentation failure and errors caused by the L-shaped structure. The correct segmentation order should be ②③①.

[0015] Figure 4 XY-Cut++ Method Flowchart: Showing Figure 4 .a layout detection, Figure 4 .b Premask processing Figure 4 .c multi-granularity segmentation Figure 4 .d Cross-modal matching.

[0016] Figure 5 Multi-granularity segmentation flowchart: showing cross-layout processing, geometric pre-cutting, and recursive density-driven segmentation.

[0017] Figure 6Cross-modal matching flowchart: illustrating multi-stage semantic filtering and adaptive distance metric and ranking strategies.

[0018] Figure 7 Sorting results example Figure 1 (Complex page) Figure 8 Sorting results example Figure 2 (Rules page) Detailed Implementation

[0019] The overall process is as follows Figure 1 As shown. The following is in conjunction with the appendix. Figure 1 - Appendix Figure 8 The implementation process of this invention is explained in detail below, including the formulas and instructions: In this invention, B i Refers to all types of content blocks, including but not limited to text content blocks, image content blocks, etc.; B t Specifically refers to the text content block used to calculate Euclidean distance, which is B. i One specific implementation method. Step 1: Input and Content Block Detection The input and content block detection process is as follows: Figure 4 As shown in .a.

[0020] Input a document image, and use an existing document detection model (such as PP-DocLayout) to extract the bounding box coordinates (represented as (x1, y1, x2, y2), where (x1, y1) are the coordinates of the top-left corner and (x2, y2) are the coordinates of the bottom-right corner) and category labels (such as text, title, table, image, etc.) of each content block. The output is a set of content blocks C={B i |i=1..N}, where each block B i Includes its bounding box coordinates and category label, where N is the total number of content blocks.

[0021] Step 2: Premasking The premask processing flow is as follows: Figure 4 As shown in .b.

[0022] Masking is applied to special layout content blocks in content block set C with category tags of graphics, tables, and titles (these content blocks have flexible positions, large size differences, and are prone to disrupting the page grid structure and sorting logic), and they are added to the mask list M.

[0023] Step 3: Multi-granularity segmentation Multi-granularity segmentation process as follows Figure 4 .c、 Figure 5 As shown.

[0024] 1. Cross-layout processing: a. Calculate the adaptive threshold: Calculate the width w of the bounding box for all content blocks whose category labels are text. i =x2 i -x1 i The median Median(w). An adaptive threshold is set. : (4) Wherein, scaling factor The recommended value is 1.3.

[0025] b. Identify and mask multi-column text content blocks: Traverse all text content blocks B i Calculate the orientation of each content block. If the vertical length (y2) i -y1 i ) / Horizontal length (x2) i -x1 i If the ratio is less than 2, it is horizontal; otherwise, it is vertical. If text content block B... i width w i Greater than the adaptive threshold If the number of content blocks that overlap with its projection in this direction (the intersection-union ratio (IoU) of the bounding boxes of the two content blocks in this direction is greater than 0, indicating that their coordinate ranges overlap, then the two are considered to be mutually overlapping projection blocks) exceeds 2, then the current text content block B is determined to be... i For multi-column text, add it to the mask list M; otherwise, treat it as single-column text.

[0026] 2. Geometric pre-segmentation: a. Select content blocks B from content block set C that are categorized as graphics, tables, and titles. i, Calculate the center point of its bounding box ( , ).

[0027] b. Calculate content block B i To all text content blocks B labeled as text t Bounding box center point ( , Euclidean distance: (5) c. Find the minimum distance d min =min d(B i B t ).

[0028] d. Set the isolation distance threshold D isolate (Take 0.05 times the page width w, i.e., D) isolate =0.05 w), isolated length threshold : (6) scaling factor The recommended value is 1.5.

[0029] e. If d min <D isolate And the content block bounding box width w i Greater than the isolated length threshold If there is no text on either side of the content block (i.e., its projection IoU with all text content blocks in the left and right directions is 0), then content block B is determined to be... i An isolated graphical component, denoted as B. ig If the isolated graphics component B ig If the direction is horizontal, then follow B. ig The x1 coordinate horizontally divides the page; if the isolated graphic component B ig If the direction is perpendicular, then according to B ig The page is vertically divided using the y1 coordinate. Ultimately, the original page region [0,h,0,w] is divided into multiple atomic regions R. Meanwhile, the mask list M is split into various atomic regions, where h is the page height and w is the page width. After the masking process in steps two and three (1), each atomic region is left with only a single-column text content block.

[0030] 3. Density-driven refinement (recursive projection segmentation): a. Initialize the list of regions to be segmented, R list for .

[0031] b. Loop: From R list Take a region R from j Each R j The set of single-column text content blocks is P. j The set of masked content blocks is M j .

[0032] Calculate the content density ratio: Calculate the area of ​​the single-column text content block contained within region R. RP =∑(R P .x2-R P .x1) (R P .y2-R P .y1), Area of ​​the mask content block RM =∑(R M .x2-R M .x1) (R M .y2-R M.y1), content density ratio Density R =Area RP / Area RM .

[0033] Set density ratio threshold T density It is 0.9.

[0034] Recursive projection partitioning logic: If Density R >=T density Prioritize horizontal segmentation (along the Y-axis): Calculate the single-column text content block B within the region. i In the projection histogram on the Y-axis, find the Y-coordinate with the smallest projection value as the dividing point y. cut Along y=y cut The horizontal line divides region R into two sub-regions, upper and lower. top and R bottom Next, the data is segmented by projection along the X-axis, then by projection along the Y-axis, and so on, until each region contains only one single-column text content block. Then, a sequential index label, block_index, is added to each content block based on its level depth in the recursive tree.

[0035] If Density R <T density Prioritize vertical segmentation (along the X-axis): Calculate the single-column text content block B within the calculated area. i In the projection histogram on the X-axis, find the X-coordinate with the smallest projection value as the dividing point x. cut Along x=x cut The vertical line divides region R into two sub-regions, left and right. left and R right Next, the data is segmented by projection along the Y-axis, then by projection along the X-axis, and so on, until each region contains only one single-column text content block. Then, a sequential index label, block_index, is added to each content block based on its level depth in the recursive tree.

[0036] c. Recursion Termination: When R... list When empty, the entire page has been divided into a series of atomic regions j, each containing a sorted set of single-column text content blocks G. j and the set of unsorted masked content blocks M j .

[0037] Step 4: Cross-modal matching The cross-modal matching and content block sorting process is as follows: Figure 4 .d、 Figure 6 As shown. For each atomic region j, the following operation is performed: 1. Multi-stage semantic filtering (pre-sorting): a. Define label priority: multi-column text mask > title > table > image.

[0038] b. For the mask set M j The blocks in the array are sorted by tag priority (higher priority blocks come first).

[0039] c. After primary sorting, M j For content blocks of the same priority, secondary sorting is performed based on their spatial position on the page: first sorted in ascending order by y1 coordinate, and if y1 is the same, then sorted in ascending order by x1 coordinate. This results in a pre-sorted candidate block list V.

[0040] 2. Adaptive distance metric: a. Initialize the sorted list S j =G j .

[0041] b. Iterative sorting: (when V is not empty) Extract the first candidate block B from V. p .

[0042] For S j Each sorted block B in o Calculate the joint geometric distance D(B) p B o ): (7) Among them, various constraints The definition is as follows: (Intersection constraint): Calculate B p With B o The projection intersection and union ratio IoU(B) p B o If IoU > 0, then =0; otherwise =1.

[0043] (Boundary Proximity): Calculates the distance to the Manhattan boundary. This value is always non-negative; the smaller the value, the closer the proximity.

[0044] (Vertical Continuity): Calculate the vertical distance, if B p For multi-column text masks =-B o .y2, otherwise =B o .y1.

[0045] (Horizontal sorting): Calculate horizontal distance =B o.x1.

[0046] weight w k Adjusts automatically based on page size: (8) Where h and w are the page height and width.

[0047] weight w edge The algorithm was determined and solidified through grid search experiments on 2800 document samples, ensuring optimal sorting accuracy. (9) Among them, the content block orientation is determined as follows: if the vertical length of the content block (y2) is... i -y1 i ) / Horizontal length (x2) i -x1 i If the ratio is less than 2, it is in the horizontal direction; otherwise, it is in the vertical direction.

[0048] Calculate B p To S j Each B in o Distance D(B) p B o Find the minimum value D. min =min D(B p B o ) and corresponding .

[0049] B p Insert into S j middle After the corresponding position, and B p Remove from V.

[0050] c. Finally, S j M represents the mask set corresponding to atomic region j. j and the sorted set G j The final reading order.

[0051] Step 5: Content Block Reordering S, a sorted list of all atomic regions j The system performs a global reordering based on the rules of ascending order of the sequential index labels of each content block, descending order of label priority (title > text > graphics / tables), ascending order of bounding box y1 coordinates, and ascending order of bounding box x1 coordinates, and reassigns the sequential index label block_index to each content block.

[0052] Step 6: Output Results Output the sorted structured information of the content blocks. The structured information includes the page dimensions (w, h) and a list of content blocks arranged in order. Each content block includes its unique identifier (id), category label (block_label), bounding box coordinates (block_bbox), and sequence index label (block_index). Example output format (JSON): { "page_width":2480, "page_height":3508, "blocks":[ { "id":1, "block_label":"title", "block_bbox":[100,150,800,250], "block_index":0 }, { "id":2, "block_label":"text", "block_bbox":[100,280,500,1200], "block_index":1 }, { "id":3, "block_label":"figure", "block_bbox":[550,300,1050,800], "block_index":2 }, { "id":4, "block_label":"text", "block_bbox":[550,820,1050,900], "block_index":3 }, ... / / Other blocks ] } Sorting examples Figure 7 , Figure 8 As shown.

Claims

1. A document layout sorting method based on a hierarchical masking mechanism, characterized in that, The steps include the following: S1 extracts the bounding box coordinates and category labels of document images based on a document detection model, and constructs a content block set C={B i |i=1..N}; S2 extracts special layout content blocks with category labels of graphics, tables, and titles from the content block set C and performs mask preprocessing to generate text content blocks with bounding box coordinates and category labels, as well as special layout mask content blocks. S3 performs multi-granularity segmentation on content blocks in the content block set C whose category label is text, including:

31. Divide the text content block into single-column text content blocks and multi-column text content blocks, and then perform masking on the multi-column text content blocks to obtain multi-column text mask content blocks to complete the cross-processing process; 32. Calculate the distance between the bounding box coordinates of the special layout mask content block and the bounding box coordinates of the nearest single-column text content block, identify the central element and isolated graphic components in the special layout content block, and complete the geometric segmentation process of dividing the original page into several atomic regions.

33. For each atomic region, the segmentation axis is dynamically selected based on the content density ratio of the single-column text content blocks. The single-column text content blocks within the region are recursively projected and segmented until each region contains only a single content block. Then, a sequential index label is added to each content block according to its level depth in the recursive tree to obtain the masked content block set M. j and the sorted single-column text content block set G j Density-driven refinement process; For each atomic region, S4 uses multi-stage semantic filtering and adaptive distance metrics to obtain the category labels and bounding boxes of special layout mask content blocks and multi-column text mask content blocks to form a mask content block set M. j The sorting process; S5 performs a global reordering of all atomic region content blocks according to the rules of ascending order of sequential index labels, descending order of label priority, ascending order of the y1 coordinate of the top left corner of the bounding box, and ascending order of the x1 coordinate of the top left corner of the bounding box, and then reassigns sequential index labels to the content blocks to complete the content block reordering. S6 outputs the sorted content blocks and their order.

2. The method according to claim 1, characterized in that, The step 31 divides text content blocks into single-column text content blocks and multi-column text content blocks, and then performs masking processing on the multi-column text content blocks to obtain multi-column text masked content blocks, completing the cross-processing process, including: 310 Traverse all text content blocks B i Calculate the orientation of each content block. If the vertical length (y2) i -y1 i ) / Horizontal length (x2) i -x1 i If the ratio is less than 2, it is in the horizontal direction; otherwise, it is in the vertical direction. 311 Determine whether the width W of each content block is greater than the adaptive threshold. If the number of overlapping blocks projected in that direction is greater than 2, then B is determined. i Multi-column text is considered text, while single-column text is considered text; wherein: the adaptive threshold for: Wherein, scaling factor The recommended value is 1.3; Median(w) is the width w of the bounding box of all content blocks with text as the category label. i =x2 i -x1 i of the median.

3. The method according to claim 1, characterized in that, The step 32 calculates the distance between the boundary frame coordinates of the special layout mask content block and the boundary frame coordinates of the nearest single-column text content block, identifies the central element and isolated graphic components in the special layout content block, and completes the geometric segmentation process of dividing the original page into several atomic regions, including: 321 Traverse the content block set C containing content blocks B with category labels of graphics, tables, and titles. i Calculate the center point of its bounding box ( , ); 322 Calculate content block B according to the following formula i To all text content blocks B labeled as text t Bounding box center point ( , The Euclidean distance is selected by choosing the minimum distance d. min =min d(B i B t ); If d min <D isolate And the content block bounding box width w i Greater than the isolated length threshold If there is no text on either side of the content block, then content block B is determined to be... i An isolated graphical component, denoted as B. ig ; through isolated graphics component B ig The coordinates divide the original page region [0,h,0,w] into multiple atomic regions R. ; where: D isolate The isolated distance threshold; h is the page height, w is the page width; the isolated length threshold for: Wherein, scaling factor The recommended value is 1.5; Median(w) is the width w of the bounding box of all content blocks with text as category labels. i =x2 i -x1 i of the median.

4. The method according to claim 1, characterized in that, In step 33, the segmentation axis is dynamically selected for each atomic region based on the content density ratio of the single-column text content blocks. The single-column text content blocks within the region are recursively projected and segmented until each region contains only a single content block. Then, a sequential index label is added to each content block according to its level depth in the recursive tree to obtain a sorted set G of single-column text content blocks. j and the set of unsorted masked content blocks M j Density-driven refinement process; include: 331 Initialize the list of regions to be segmented R list for 332 loop from R list Take a region R from j Each R j The set of single-column text content blocks is P. j The set of masked content blocks is M j ; 333 Statistics R j Content density ratio within the region: Density R =Area RP / Area RM ; Among them: Area RP Area of ​​a single-column text content block: Area RP =∑(R P .x2-R P .x1) (R P .y2-R P .y1); Area RM Mask content block area: Area RM =∑(R M .x2-R M .x1) (R M .y2-R M .y1); If Density R >=T density Prioritize horizontal segmentation (along the Y-axis): Calculate the single-column text content block B within the region. i In the projection histogram on the Y-axis, find the Y-coordinate with the smallest projection value as the dividing point y. cut ; along y=y cut The horizontal line divides region R into two sub-regions, upper and lower. top and R bottom ; Project along the X-axis, project along the Y-axis, ... until each region contains only one single-column text content block; then, add a sequential index label block_index to each content block according to its level depth in the recursive tree; If Density R <T density Prioritize vertical segmentation (along the X-axis): Calculate the single-column text content block B within the calculated area. i In the projection histogram on the X-axis, find the X-coordinate with the smallest projection value as the dividing point x. cut Along x=x cut The vertical line divides region R into two sub-regions, left and right. left and R right Next, the region is segmented by projection along the Y-axis, then by projection along the X-axis, and so on, until each region contains only one single-column text content block. Then, a sequential index label block_index is added to each content block according to its level depth in the recursive tree. When R list When empty, the entire page has been divided into a series of atomic regions j, each containing a sorted set of single-column text content blocks G. j and the set of unsorted masked content blocks M j。 5. The method according to claim 1, characterized in that, Content block detection uses the PP-DocLayout document detection model to obtain bounding box coordinates and category labels, which include text, titles, tables, and graphics.

6. The method according to claim 1, characterized in that, The multi-stage semantic filtering includes sorting content blocks according to tag priority, with the priority order being multi-column text mask, title, table, and graphics.

7. The method according to claim 1, characterized in that, The weight parameters of the adaptive distance metric are optimized through a grid search of large-scale document samples.

8. The method according to claim 1, characterized in that, The output sorting results are in structured data format.