Method and device for extracting cross-page table data

By parsing and sorting cross-page table data through a vectorized recognition algorithm, the problems of inaccurate extraction and low efficiency in the existing technology are solved, and efficient and accurate cross-page table data processing is achieved.

CN120706387APending Publication Date: 2025-09-26百望股份有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510737055.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively extract cross-page table data, and suffer from problems such as inaccurate recognition, low efficiency, and insufficient customization, especially poor performance in complex layouts and large-scale data processing.

Method used

Using vectorized recognition algorithm, the page objects in OFD documents are parsed, line segments are classified, table structures are identified, text data is merged, and sorted in a specific order to extract cross-page table data.

Benefits of technology

It improves the accuracy and efficiency of cross-page table data extraction, can handle complex layouts and variable structures, and meet the needs of large-scale data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706387A_ABST
    Figure CN120706387A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and device for extracting cross-page table data. The method comprises the following steps that a page object in OFD is analyzed, and text information and line segment information are extracted; classifying the extracted line segments into a horizontal line segment group and a vertical line segment group, and combining the line segment data and the text data of the first page and the second page to form a unified line segment data group and a text data group; identifying a table structure from the merged line segment data set, forming an intersection point grid by detecting intersection of horizontal line segments and vertical line segments, and constructing rectangular cells based on adjacent intersection points to form a cell set; and extracting a text associated with each cell by judging whether the rectangular boundary of each text character is located in the cell boundary or not. According to the embodiment of the invention, the text in the cross-page table is extracted by vectorizing the identification table, the complex page layout, the variable table structure and the potential data continuity problem can be processed, and the consistency and the accuracy of the extraction result are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a method and device for extracting cross-page table data. Background Art

[0002] With the current information explosion, OFD documents have become an important carrier for information transmission and storage in various industries due to their fixed format, easy sharing and preservation. However, the non-editability and closed format of OFD documents also bring many difficulties to data extraction. For complex OFD documents containing cross-page tables, traditional manual extraction methods are not only time-consuming and labor-intensive, but also prone to errors and difficult to adapt to the needs of large-scale data processing. Although there are some automated tools on the market for extracting OFD table data, these tools often have many limitations when processing cross-page tables. For example, they may not be able to accurately identify the boundaries of cross-page tables, resulting in data loss or misalignment; or they may not be able to effectively handle the logical relationship of the data in the table, resulting in a lack of consistency and accuracy in the extraction results.

[0003] Application Contents

[0004] The purpose of the embodiments of the present application is to provide a method and apparatus for extracting cross-page table data, so as to solve the defect that the prior art cannot effectively extract cross-page table data.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, a method for extracting cross-page table data is provided, comprising the following steps:

[0007] Parsing a page object in an open fixed-layout document (OFD) to extract text information and line segment information, wherein the first and second pages in the OFD are used to display a spreadsheet;

[0008] Classify the extracted line segments into horizontal line segment groups and vertical line segment groups, sort the horizontal line segment groups from left to right and then from top to bottom, and sort the vertical line segment groups from top to bottom and then from left to right;

[0009] Identifying a maximum vertical coordinate of a horizontal line segment group in the first page, shifting the line segments and text data of the second page upward by the maximum vertical coordinate, and merging the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group;

[0010] Identifying a table structure from the merged line segment data set, forming an intersection grid by detecting intersections of horizontal and vertical line segments, constructing rectangular cells based on adjacent intersections to form cell groups, and sorting the cell groups from left to right and then from top to bottom;

[0011] By determining whether the rectangular boundary of each text character is within the cell boundary, the text associated with each cell is extracted, and the extracted text is sorted from left to right and then from top to bottom.

[0012] In a second aspect, a device for extracting cross-page table data is provided, comprising:

[0013] A parsing module, configured to parse a page object in an open fixed-layout document (OFD), extract text information and line segment information, wherein the first and second pages in the OFD are used to display a cross-page table;

[0014] a classification module for classifying the extracted line segments into horizontal line segment groups and vertical line segment groups, sorting the horizontal line segment groups from left to right and then from top to bottom, and sorting the vertical line segment groups from top to bottom and then from left to right;

[0015] an identification module configured to identify a maximum vertical coordinate of a horizontal line segment group in the first page, translate the line segments and text data of the second page upward by the maximum vertical coordinate, and merge the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group;

[0016] a sorting module for identifying a table structure from the merged line segment data set, forming an intersection grid by detecting intersections of horizontal and vertical line segments, constructing rectangular cells based on adjacent intersections to form cell groups, and sorting the cell groups in order from left to right and then from top to bottom;

[0017] The extraction module is used to extract the text associated with each cell by determining whether the rectangular boundary of each text character is within the cell boundary, and sort the extracted text in order from left to right and then from top to bottom.

[0018] The embodiment of the present application extracts text from tables that span multiple pages by vectorizing table recognition, and is capable of handling complex page layouts, variable table structures, and potential data continuity issues, thereby improving the consistency and accuracy of the extraction results. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a flow chart of a method for extracting cross-page table data provided by an embodiment of the present application;

[0020] Figure 2 It is a structural diagram of a device for extracting cross-page table data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0022] With the advent of the big data era, the complexity of information processing and the amount of data have increased dramatically. As a widely used document format, OFD, the automated extraction and parsing of its content has become a key link in the data processing process. In particular, the extraction of cross-page table data requires not only a high degree of accuracy, but also the processing of complex page layouts, variable table structures, and potential data continuity issues. As various industries continue to increase their requirements for data processing accuracy and efficiency, traditional extraction methods have become difficult to meet actual needs. Especially in the fields of finance, medical care, scientific research, etc., cross-page table data often contains a large amount of key information, and the accuracy and efficiency of its extraction directly affect subsequent data analysis and decision-making. Therefore, how to develop an efficient and accurate method for extracting data from OFD cross-page tables has become an important issue that needs to be urgently addressed in the current information processing field.

[0023] Currently, technical solutions for extracting data from OFD cross-page tables can be divided into the following categories:

[0024] Optical Character Recognition (OCR)-based technologies: These technologies first use OCR technology to convert images in OFD documents into editable text. Then, text analysis algorithms are used to identify table boundaries, rows, and columns, and extract the data within the table.

[0025] Template matching-based techniques: This method requires pre-defining a table template. The OFD document's content is then matched against the template to extract the table data. Templates can be defined based on the table's structure, style, or specific keywords. In fields such as finance and healthcare, some customized software systems use template matching to extract OFD table data in specific formats.

[0026] Machine learning and deep learning-based technologies: With the development of machine learning and deep learning technologies, some advanced algorithms have been applied to OFD table data extraction. These algorithms can automatically learn the characteristics of tables and identify the boundaries and data of tables that span multiple pages.

[0027] Although the above technical solutions have made some progress in extracting data from OFD cross-page tables, they still have the following defects:

[0028] Accuracy Issues: Due to the complexity and diversity of OFD documents, existing technologies still experience errors in identifying table boundaries, handling cross-page data continuity, and parsing table content. Recognition accuracy is particularly low for tables with complex layouts and blurred or distorted images. This can result in incomplete, misplaced, or erroneous extracted data, impacting subsequent data analysis and decision-making.

[0029] Efficiency Issues: Existing technologies are often slow to process large, high-density OFD documents, failing to meet real-time or rapid processing requirements. Processing large volumes of documents consumes significant time and computing resources, increasing the cost and difficulty of data processing.

[0030] Customization Requirements: OFD documents in different industries and fields have different formats and characteristics, requiring customized solutions to accommodate these differences. However, existing technologies often struggle to fully meet these customization requirements. This can limit the applicability of existing technologies in certain scenarios, necessitating the development of specialized tools or algorithms.

[0031] Dependency and cost: Some advanced technologies, such as machine learning and deep learning, require high-performance hardware and complex algorithmic models, which increases the difficulty and cost of implementation. For small and medium-sized enterprises or individual users, the cost of these technologies and equipment may be unaffordable, limiting their widespread adoption and application.

[0032] In summary, while current OFD cross-page table data extraction technology has made some progress, it still faces many challenges and drawbacks. To further improve the accuracy and efficiency of extraction, it is necessary to continuously explore new technologies and methods, and to enhance the customization and adaptability of the technology.

[0033] The embodiments of the present application are deeply rooted in the intersection of information technology, document processing and automated analysis. Specifically, it focuses on the innovation and development of advanced OFD document content parsing and extraction technology, and proposes a method and device for extracting cross-page table data in OFD files. The method adopts a more advanced table recognition algorithm to extract text in the table.

[0034] The following describes in detail a method for extracting cross-page table data provided by an embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0035] like Figure 1 FIG. 1 is a flow chart of a method for extracting cross-page table data provided by an embodiment of the present application, the method comprising the following steps:

[0036] Step 101 : parsing a page object in an OFD to extract text information and line segment information. The first page and the second page in the OFD are used to display a cross-page table.

[0037] In this embodiment, after parsing the page objects in the OFD, invisible objects, objects with RGB (255, 255, 255) color, objects with zero transparency, completely clipped objects, and vector QR code objects may also be filtered out.

[0038] Step 102: Classify the extracted line segments into horizontal line segment groups and vertical line segment groups. Sort the horizontal line segment groups from left to right and then from top to bottom, and sort the vertical line segment groups from top to bottom and then from left to right.

[0039] Step 103: Identify the maximum vertical coordinate of the horizontal line segment group in the first page, translate the line segments and text data of the second page upward by the maximum vertical coordinate, merge the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group.

[0040] In this embodiment, before translating the line segments and text data of the second page upward by the maximum vertical coordinate and merging the line segment data and text data of the first page and the second page, the coordinate systems of the first page and the second page may be normalized to align their coordinate origins.

[0041] Step 104: Identify the table structure from the merged line segment data group, form an intersection grid by detecting the intersection of horizontal line segments and vertical line segments, and construct rectangular cells based on adjacent intersections to form cell groups. Sort the cell groups in order from left to right and then from top to bottom.

[0042] In this embodiment, after forming an intersection grid by detecting the intersection of horizontal line segments and vertical line segments and constructing rectangular cells based on adjacent intersections, it is also possible to identify the vertical line segments in each row and use their horizontal coordinates to vertically divide the constructed rectangular cells, and update the cell group to reflect the structure after division.

[0043] Step 105 , extracting the text associated with each cell by determining whether the rectangular boundary of each text character is within the cell boundary, and sorting the extracted text in order from left to right and then from top to bottom.

[0044] In this embodiment, before sorting the extracted text in the order of first left to right and then top to bottom, the characters in each cell may be aggregated into words or phrases based on the proximity of the rectangular boundaries of the text characters to maintain the semantic integrity of the extracted text.

[0045] The embodiment of the present application extracts text from tables that span multiple pages by vectorizing table recognition, and is capable of handling complex page layouts, variable table structures, and potential data continuity issues, thereby improving the consistency and accuracy of the extraction results.

[0046] In the embodiment of the present application, based on the cross-page table of two adjacent pages of OFD, the text of the cross-page table is extracted. The specific implementation process is as follows:

[0047] 1. Preprocessing stage

[0048] 1.1OFD Document Parsing

[0049] step:

[0050] 1) Parse the page objects in the OFD document data. These page objects contain attribute information for elements such as text and line segments. Text information includes the rectangular bounding box information and Unicode encoding of each character, and line segment information mainly includes the information of the two endpoints. During the object parsing process, it is necessary to filter out objects that do not meet the filtering conditions. The filtering conditions are as follows:

[0051] (1) The object is a visible object

[0052] (2) The object color cannot be RGB(255,255,255)

[0053] (3) The object's transparency is greater than 0

[0054] (4) The object is not completely clipped and is therefore invisible.

[0055] (5) The object cannot be a vector QR code

[0056] 2) The table line screening process is as follows:

[0057] (1) According to the straight line information obtained in step 1), the horizontal line segment group and the vertical line segment group are respectively selected.

[0058] (2) Sort the horizontal line segment groups from left to right and then from top to bottom, and the vertical line segment groups from top to bottom and then from left to right.

[0059] 3) Parse the page data for the first page according to step 1), find the horizontal line segment group according to step 2), then find the horizontal line segment with the largest vertical coordinate and mark the vertical coordinate of this horizontal line segment as maxY. Parse the page data for the second page and linearly shift all text and line segments upward by maxY. Merge the line data from the first page with the line data from the second page to form a line data group. Merge the text data from the first page with the text data from the second page to form a text data group.

[0060] 4) The form recognition process is as follows:

[0061] (1) According to the straight line data group obtained in step 3), the horizontal line segment group and the vertical line segment group are respectively selected.

[0062] (2) Sort the horizontal line segment groups from left to right and then from top to bottom, and the vertical line segment groups from top to bottom and then from left to right.

[0063] (3) Filter the intersecting line segments of the vertical line segment group and the horizontal line segment group to form a line segment intersection group, and filter out all the line segment intersection points to form a line segment intersection point group.

[0064] (4) Sort the line segment intersection points from left to right and then from top to bottom.

[0065] (5) According to the intersection information of the line segment intersection group, the nearest lower right corner intersection of each intersection is selected to form a rectangular cell, and so on to form a cell group.

[0066] (6) Filter the cells in the cell group, filter out adjacent cells, and sort them from left to right and from top to bottom to finally form a cell group.

[0067] 5) The cell segmentation process is as follows:

[0068] (1) Vertically split the table cells extracted in step 4). Filter all vertical line segments and group the upper endpoints into vertical segmentation lines.

[0069] (2) Extract the cells in each row, split the cells according to the vertical dividing lines obtained in (1), and then form a new cell group, and so on, to finally form a table.

[0070] 6) The text extraction process is as follows:

[0071] Based on the text information extracted in step 3), all the text in each cell is extracted based on whether the text rectangle is contained in the cell, and sorted from left to right and from top to bottom. Similarly, the text in all cells is extracted.

[0072] The embodiment of the present application can effectively improve the efficiency and accuracy of OFD table data extraction by vectorizing the recognition table instead of picturing the table, and the recognition efficiency reaches 99.99%.

[0073] like Figure 2 FIG. 1 is a schematic diagram of a structure of a device for extracting cross-page table data provided by an embodiment of the present application, comprising:

[0074] The parsing module 210 is used to parse the page objects in the open fixed layout document OFD, extract text information and line segment information, and the first and second pages in the OFD are used to display a cross-page table.

[0075] The classification module 220 is used to classify the extracted line segments into horizontal line segment groups and vertical line segment groups, sort the horizontal line segment groups in the order from left to right and then from top to bottom, and sort the vertical line segment groups in the order from top to bottom and then from left to right.

[0076] The identification module 230 is used to identify the maximum vertical coordinate of the horizontal line segment group in the first page, translate the line segments and text data of the second page upward by the maximum vertical coordinate, and merge the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group.

[0077] The sorting module 240 is used to identify the table structure from the merged line segment data group, form an intersection grid by detecting the intersection of horizontal line segments and vertical line segments, and construct rectangular cells based on adjacent intersections to form cell groups, and sort the cell groups in order from left to right and then from top to bottom.

[0078] The extraction module 250 is used to extract the text associated with each cell by determining whether the rectangular boundary of each text character is within the cell boundary, and sort the extracted text in order from left to right and then from top to bottom.

[0079] In this embodiment, the above-mentioned device further includes:

[0080] The filtering module is used to filter out invisible objects, objects with RGB (255, 255, 255) color, objects with zero transparency, completely clipped objects, and vector QR code objects.

[0081] The alignment module is used to normalize the coordinate systems of the first page and the second page to align their coordinate origins.

[0082] The segmentation module is used to vertically segment the constructed rectangular cells by identifying the vertical line segments within each row and using their horizontal coordinates, and to update the cell group to reflect the segmented structure.

[0083] The aggregation module is used to aggregate the characters in each cell into words or phrases according to the proximity of the text character rectangle boundary to maintain the semantic integrity of the extracted text.

[0084] The embodiment of the present application extracts text from tables that span multiple pages by vectorizing table recognition, and is capable of handling complex page layouts, variable table structures, and potential data continuity issues, thereby improving the consistency and accuracy of the extraction results.

[0085] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various processes of the above-mentioned method embodiment for extracting cross-page table data, and can achieve the same technical effect. To avoid repetition, the details are not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0086] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0088] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A method for extracting cross-page table data, characterized in that: The following steps are involved: Parsing a page object in an open fixed-layout document (OFD) to extract text information and line segment information, wherein the first and second pages in the OFD are used to display a spreadsheet; Classify the extracted line segments into horizontal line segment groups and vertical line segment groups, sort the horizontal line segment groups from left to right and then from top to bottom, and sort the vertical line segment groups from top to bottom and then from left to right; Identifying a maximum vertical coordinate of a horizontal line segment group in the first page, shifting the line segments and text data of the second page upward by the maximum vertical coordinate, and merging the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group; Identifying a table structure from the merged line segment data set, forming an intersection grid by detecting intersections of horizontal and vertical line segments, constructing rectangular cells based on adjacent intersections to form cell groups, and sorting the cell groups from left to right and then from top to bottom; By determining whether the rectangular boundary of each text character is within the cell boundary, the text associated with each cell is extracted, and the extracted text is sorted from left to right and then from top to bottom.

2. The method according to claim 1, characterized in that After parsing the page object in the OFD, the following steps are also included: Filter out invisible objects, objects with RGB(255,255,255) color, objects with zero transparency, completely clipped objects, and vector QR code objects.

3. The method according to claim 1, characterized in that Before translating the line segments and text data of the second page upward by the maximum vertical coordinate and merging the line segment data and text data of the first page and the second page, the method further includes: The coordinate systems of the first page and the second page are normalized to align their coordinate origins.

4. The method according to claim 1, wherein After forming an intersection grid by detecting the intersection of horizontal line segments and vertical line segments and constructing rectangular cells based on adjacent intersection points, the method further includes: By identifying the vertical line segments within each row, the constructed rectangular cells are vertically segmented using their horizontal coordinates, and the cell group is updated to reflect the segmented structure.

5. The method according to claim 1, wherein Before sorting the extracted text from left to right and then from top to bottom, the following steps are also included: The characters within each cell are clustered into words or phrases based on the proximity of the text character rectangle boundaries to maintain the semantic integrity of the extracted text.

6. A device for extracting cross-page table data, characterized in that: include: A parsing module, configured to parse a page object in an open fixed-layout document (OFD), extract text information and line segment information, wherein the first and second pages in the OFD are used to display a cross-page table; a classification module for classifying the extracted line segments into horizontal line segment groups and vertical line segment groups, sorting the horizontal line segment groups from left to right and then from top to bottom, and sorting the vertical line segment groups from top to bottom and then from left to right; an identification module configured to identify a maximum vertical coordinate of a horizontal line segment group in the first page, translate the line segments and text data of the second page upward by the maximum vertical coordinate, and merge the line segment data and text data of the first page and the second page to form a unified line segment data group and text data group; a sorting module for identifying a table structure from the merged line segment data set, forming an intersection grid by detecting intersections of horizontal and vertical line segments, constructing rectangular cells based on adjacent intersections to form cell groups, and sorting the cell groups in order from left to right and then from top to bottom; The extraction module is used to extract the text associated with each cell by determining whether the rectangular boundary of each text character is within the cell boundary, and sort the extracted text in order from left to right and then from top to bottom.

7. The device according to claim 6, characterized in that Also includes: The filtering module is used to filter out invisible objects, objects with RGB (255, 255, 255) color, objects with zero transparency, completely clipped objects, and vector QR code objects.

8. The device according to claim 6, characterized in that Also includes: The alignment module is used to normalize the coordinate systems of the first page and the second page to align their coordinate origins.

9. The device according to claim 6, characterized in that Also includes: The segmentation module is used to vertically segment the constructed rectangular cells by identifying the vertical line segments within each row and using their horizontal coordinates, and to update the cell group to reflect the segmented structure.

10. The device according to claim 6, characterized in that Also includes: The aggregation module is used to aggregate the characters in each cell into words or phrases according to the proximity of the text character rectangle boundary to maintain the semantic integrity of the extracted text.

Citation Information

Cited By

  • Method and system for generating bank electronic reconciliation bill in OFD format

    CN121070882A