Table structure identification method and device

By obtaining and using the attribute information of the EXCEL working table unit to perform regional segmentation and characteristic data analysis, the problem of relying on image quality in existing technologies has been solved, and more accurate and efficient table structure recognition is achieved.

CN119339399APending Publication Date: 2025-01-21ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310900443.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The prior art relies heavily on image quality in table structure recognition, resulting in poor recognition effect under low image quality or complex backgrounds.

Method used

By obtaining the attribute information of multiple cells of the worksheet, perform area segmentation to obtain the target area, and use the characteristic data of the cell sequence to identify the table structure.

Benefits of technology

It effectively avoids dependence on image quality, improves the effect of table structure recognition, and can distinguish the structure of multiple tables in one worksheet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339399A_ABST
    Figure CN119339399A_ABST
Patent Text Reader

Abstract

The invention provides a table structure identification method and device. The table structure identification method comprises the following steps: acquiring attribute information of a plurality of cells of a to-be-identified work table; according to the attribute information of the plurality of cells of the worksheet, performing region segmentation on the worksheet to obtain at least one target region in the worksheet; wherein different target areas belong to different tables in the worksheet; for each target area, obtaining feature data corresponding to each cell sequence according to attribute information of a plurality of cells contained in at least one cell sequence in the target area; and performing table structure identification on a target cell sequence according to the feature data corresponding to the target cell sequence in the at least one cell sequence. According to the embodiment of the invention, the table structure recognition effect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a table structure recognition method and device. Background Art

[0002] Tables are a common form of data presentation, used to express structured information. Since tables contain rich structured data, table structure recognition is of great significance for document understanding tasks.

[0003] In the related art, image recognition is usually used to recognize table structures. However, this method is heavily dependent on image quality. When the image quality is low and the background is complex, the table structure recognition effect is poor. Summary of the invention

[0004] The embodiments of the present disclosure provide a table structure recognition method and device.

[0005] According to a first aspect of an embodiment of the present disclosure, a table structure recognition method is provided, the method comprising:

[0006] Obtaining attribute information of multiple cells of the worksheet to be identified;

[0007] According to the attribute information of a plurality of cells in the worksheet, the worksheet is segmented into regions to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet;

[0008] For each of the target areas, acquiring feature data corresponding to each of the cell sequences according to attribute information of a plurality of cells included in at least one cell sequence in the target area;

[0009] According to the characteristic data corresponding to the target cell sequence in at least one of the cell sequences, the table structure of the target cell sequence is identified.

[0010] In one embodiment, the data of the worksheet is stored in an extensible markup language (XML) format; the acquiring the attribute information of the plurality of cells of the worksheet to be identified includes:

[0011] Obtain XML format data corresponding to the worksheet;

[0012] determining a plurality of cells from the worksheet;

[0013] For each of the cells, the attribute information of the cell is extracted from the multiple attribute information contained in the XML format data; wherein the attribute information of the cell includes attribute values ​​of one or more attributes.

[0014] In one embodiment, the plurality of cells in the cell sequence are arranged to form a cell row; and the step of segmenting the worksheet according to the attribute information of the plurality of cells in the worksheet to obtain at least one target area in the worksheet includes:

[0015] Determine at least one rough area in the worksheet according to the attribute information of a plurality of cells in the worksheet; wherein the rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in the rough area is less than a preset threshold;

[0016] Determine at least one connected region formed by non-empty cells in each of the rough regions;

[0017] For each of the rough regions, connected regions within the rough region are merged to form the target region.

[0018] In one embodiment, the step of performing table structure recognition on the target cell sequence according to feature data corresponding to the target cell sequence in at least one of the cell sequences includes:

[0019] Determining content text feature data of the target cell sequence and feature values ​​of a plurality of target features from feature data corresponding to the target cell sequence; the feature values ​​of the target features include target continuous feature values;

[0020] Processing the target continuous feature value of each target feature into a corresponding target discrete feature value;

[0021] Generate a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and the target discrete feature values ​​of the plurality of target features;

[0022] The combined feature vector corresponding to the target cell sequence is input into the trained table structure recognition model for processing to obtain a table structure recognition result; wherein the table structure recognition result is used to determine whether the table structure information of the target cell sequence is a title, a header, a content area or other types of data.

[0023] In one embodiment, before the step of performing table structure recognition on the target cell sequence according to the feature data corresponding to the target cell sequence in at least one of the cell sequences, the method further comprises:

[0024] Acquire sample feature data corresponding to a plurality of sample cell sequences respectively; wherein the sample cell sequence is a cell sequence in a target area of ​​a sample worksheet;

[0025] According to the candidate feature data other than the content text feature data in the sample feature data, multiple target features are screened from multiple candidate features; wherein the number of the candidate features is greater than the number of the target features.

[0026] In one embodiment, the step of selecting a plurality of target features from a plurality of candidate features according to the candidate feature data other than the content text feature data in the sample feature data includes:

[0027] Sorting the candidate feature data by feature importance using a decision tree model to obtain a feature ranking result;

[0028] According to the feature sorting result, a plurality of target features are screened from a plurality of candidate features.

[0029] In one embodiment, the method further comprises:

[0030] According to the preset number of bins and the sample continuous characteristic value of the target feature in the sample characteristic data, the target feature is binned to obtain multiple bin intervals corresponding to the target feature; wherein different bin intervals correspond to different discrete characteristic values.

[0031] In one embodiment, processing the target continuous feature value of each target feature into a corresponding target discrete feature value includes:

[0032] For each of the target features, a target binning interval to which a target continuous feature value of the target feature belongs is determined among a plurality of binning intervals corresponding to the target feature, so as to obtain a target discrete feature value of the target feature.

[0033] In one embodiment, generating a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and a plurality of target discrete feature values ​​of the target features includes:

[0034] Encoding the content text feature data of the target cell sequence to obtain a first feature vector;

[0035] Encoding target discrete feature values ​​of a plurality of target features of the target cell sequence to obtain a second feature vector;

[0036] The first feature vector and the second feature vector are concatenated to generate a combined feature vector corresponding to the target cell sequence.

[0037] In one embodiment, the training process of the table structure recognition model includes:

[0038] Acquire a sample set, wherein each sample in the sample set includes: sample feature data corresponding to a sample cell sequence and a sample label; the sample label is used to characterize whether the table structure information of the sample cell sequence is a title, a header, a content area or other types;

[0039] According to the sample feature data corresponding to the sample cell sequence, obtaining a combined feature vector corresponding to the sample cell sequence;

[0040] The table structure recognition model is trained according to the combined feature vector corresponding to the sample cell sequence and the sample label to obtain the trained table structure recognition model.

[0041] According to a second aspect of an embodiment of the present disclosure, a table structure recognition device is provided, the device comprising:

[0042] A first acquisition module is used to acquire attribute information of a plurality of cells of a worksheet to be identified;

[0043] A segmentation module, used for performing region segmentation on the worksheet according to the attribute information of a plurality of cells of the worksheet, to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet;

[0044] A second acquisition module is used to acquire, for each of the target areas, feature data corresponding to each of the cell sequences according to attribute information of a plurality of cells included in at least one cell sequence in the target area;

[0045] The recognition module is used to perform table structure recognition on the target cell sequence according to the characteristic data corresponding to the target cell sequence in at least one of the cell sequences.

[0046] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the table structure recognition method provided in any one of the first aspects is implemented.

[0047] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the table structure recognition method provided in any one of the first aspects is implemented.

[0048] The disclosed embodiments provide a table structure recognition method and device, which obtains attribute information of multiple cells of a worksheet to be recognized, and uses the attribute information of the cells to perform region segmentation on the worksheet to obtain at least one target region; since cells are basic components of a table, the feature data obtained by using the attribute information of multiple cells contained in a cell sequence can better characterize the table structure of the cell sequence, thereby using the feature data corresponding to the cell sequence to perform table structure recognition, and the table structure of the cell sequence can be accurately recognized.

[0049] Compared with the use of image recognition to identify table structures, the embodiments of the present disclosure can effectively avoid the dependence of image recognition methods on image quality, improve the table structure recognition effect, and at the same time, when there are multiple tables in a worksheet, it can distinguish the table structure of each table; in addition, it can also be applied to table structure recognition in complex scenarios (such as when there is annotation data in the area).

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0052] Figure 1 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0053] Figure 2 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0054] Figure 3 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0055] Figure 4 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0056] Figure 5 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0057] Figure 6 A schematic diagram of a flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0058] Figure 7 A schematic diagram of a flow chart of a table structure recognition model training method provided by an embodiment of the present disclosure is shown;

[0059] Figure 8a A specific flow chart of a table structure recognition method provided by an embodiment of the present disclosure is shown;

[0060] Figure 8b A schematic diagram showing the feature importance ranking provided by an embodiment of the present disclosure is shown;

[0061] Figure 8c A schematic diagram of the structure of a table structure recognition model provided by an embodiment of the present disclosure is shown;

[0062] Fig. 9 A schematic diagram of the structure of a table structure recognition device provided by an embodiment of the present disclosure is shown;

[0063] Fig.10 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0064] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.

[0065] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0066] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the disclosed embodiments, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the disclosed embodiments, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0067] It can be understood that the description of various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0068] Figure 1 A schematic diagram of a table structure recognition method provided by an embodiment of the present disclosure is shown. Figure 1 As shown, the method may include the following steps:

[0069] 101: Obtaining attribute information of multiple cells of the worksheet to be identified;

[0070] 102: performing region segmentation on the worksheet according to attribute information of a plurality of cells in the worksheet to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet;

[0071] 103: For each target area, according to the attribute information of multiple cells included in at least one cell sequence in the target area, obtain feature data corresponding to each cell sequence;

[0072] 104: Perform table structure recognition on the target cell sequence according to the feature data corresponding to the target cell sequence in at least one cell sequence.

[0073] In the disclosed embodiment, the table structure recognition method can be executed by an electronic device, which can include a terminal and / or a server. The terminal can include, but is not limited to, a mobile phone, a tablet computer, a personal digital assistant, a laptop computer, a desktop computer, or a document processor. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server.

[0074] In the present disclosure, the worksheet to be identified can be any form of worksheet that requires table structure recognition, for example, the table file can be an EXCEL file, etc., and the worksheet to be identified can also be a table inserted in other types of document files, other types of document files such as WORD files, PPT files or PDF files, etc.; in addition, the worksheet to be identified can also be a table embedded in a web page, etc.

[0075] For example, for a worksheet in an EXCEL file, one or more tables can be created or inserted in a worksheet, and different tables are distributed in different areas of the worksheet. For another example, for a worksheet in a WORD file, the worksheet can be a table inserted in the WORD file, and the worksheet usually includes one table.

[0076] In some examples, there may be multiple ways to obtain the worksheet to be identified. For example, the worksheet to be identified may be obtained from a locally stored worksheet, or the worksheet to be identified may be obtained from another device via a network.

[0077] In some examples, before executing step 101, it can be determined whether the file format of the file to which the worksheet to be identified belongs is a specified format. If the file format of the file to which the worksheet belongs is not the specified format, the file to which the worksheet belongs needs to be converted into a file with the specified format.

[0078] In some examples, the file with the specified format may be a table file that stores data in XML format. For example, the specified format may be in xlsx format. If the file format of the file to which the worksheet to be identified belongs is in xls format, the file format of the file may be converted to xlsx format first, and then the attribute information of multiple cells of the worksheet to be identified in the file may be obtained. For another example, if the specified format is in docx format, and the file format of the file to which the worksheet to be identified belongs is in doc format, the file format of the file may be converted to docx format first, and then the attribute information of multiple cells of the worksheet to be identified in the file may be obtained.

[0079] In the above step 101, the attribute information of multiple cells of the worksheet can be obtained by obtaining XML format data corresponding to the worksheet to be identified and obtaining the attribute information of multiple cells of the worksheet from the XML format data, or by calling a table parsing tool to parse the worksheet data to obtain the attribute information of multiple cells of the worksheet.

[0080] Exemplarily, the attribute information of a cell may be setting information or configuration information of the cell. For example, the attribute information of a cell may be attribute values ​​of one or more specified attributes of the cell.

[0081] In some examples, the multiple cells for which attribute information needs to be obtained may be all cells in a worksheet, or may be multiple cells within a specified area in the worksheet.

[0082] In some examples, the attribute information of a cell may include at least one of the following: format information of the cell, location information of the cell, and text information on the cell.

[0083] In some examples, the format information of a cell may include at least one of the following: cell text format information, cell text text attribute information, cell fill information, cell border information, vertical distribution of cell text, horizontal distribution of cell text, font size information, font information, font color, fill style, left border information, right border information, top border information, bottom border information, and diagonal border information.

[0084] In some examples, the location information of a cell may include at least one of the following: row number information, column number information, table area information, the name of the worksheet where the cell is located, and coordinate information.

[0085] In some examples, the text information on the cell may be text, a character string, a numeric date, a formula, or other information.

[0086] In the above step 102, multiple non-empty cells can be determined based on the attribute information of multiple cells in the worksheet, and at least one rough area in the worksheet can be determined based on the positions of the multiple non-empty cells and preset constraints; the target area is determined based on the non-empty cells in each rough area; wherein the preset constraints are used to ensure that each rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in each target area is less than a preset threshold.

[0087] For example, a non-empty cell is a cell filled with content information, and an empty cell is a cell not filled with content information. Here, the preset constraint condition enables different coarse areas to be used to determine different target areas.

[0088] Exemplarily, determining the target area according to the non-empty cells in each rough area may include:

[0089] According to the multiple non-empty cells in each rough area, locate the first non-empty cell with the smallest row number, the second non-empty cell with the smallest column number, the third non-empty cell with the largest row number, and the fourth non-empty cell with the largest column number in each target area to be determined;

[0090] For each target area to be determined, obtain the fifth cell determined by the row number of the first non-empty cell and the column number of the second non-empty cell, and obtain the sixth cell determined by the row number of the third non-empty cell and the column number of the fourth non-empty cell, and determine the rectangular area formed by the fifth cell and the sixth cell as two diagonal points as the target area.

[0091] It is understandable that, in addition to the above-mentioned method, other methods may be used to implement region segmentation of the worksheet. For example, the region segmentation may be performed using a connected region segmentation method, which is not specifically limited in this embodiment.

[0092] In the present disclosure, the target area can be an area of ​​n rows and m columns in a worksheet, where n and m are both positive integers greater than or equal to 1. Any target area includes at least one cell sequence, and each cell sequence in the target area can be a cell row in the target area, or can be a cell column in the target area. A cell row is formed by a row of cells, and a cell column is formed by a column of cells.

[0093] In some examples, the arrangement direction of multiple cells in each cell sequence in the target area may be related to the table style of the table to which the target area belongs. In other words, whether each cell sequence in a target area is a cell row or a cell column is related to the table style of the table to which the target area belongs.

[0094] Here, multiple cell sequences in the same target area are all cell rows, or are all cell columns.

[0095] Here, the table style can be divided into: vertical table style (or: vertical table style) and horizontal table style (or: horizontal table style). The data in the vertical table style is displayed in columns, for example, the first column of the student score table displays the name, the second column displays the class, and the third column displays the score. The data in the horizontal table style is displayed in rows, for example, the first row of the regional temperature table displays the province, and the second row displays the temperature.

[0096] For example, when the table style of the table to which the target area belongs is a vertical table style, each cell sequence in the target area is a row of cells (or called: a cell row), that is, the arrangement direction of multiple cells in each cell sequence is horizontal arrangement.

[0097] For a table with a vertical table style, the table structure information of each row of cells can be identified based on the characteristic data corresponding to each row of cells in the table. The table structure information can be: title, header, content area or other types of data. Other types of data may include, for example: invalid data, narration and / or annotation data.

[0098] For another example, when the table style of the table to which the target area belongs is a horizontal table style, each cell sequence in the target area is a column of cells (or called: a cell column), that is, the arrangement direction of multiple cells in each cell sequence is vertical arrangement.

[0099] In some examples, the method may further include: obtaining a table style of a table to which at least one target area belongs. For example, the table style input by a user for the table to which each target area belongs may be obtained, or the recognition result of the table style of the table to which each target area belongs by a neural network model may be obtained.

[0100] For a table with a horizontal table style, the table structure information of each column of cells can be identified according to the characteristic data corresponding to each column of cells of the table. The table structure information can be: title, header, content area or other types of data.

[0101] It is worth noting that in the above step 102, when the worksheet is segmented into regions, if it is determined based on the attribute information of multiple cells of the worksheet that the multiple cells are empty cells, the table structure recognition process can be terminated.

[0102] In the above step 103, for each cell sequence in each target area, the attribute information of multiple cells included in the cell sequence may be statistically processed to obtain feature data corresponding to the cell sequence.

[0103] Exemplarily, statistical processing of attribute information of multiple cells may include at least one of the following: combining attribute information of multiple cells, statistical sum, statistical average, proportion calculation, statistical median, finding the maximum value, finding the variance, finding the standard deviation, etc.

[0104] In some examples, the feature data corresponding to the cell sequence includes: structural feature data and / or content text feature data of the cell sequence.

[0105] In some examples, for a table in a vertical table style, the cell sequence is a cell row, and the characteristic data corresponding to the cell sequence may include but is not limited to at least one of the following:

[0106] The row number of the current row, the text combination of the content of the current row, the row height of the current row, the average font size of the non-empty cells in the current row, the number of formulas in the non-empty cells in the current row, the number of dates in the non-empty cells in the current row, the number of numbers in the non-empty cells in the current row, the number of bold non-empty cells in the current row, whether the current row has a diagonal border, whether the current row has upper and lower borders, the number of horizontally merged cells in the current row, the number of cells in the previous row, the ratio of non-empty cells in the current row, and whether the current row is consistent with the previous row in terms of valid cells and corresponding positions.

[0107] In other examples, for a table in a horizontal table style, when the cell sequence is a cell column, the characteristic data corresponding to the cell sequence may include but is not limited to at least one of the following:

[0108] The column number of the current column, the content text combination of the current column, the column height of the current column, the average font size of the non-empty cells in the current column, the number of formulas in the non-empty cells in the current column, the number of dates in the non-empty cells in the current column, the number of numbers in the non-empty cells in the current column, the number of bold non-empty cells in the current column, whether the current column has a diagonal border, whether the current column has upper and lower borders, the number of horizontally merged cells in the current column, the number of cells in the previous column, the ratio of non-empty cells in the current column, and whether the current column is consistent with the previous column in terms of valid cells and corresponding positions.

[0109] In the above step 104, the characteristic data corresponding to the target cell sequence can be matched in a preset table structure information library, and the table structure information matching the characteristic data corresponding to the target cell sequence is determined as the table structure recognition result. For example, the sample table library can store: the correspondence between the characteristic data of the cell sequence and the table structure information.

[0110] In other examples, in the above step 104, the feature data corresponding to the target cell sequence can be vectorized to obtain a feature vector; the feature vector is input into the trained table structure recognition model for processing to obtain a table structure recognition result.

[0111] Here, the table structure recognition result can be used to determine whether the table structure information of the target cell sequence is a title, a header, a content area or other types of data.

[0112] Here, the target cell sequence may be any cell sequence in each target region.

[0113] In some examples, for each target area in a worksheet, multiple cell sequences in the target area may be sequentially used as target cell sequences for table structure recognition, thereby obtaining table structure recognition results for all cell sequences in the target area.

[0114] In some examples, the method may further include:

[0115] Output the table structure recognition results of each cell sequence in the target area. For example, in a worksheet, the table structure recognition results can be marked to the row or column where the corresponding cell sequence is located, or the table structure recognition results can be output as JSON (JavaScript object notation) data.

[0116] In some examples, before outputting the table structure recognition result, the method may further include:

[0117] Post-process the table structure recognition results.

[0118] Exemplarily, the table structure recognition result of the target cell sequence is verified with the table structure recognition result of the adjacent cell sequence, and the table structure recognition result of the target cell sequence is post-processed according to the verification result.

[0119] For example, if the table structure recognition result of the target cell sequence is inconsistent with the table structure recognition result of the adjacent cell sequence, the table structure recognition result of the target cell sequence is corrected using the table structure recognition result of the adjacent cell sequence.

[0120] Taking a vertical table as an example, considering that there is a lot of empty data (i.e., unfilled content) on a row in the table, for example, only one cell in the row has content (e.g., a serial number), under normal circumstances, the table structure of the row will be recognized as a content area, but may be mistakenly recognized as other types of data. In this case, the table structure recognition results of the cell row need to be post-processed.

[0121] For example, suppose the table structure of the first row of cells in a table is a title, and the table structures of the second to 21st rows are all content areas. If the table structure recognition model's recognition results for the table structure of rows 1 to 19 of the table are correct, but the table structure recognition results for rows 20 to 21 of the table are wrong, for example, the table structure of rows 20 to 21 is mistakenly recognized as other types. In this case, post-processing can be used for recall. The table structures of the upper and lower cells in the recall strategy are the same type of data, such as serial numbers A20 and A19 are consecutive numbers, and serial numbers A21 and A20 are consecutive numbers. Then the table structure type of the row cells where they are located should be the same as the table structure type of the cells in the previous row. When the row cell where A19 is located is recognized as the content area, the table structures of the row cells where A20 is located and the row cells where A21 is located can be corrected to the content area in turn, so that the accuracy of the table structure recognition results can be improved.

[0122] The disclosed embodiment provides a table structure recognition method, which obtains attribute information of multiple cells by performing data analysis on a worksheet to be recognized, and uses the attribute information of the cells to perform region segmentation on the worksheet to obtain at least one target region; since cells are the basic components of a table, the feature data obtained by using the attribute information of multiple cells contained in a cell sequence can better reflect the table structure of the cell sequence, thereby using the feature data corresponding to the cell sequence to perform table structure recognition, and the table structure of the cell sequence can be accurately recognized.

[0123] Compared with the use of image recognition to identify table structures, the embodiments of the present disclosure can effectively avoid the dependence of image recognition methods on image quality, improve the table structure recognition effect, and at the same time, when there are multiple tables in a worksheet, it can distinguish the table structure of each table; in addition, it can also be applied to table structure recognition in complex scenarios (such as when there is annotation data in the area).

[0124] In one embodiment, the data of the worksheet is stored in XML format. Figure 2 As shown, in the above step 101, obtaining the attribute information of multiple cells of the worksheet to be identified may include the steps of:

[0125] 201: Get the XML format data corresponding to the worksheet;

[0126] 202: Identify multiple cells from a worksheet;

[0127] 203: For each cell, extract the attribute information of the cell from the multiple attribute information included in the XML format data; wherein the attribute information of the cell includes attribute values ​​of one or more attributes.

[0128] Here, the XML format data is structured data, and the structured data includes one or more attributes and an attribute value corresponding to each attribute.

[0129] In the above step 201, the electronic spreadsheet file to which the worksheet belongs may be decompressed, and XML format data corresponding to the worksheet may be obtained from the decompressed file.

[0130] In the above step 202, all cells in the worksheet may be determined as the multiple cells whose attribute information needs to be obtained, or multiple cells within a specified area in the worksheet may be determined as the multiple cells whose attribute information needs to be obtained.

[0131] Exemplarily, the designated area range may be an area range determined by the electronic device detecting the distribution of table data in the worksheet, or the designated area range may be an area range selected by the user from the worksheet.

[0132] In the above step 203, for each of the multiple cells of the worksheet, attributes related to the cell and attribute values ​​corresponding to each attribute may be extracted from the XML format data corresponding to the worksheet to obtain attribute information of the cell.

[0133] In some examples, the attribute information of a cell may include at least one of the following: format information of the cell, location information of the cell, and text information on the cell.

[0134] Exemplarily, for the format information of a cell, for example, taking the cell text format information as an example, the cell text format information may include text format attributes and corresponding attribute values; the text format attributes may include text alignment, and the attribute values ​​of the text alignment may be: left-aligned, centered, right-aligned, justified, or distributed alignment; for another example, taking the cell border information as an example, the cell border information may include cell border attributes and corresponding attribute values; the cell border attributes may include attributes such as the color and line type of the cell border, and the attribute value of the color of the cell border is a specific color value (the color value may be a color name, such as: red or red); the attribute value of the line type of the cell border may be a solid line, a dotted line, or a double line, etc.

[0135] As another example, for the location information of a cell, the location attributes of the cell may include attributes such as the row, column, and worksheet of the cell. The attribute value of the row where the cell is located is the specific row number, the attribute value of the column where the cell is located is the specific column number, and the attribute value of the worksheet where the cell is located is the specific worksheet name.

[0136] For example, for text information on a cell, the text attribute on the cell can be used to reflect the data type of the content on the cell. For example, the text attribute value on the cell can be: text type, number type, date type, etc. Among them, the text type can indicate that the content of the cell is plain text.

[0137] In this embodiment, the data of the worksheet is stored in XML format. Since XML format data is structured data, the attribute information of the cell can be obtained conveniently and quickly by extracting the attribute information of the cell from the XML format data corresponding to the worksheet.

[0138] In one embodiment, Figure 3 As shown, in the above step 102, the worksheet is segmented into regions according to the attribute information of multiple cells in the worksheet to obtain at least one target region in the worksheet, which may include the steps of:

[0139] 301: determining at least one rough area in the worksheet according to attribute information of a plurality of cells in the worksheet; wherein the rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in the rough area is less than a preset threshold;

[0140] 302: Determine at least one connected region formed by non-empty cells in each rough region;

[0141] 303: For each coarse region, merge the connected regions in the coarse region to form a target region.

[0142] In the above step 301, non-empty cells with text information in the worksheet can be determined based on the attribute information of multiple cells in the worksheet, and at least one rough area can be determined in the worksheet based on the non-empty cells in the worksheet and preset constraints; the preset constraints are used to ensure that each rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in each target area is less than a preset threshold.

[0143] The preset threshold value may be preset according to the characteristics of the constructed table, for example, the preset threshold value may be set to 3 or 4.

[0144] In the above step 302, connected regions consisting of a plurality of adjacent non-empty cells may be determined in each rough region, and a unique identifier may be assigned to each connected region to distinguish it from other connected regions.

[0145] In the above step 303, for each rough area, connected areas in the rough area may be merged to obtain at least one merged area, and the minimum circumscribed rectangular area in the rough area including all merged areas is determined as the target area.

[0146] In this embodiment, by utilizing the attribute information of multiple cells of the worksheet, at least one rough area is determined in the worksheet, and at least one connected area formed by non-empty cells in each rough area is determined, and the connected areas are merged to form a target area. This enables accurate area segmentation of different tables in the worksheet, and facilitates subsequent accurate table structure recognition of cell sequences in different table areas.

[0147] In one embodiment, Figure 4 As shown, in the above step 104, according to the characteristic data corresponding to the target cell sequence in at least one cell sequence, the table structure recognition of the target cell sequence may include the steps of:

[0148] 401: Determine content text feature data of the target cell sequence and feature values ​​of multiple target features from feature data corresponding to the target cell sequence; the feature values ​​of the target features include target continuous feature values;

[0149] 402: Processing the target continuous feature value of each target feature into a corresponding target discrete feature value;

[0150] 403: Generate a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and the target discrete feature values ​​of multiple target features;

[0151] 404: Input the combined feature vector corresponding to the target cell sequence into the trained table structure recognition model for processing to obtain a table structure recognition result; wherein the table structure recognition result is used to determine whether the table structure information of the target cell sequence is a title, a header, a content area or other types of data.

[0152] Here, the content text feature data of the target cell sequence includes: content text feature data of at least one cell in the target cell sequence. The content text feature data of a cell is feature data corresponding to the content text filled in the cell.

[0153] In some examples, the content text filled in the cell can be content text of various data types, such as but not limited to: text type, number type or date type content text. It can be understood that a cell has only one data type.

[0154] In some examples, the content text feature data of the target cell sequence may include a content text combination of the target cell sequence. Here, the content text combination of the target cell sequence may be obtained by splicing the content texts of each cell in the target cell sequence in the order of cell positions.

[0155] Here, the target feature is a feature that affects the table structure recognition result.

[0156] In some examples, the target feature is a feature selected from multiple candidate features according to a preset feature selection rule. For example, the preset feature selection rule may include: selecting the target feature from multiple candidate features based on prior knowledge; or, ranking the feature importance of multiple candidate features based on a preset model, selecting the feature ranked in the top N positions as the target feature.

[0157] In some examples, the target features of the target cell sequence may include at least one of the following: the proportion of non-empty cells in the target cell sequence that are numbers, the number of non-empty cells, the proportion of "" symbols in non-empty cells, whether the target cell sequence is consistent in length with the previous target cell sequence, row labels or column labels, the number of "" symbols in non-empty cells, the proportion of horizontal cell merging, whether the target cell sequence has upper and lower borders, the number of horizontally centered non-empty cells, the proportion of non-empty cells that are bold, the number of cells in the previous target cell sequence, the number of non-empty cells that are dates, the proportion of non-empty cells that are dates, the number of non-empty cells that are numbers, the number of non-empty cells, whether the target cell sequence contains decimal cells, the number of horizontally merged cells, and the first cell of the target cell sequence The number of cells with content, the number of non-empty cells horizontally on the left and right, whether the last cell is empty, the number of non-empty cells that are formulas, the horizontal center ratio of non-empty cells, the number of bold non-empty cells, the number of cells, the horizontal left and right ratio of non-empty cells, the height or width of the target cell sequence, the average font size of non-empty cells, whether the first cell is empty, the number of empty cells, the ratio of non-empty cells that are formulas, the average character length of non-empty cell content, the average column subscript of non-empty cells, whether the target cell sequence has a diagonal border, the minimum font size of non-empty cells, the maximum font size of non-empty cells, the ratio of empty cells, the variance of non-empty cell font size, whether the target cell sequence is an integer, the maximum character length of non-empty cell content, and the variance of non-empty cell content character length.

[0158] Among the feature data of the target cell sequence, except for the content text feature data which is non-quantitative data, the rest of the feature data can be quantified. The value of each feature is continuous quantitative data, and its features cannot be directly learned in the neural network. It is necessary to discretize the target continuous feature value to obtain the corresponding target discrete feature value.

[0159] When the eigenvalue of the target feature is a continuous eigenvalue, the target feature belongs to a continuous feature, and the continuous eigenvalue can be any value within a certain interval, that is, the number of continuous eigenvalues ​​of the target feature may be infinite.

[0160] For example, the number of cells, the number of non-empty cells, and the number of bold non-empty cells are all continuous features.

[0161] In some examples, the target discrete eigenvalue corresponding to the target continuous eigenvalue may be a value after the target continuous eigenvalue is divided into intervals or groups.

[0162] In this embodiment, by processing the continuous feature values ​​of the target feature into corresponding target discrete feature values, the feature information can be presented more concisely, and the influence of outliers can be effectively reduced, which is conducive to improving the table structure recognition effect.

[0163] In some examples, in the above step 403, generating a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and the target discrete feature values ​​of multiple target features may include the following steps:

[0164] Encode the content text feature data of the target cell sequence to obtain a first feature vector;

[0165] encoding target discrete feature values ​​of a plurality of target features of the target cell sequence to obtain a second feature vector;

[0166] The first eigenvector and the second eigenvector are concatenated into a combined eigenvector corresponding to the target cell sequence.

[0167] In some examples, one-hot encoding may be performed on the content text feature data of the target cell sequence to obtain a first feature vector.

[0168] In some examples, target discrete feature values ​​of multiple target features of the target cell sequence may be one-hot encoded or mapped encoded to obtain a second feature vector.

[0169] In some examples, the second feature vector may be concatenated to the head or tail of the first feature vector to obtain a combined feature vector corresponding to the target cell sequence.

[0170] In some examples, the table structure recognition model can be trained based on the combined feature vectors and sample labels corresponding to the sample cell sequences.

[0171] Here, the training process of the table structure recognition model can refer to the relevant instructions in the following text and will not be described in detail here.

[0172] In some examples, the table structure recognition model may be a lightweight neural network model.

[0173] In some examples, the table structure recognition model can be constructed based on a deep neural network (Deep Neural Networks, DNN), and the deep neural network can be, for example, a text neural network (TextDNN). It can be understood that the table structure recognition model can also be constructed based on other neural networks, and this embodiment does not specifically limit this.

[0174] In this embodiment, by encoding the content text feature data and the target discrete feature values ​​of the target feature respectively, the content text feature data and the target discrete feature values ​​of the target feature can be converted into vector forms respectively, and spliced ​​to generate a combined feature vector corresponding to the target cell sequence, so that more feature information can be used for table structure recognition, thereby further improving the table structure recognition effect.

[0175] In one embodiment, Figure 5 As shown, before step 104 is performed, the method may further include:

[0176] 501: Obtain sample feature data corresponding to a plurality of sample cell sequences respectively; wherein the sample cell sequence is a cell sequence in a target area of ​​a sample worksheet;

[0177] 502: Filter multiple target features from multiple candidate features according to candidate feature data other than content text feature data in the sample feature data; wherein the number of candidate features is greater than the number of target features.

[0178] Here, the sample cell sequence is a cell sequence in a target area of ​​the sample worksheet. The target area in the sample worksheet is obtained by segmenting the sample worksheet according to the attribute information of multiple cells of the sample worksheet.

[0179] Here, for each sample cell sequence, the sample feature data corresponding to the sample cell sequence is obtained according to the attribute information of multiple cells included in the sample cell sequence.

[0180] In the above step 501, the process of obtaining the sample characteristic data corresponding to the sample cell sequence can refer to the relevant description of steps 101 to 103 in the above embodiment, which will not be repeated here.

[0181] Here, the candidate feature data includes feature data corresponding to each candidate feature, and the feature data corresponding to the candidate feature may be structural feature data different from content text features.

[0182] In the above step 502, a preset model can be used to rank multiple candidate features by feature importance based on candidate feature data other than content text feature data in the sample feature data, and select features ranked in the top N by feature importance as target features; or, a correlation coefficient matrix between candidate features can be determined based on candidate feature data other than content text feature data in the sample feature data, and based on the correlation coefficient matrix, candidate features with low correlation between features can be selected as target features.

[0183] In this embodiment, by using the sample feature data corresponding to the sample cell sequence, target features that have an impact on table structure recognition are selected from a large number of candidate features, which can reduce the amount of calculation for table structure recognition and help improve the table structure recognition effect.

[0184] In one embodiment, Figure 6 As shown, in the above step 502, based on the candidate feature data other than the content text feature data in the sample feature data, screening multiple target features from multiple candidate features may include the following steps:

[0185] 601: sorting the candidate feature data by feature importance through a decision tree model to obtain a feature sorting result;

[0186] 602: Filter multiple target features from multiple candidate features according to the feature sorting result.

[0187] In the above step 601, the candidate feature data of the plurality of candidate features may be input into the decision tree model to perform feature importance ranking, and the feature ranking result is obtained.

[0188] In this embodiment, an XGBoost (eXtreme Gradient Boosting) decision tree model may be used to rank the importance of different features to obtain a feature ranking result, which may be used to determine the influence of each candidate feature on the table structure recognition result.

[0189] The importance of a feature is represented by the sum of the number of times the feature appears in all trees. The higher the importance of a feature is ranked, the greater the impact of the feature on the table structure recognition results.

[0190] Exemplarily, each candidate feature can be traversed, and the currently traversed candidate feature is used as a segmentation feature, that is, different candidate feature data of the currently traversed candidate feature are used as the root node of the tree, and multiple subtrees are generated. The leaf nodes in each subtree are selected from other candidate features, wherein the Gini coefficient can be used to obtain the segmentation feature and the segmentation point, so as to determine the optimal feature and the optimal segmentation point as the leaf node.

[0191] In the above step 602, the candidate features ranked in the top N positions in the feature ranking result can be respectively determined as target features, where N is a preset value, for example, N is 20 or 30 or other values.

[0192] In this embodiment, the candidate feature data are sorted by feature importance through a decision tree model, and multiple target features with high importance are screened out using the feature sorting results. This can effectively exclude features that have little effect on the table structure recognition results, which is beneficial to improving the efficiency and accuracy of table structure recognition.

[0193] In one embodiment, in the above step 402, processing the target continuous feature value of each target feature into a corresponding target discrete feature value may include the following steps:

[0194] For each target feature, among the multiple binning intervals corresponding to the target feature, determine the target binning interval to which the target continuous eigenvalue of the target feature belongs to obtain the target discrete eigenvalue of the target feature; wherein different binning intervals correspond to different discrete eigenvalues.

[0195] In this embodiment, the target continuous feature value of the target feature can be matched with multiple binning intervals corresponding to the target feature to determine the target binning interval to which the target continuous feature value belongs; and the discrete value corresponding to the target binning interval is determined as the target discrete feature value of the target feature.

[0196] For example, taking the target cell sequence as a cell row, if the target feature of the cell row is the number of bold non-empty cells, the multiple binning intervals corresponding to the bold number of non-empty cells are [0, 10), [11, 20], and greater than 20, and the corresponding discrete values ​​are 1, 2, and 3. According to the target continuous feature value of the bold number of non-empty cells being 15, the target binning interval to which the target continuous feature value belongs is determined to be [11, 20], and then the target discrete feature value is determined to be 2.

[0197] In one embodiment, the method may further include:

[0198] According to the preset number of bins and the sample continuous characteristic value of the target feature in the sample characteristic data, the target feature is binned to obtain multiple bin intervals corresponding to the target feature; different bin intervals correspond to different discrete characteristic values ​​of the target feature.

[0199] In some examples, an unsupervised bucketing method or a supervised bucketing method may be used for binning. For example, the unsupervised bucketing method may be equal frequency bucketing, equal distance bucketing, cluster bucketing, etc.; the supervised bucketing method may be best-ks (Kolmogorov-Smirnov) bucketing, chi-square bucketing, or decision tree bucketing, etc.

[0200] In some examples, a CART decision tree may be used to bin each target continuous feature value to obtain multiple binning intervals corresponding to each target feature.

[0201] In some examples, binning processing may include: determining at least one split point, wherein the split point is used to divide the continuous feature values ​​of the target feature into two sample subsets; for each split point, determining the Gini index of the two sample subsets; and determining multiple binning intervals corresponding to the target feature based on a preset number of bins and the Gini index corresponding to each split point.

[0202] Figure 7 A flow chart of a table structure recognition model training method provided by an embodiment of the present disclosure is shown. Figure 7 As shown, the method may include the following steps:

[0203] 701: Obtain a sample set, wherein each sample in the sample set includes: sample feature data corresponding to the sample cell sequence and a sample label; wherein the sample label is used to indicate whether the table structure information of the sample cell sequence is a title, a header, a content area or other types;

[0204] 702: Obtain a combined feature vector corresponding to the sample cell sequence according to the sample feature data corresponding to the sample cell sequence;

[0205] 703: Train the table structure recognition model according to the combined feature vector corresponding to the sample cell sequence and the sample label to obtain a trained table structure recognition model.

[0206] In some examples, the table structure recognition model may be a lightweight neural network model.

[0207] In some examples, the table structure recognition model can be constructed based on a deep neural network, and the deep neural network can be, for example, a text neural network. It can be understood that the table structure recognition model can also be constructed based on other neural networks, and this embodiment does not specifically limit this.

[0208] In some examples, the sample labels corresponding to the sample cell sequence can be pre-labeled. For example, taking the sample cell sequence as row cells as an example, the labeling criteria can be: label the rows corresponding to other types of data as 0, the rows corresponding to the title data as 1, the rows corresponding to the content area data as 2, and the rows corresponding to the header data as 3.

[0209] In some examples, the implementation process of step 701 may include:

[0210] 701a: Obtaining attribute information of multiple cells of a sample worksheet;

[0211] 701b: performing region segmentation on the sample worksheet according to attribute information of multiple cells in the sample worksheet to obtain at least one target region in the sample worksheet; wherein different target regions belong to different tables in the sample worksheet;

[0212] 701c: For each target area in the sample worksheet, obtain sample feature data corresponding to each sample cell sequence according to attribute information of multiple cells included in at least one sample cell sequence of the target area.

[0213] Specifically, the implementation process of the above steps 701a to 701c can refer to the relevant description content of steps 101 to 103 in the above embodiments, which will not be repeated here.

[0214] In some examples, the implementation process of step 702 may include:

[0215] 702a: for each sample cell sequence, determine content text feature data of the sample cell sequence and feature values ​​of multiple target features from sample feature data corresponding to the sample cell sequence; the feature values ​​of the target features include target continuous feature values;

[0216] 702b: Processing the target continuous feature value of each target feature of the sample cell sequence into a corresponding target discrete feature value;

[0217] 702c: Generate a combined feature vector corresponding to the sample cell sequence based on the content text feature data of the sample cell sequence and the target discrete feature values ​​of multiple target features

[0218] Specifically, the implementation process of the above steps 702a to 702c can refer to the relevant description content of steps 401 to 403 in the above embodiments, which will not be repeated here.

[0219] In the above step 703, the combined feature vector corresponding to each sample cell sequence can be input into the table structure recognition model for prediction to obtain a prediction result; according to the loss value between the prediction result of the sample cell sequence and the corresponding sample label, the table structure recognition model is iteratively trained until the training stop condition is reached, thereby obtaining a trained table structure recognition model.

[0220] In some examples, the training stop condition may be, for example: the loss value of the current round of iterative training is less than a preset threshold, the number of iterative training rounds reaches a preset number of iterative rounds, or the difference between the loss value of the current round of iterative training and the loss value of the previous round of iterative training is less than a preset difference.

[0221] In some examples, during the training of the model, the learning rate of the model can be adjusted in real time according to the learning rate adjustment strategy, and the early stopping strategy processing can be performed at the same time. The early stopping strategy processing calculates the performance of the model on the validation set during training, and stops training when the performance of the model on the validation set begins to decline, which can avoid the problem of overfitting caused by continued training.

[0222] In the disclosed embodiment, a combined feature vector is obtained by utilizing sample feature data corresponding to a sample cell sequence, and a table structure recognition model is trained based on the combined feature vector corresponding to the sample cell sequence and the sample label. The trained table structure recognition model can be used to predict whether the table structure information of the sample cell sequence is a title, header, content area or other type. This can improve the generalization ability of the table structure recognition model, and can distinguish the table structure of each table when there are multiple tables in a worksheet. In addition, it can also be applied to table structure recognition in complex scenarios (such as when there is annotation data in the area).

[0223] It should be noted that those skilled in the art can understand that the method provided in the embodiments of the present disclosure can be executed alone or together with some methods in the embodiments of the present disclosure or some methods in related technologies.

[0224] In order to further explain any embodiments of the present disclosure, some specific embodiments are provided below.

[0225] The disclosed embodiment provides a table structure recognition method, which can recognize table data in Excel, distinguish related information such as title, header, content, etc. in a table, and can distinguish the data of each table when there are multiple tables in a sheet page.

[0226] The table structure recognition method provided by the embodiment of the present disclosure mainly includes two stages: offline model training and online model prediction. Among them, table annotation and sample construction are required before model training.

[0227] Table annotation: Table styles are divided into vertical table styles and horizontal table styles. Taking the vertical table style as an example, the type of each row of the table is defined according to the general table properties. The possible types are: other types of data (for example, invalid data, narration or annotation data), title, content area, and header. The annotation data is obtained by annotating the title, header, content area and other types of data in the table in Excel. Each row is a sample. For example, the annotation criteria can be: mark the row corresponding to other types of data as 0, the row corresponding to the title data as 1, the row corresponding to the content area data as 2, and the row corresponding to the header data as 3.

[0228] Construct samples: Combine the content, font size, upper and lower lines, horizontal and vertical merges, and other features of each cell on each row in a table. The combined data features of this row correspond to a sample, and the sample is modeled into four categories: title, header, content area, and other categories.

[0229] Next, a table with a vertical table style is taken as an example to illustrate the method provided by the present disclosure.

[0230] like Figure 8a As shown, the embodiment of the present disclosure provides a table structure recognition method, which may include the following steps:

[0231] 1. Input the form sample.

[0232] Input the form sample through the storage path of the form sample or the selection operation for the form sample.

[0233] 2. Determine whether the form sample is valid.

[0234] In some examples, when the form sample is determined to be invalid, the process ends.

[0235] 3. When judging that the form sample is valid, perform XML data parsing on the form sample.

[0236] In Excel 2007 / 2010 and above, the storage structure of table data is modified. The Excel file suffix is ​​.xlsx, and x represents that the core structure of the file is an XML type structure. That is, a file in the xlsx format is essentially a compressed file, and the XML type storage method makes it occupy less space.

[0237] The XML format data is obtained by decompressing the table sample in the xlsx format, and the relevant attribute information on the cells of the XML format data is extracted and combined. The extracted cell information can be shown in Table 1.

[0238] If the file format of the table sample is et format (table document file format of word processing system) or xls format, etc., you need to save the file format of the table sample as xlsx format, and then decompress it to obtain XML format data.

[0239] Table 1: Cell information

[0240]

[0241]

[0242] 4. Perform regional segmentation on the table sample.

[0243] For multiple tables, a seed fill algorithm can be used to segment the sample area.

[0244] Specifically, the approximate area of ​​the table can be determined based on whether the information of the extracted cell is a null value. According to the characteristics of the constructed table, a specific row number threshold is selected to identify the column range limit of the table. Then, the region is segmented according to the connected region recognition algorithm. Finally, the segmented regions are merged according to the table writing characteristics, and the number of tables and their corresponding area ranges are finally output.

[0245] 5. Extract row features of the segmented table samples by region.

[0246] The data of each row of the table is used as a feature for analysis. Each row of cells is composed of multiple cells, and multiple available features can be obtained. The features may include but are not limited to: the row label of the current row, the content text combination of the current row, the row height of the current row, the average font size of non-empty cells in the current row, the number of formulas in non-empty cells in the current row, the number of dates in non-empty cells in the current row, the number of numbers in non-empty cells in the current row, the number of bold non-empty cells in the current row, whether the current row has a diagonal border, whether the current row has upper and lower borders, the number of horizontally merged cells in the current row, the number of cells in the previous row, the proportion of non-empty cells in the current row, whether the current row is consistent with the cells in the previous row in terms of valid cells and corresponding positions, etc.

[0247] Based on the above multiple features, feature extraction is performed on each row of the table. Except for the content text which is non-quantitative data, the other features can be quantified. Due to the large number of features, it is more complicated to directly combine all features with text features. In order to utilize the combination of effective features and content text features with higher quality, the XGBoost algorithm can be used to screen other features before feature combination.

[0248] The input sample of XGBoost is the combination of all features of each row of cells except the content text. Since these features are quantifiable, XGBoost can be directly used for modeling analysis. The original samples are divided into training sets and test sets. An XGBoost model is obtained through the training set, and the relationship between features is analyzed using the test set.

[0249] XGBoost calculates which feature to choose as the split point based on the gain of the structure score, and the importance of a feature is the sum of the number of times it appears in all trees. That is, the more a feature is used to build decision trees in the model, the higher the importance of the feature. You can refer to the importance ranking diagram of each feature. Figure 8b shown.

[0250] like Figure 8b As shown, the importance of each feature is ranked from high to low as follows:

[0251] The non-empty cells of the current row are digital ratios (textDiaRatio);

[0252] The number of non-empty cells in the current row (curRowNotEmpSum);

[0253] Symbol in non-empty cells of the current row:"Ratio(textConMarkRatio);

[0254] Whether the length of the current row is the same as that of the previous row (curRowAndPreRowIsSimilar);

[0255] The row label of the current row (row);

[0256] The number of symbols ":" in non-empty cells of the current row (textConMarkSum);

[0257] The horizontal merging ratio of cells in the current row (cellHoritalRatio);

[0258] Whether the current row has top and bottom borders (isTopAndBottomBorder);

[0259] The number of non-empty cells in the current row that are horizontally centered (textCenterSum);

[0260] The non-empty cells in the current row are bolded in proportion (textBoldRatio);

[0261] The number of cells in the previous row (preRowCellSum);

[0262] The number of non-empty cells in the current row that are dates (textDateSum);

[0263] The non-empty cells in the current row are date ratios (textDateRatio);

[0264] The number of non-empty cells in the current row that are numbers (textDiaSum);

[0265] The number of non-empty cells in the current row (curRowNotEmpSum);

[0266] Whether the current row contains decimal cells (textIsConPointData);

[0267] The number of horizontally merged cells in the current row (cellHoritalSum);

[0268] The first cell from the left of the current row has content (curRowSingleCellOnStartLeft);

[0269] The horizontal left and right number of non-empty cells in the current row (textLeftOrRightSum);

[0270] Whether the last cell of the current row is empty (curEndCellIsEmp);

[0271] The number of non-empty cells in the current row that are formulas (textFormulaSum);

[0272] The horizontal center ratio of non-empty cells in the current row (textCenterRatio);

[0273] The number of non-empty cells in the current row that are bolded (textBoldSum);

[0274] The number of cells in the current row (curRowCellSum);

[0275] The horizontal left-right ratio of non-empty cells in the current row (textLeftOrRightRatio);

[0276] The row height of the current row (rowHeight);

[0277] The average font size of non-empty cells in the current row (textSizeMean);

[0278] Whether the first cell of the current row is empty (curStartCellIsEmp);

[0279] The number of empty cells in the current row (textIsEmpCellSum);

[0280] The non-empty cells in the current row are formula ratios (textFormulaRatio);

[0281] The average character length of non-empty cell contents in the current row (textLenMean);

[0282] The column subscript mean of the non-empty cells in the current row (curCellColMean);

[0283] Whether the current row has a diagonal border (isDiagonalBorder);

[0284] The minimum font size of non-empty cells in the current row (textSizeMin);

[0285] The maximum font size of non-empty cells in the current row (textSizeMax);

[0286] The empty cell ratio of the current row (textIsEmpCellRatio);

[0287] The variance of the font size of non-empty cells in the current row (textSizeVar);

[0288] Whether the current line contains an integer (textIsConIntData);

[0289] The maximum character length of the non-empty cell content in the current row (textLenMax);

[0290] The character length variance of the non-empty cell contents in the current row (textLenVar).

[0291] XGBoost uses information gain to split decision trees. In the process of splitting, it is necessary to find a suitable split point, which can separate the samples well. Specifically, it can include:

[0292] a. Enumerate all available features for each leaf node;.

[0293] b. For each feature, the training samples belonging to the node are sorted in ascending order according to the feature value, the best split point of the feature is determined by linear scanning, and the splitting benefit of the feature is recorded;

[0294] c. Select the feature with the largest benefit as the split feature, use the best split point of the feature as the split position, split the node into two new leaf nodes on the left and right, and associate the corresponding sample set for each new node;

[0295] d. Return to step a and execute recursively until a specific condition is met.

[0296] In the above XGBoost modeling process, the value of each feature is continuous quantitative data. Its features cannot be directly learned in the neural network. The continuous value should be discretized. Discretization requires dividing it into specific areas to make it convenient to store, easy to expand, and robust, and make the model effect more stable. This processing method is called bucketing operation.

[0297] Bucketing methods are divided into unsupervised bucketing and supervised bucketing. Unsupervised bucketing methods include equal-frequency bucketing, equal-distance bucketing, and cluster bucketing; supervised bucketing methods include best-ks bucketing, chi-square bucketing, and decision tree bucketing.

[0298] In this embodiment, the decision tree bucketing method in the supervised bucketing can be used to determine the best split point according to the classification and regression tree (CART). The processing method is: sort all the values ​​of the feature from small to large; take the mean between the two; traverse all these means; take the point with the smallest Gini coefficient as the threshold to divide the data set, and iterate according to the number of buckets.

[0299] Discrete artificial features are obtained through binning, and finally the artificial features of each row of cells and the content text feature data are encoded, transformed and combined to obtain a combined feature vector.

[0300] 6. Model training.

[0301] The combined feature vectors of each row of cells and the labeled data are used to train the model, optimize the model and adjust the parameters to obtain the final table structured recognition model. The model structure can be found in Figure 8c shown.

[0302] like Figure 8c As shown, the table structured recognition model includes an input layer, a hidden layer and an output layer.

[0303] The input layer is used to input the combined feature vector of each row of cells. In the combined feature vector of each row of cells, [SEP] represents the separator between the feature vectors in the combined feature vector of the row of cells. C represents the content text feature vector in the combined feature vector of the row of cells; R represents the artificial feature vector in the combined feature vector of the row of cells.

[0304] The hidden layer is the middle layer in the model network, located between the input layer and the output layer, and is used to process the data input by the input layer. There can be multiple hidden layers, and the output of each hidden layer serves as the input of the next hidden layer or output layer.

[0305] The output layer is used to calculate the data passed in by the hidden layer and output the table structure recognition result. The table structure recognition result corresponding to any row of cells is used to determine whether the table structure information corresponding to the row of cells is a title, header, content area or other types of data.

[0306] In some examples, the table structured recognition model can be a text deep neural network (TextDNN) model.

[0307] The learning rate during model training can be adjusted in real time according to the learning rate scheduler strategy; at the same time, the early stopping strategy is used to avoid overfitting of the model due to long training time. During round training, if the loss value in a round no longer decreases at a specific threshold (for example, the specific threshold is set to 10), the model training is stopped and the final model is obtained to complete the structured recognition task of the table.

[0308] After training, the model has a high accuracy rate in the table structure recognition task of a single-row test sample (the overall accuracy rate can reach 97.78%), and can also support the style recognition of multiple tables on a single page.

[0309] 7. Model prediction.

[0310] Execute the above steps 1 to 5 on the worksheet to be identified, obtain the combined feature vector of multiple rows of cells in a single table in the worksheet to be identified, and use the trained table structure recognition model to process the combined feature vector of each row of cells separately to obtain the table structure recognition result of each row of cells. The table structure recognition result of any row of cells is used to determine whether the table structure information corresponding to the row of cells is a title, header, content area or other type of data.

[0311] 8. Post-processing of results.

[0312] Post-processing of the results can be to use a recall strategy to recall the row types that were misidentified by the model.

[0313] Specifically, the result post-processing may be performed based on the consistency of the data types of the corresponding upper and lower positions.

[0314] Considering that there is a lot of empty data on a certain row, such as a row with only serial numbers, under normal circumstances, the row is identified as the content area. However, due to the small amount of data, the model may identify it as something else. In this case, it needs to be recalled based on post-processing (rules) to make up for the model's recognition defects in this type of data.

[0315] For example, suppose that the table structure of the cells in the first row of a table is a title, and the table structures of the second to 21st rows are all content areas. If the table structure recognition model's recognition results for the table structure of rows 1 to 19 of the table are correct, but the table structure recognition results for rows 20 to 21 of the table are wrong, for example, the table structure of rows 20 to 21 is mistakenly recognized as other types, which may be due to the fact that there are too few valid data in these two rows, making it difficult for the table structure recognition model to recognize them, resulting in recognition errors. In this case, post-processing can be used for recall. The upper and lower cells in the recall strategy are of the same type of data, such as A20 and A19 are continuous numbers, and A21 and A20 are continuous numbers, then they should be of the same type as the previous row. When row A19 is recognized as a content area, rows A20 and A21 can be corrected to content areas in turn to supplement the model's recognition defects in this type of data.

[0316] 9. Output the structure recognition results of the table sample.

[0317] The structure recognition result of the table sample can be output as table content, or the structure recognition result can be output as json data.

[0318] In summary, the table structure recognition method provided by the embodiment of the present disclosure can perform area recognition on multiple tables in a sheet page, and perform table structure recognition separately; in addition, the table structure recognition model can be lightweight and have low latency; in addition, the recognized table structure can be used for in-depth data analysis of subsequent table understanding tasks.

[0319] Fig. 9 A schematic diagram of a table structure recognition device provided by an embodiment of the present disclosure is shown. Fig. 9 As shown, the table structure recognition device 100 may include:

[0320] A first acquisition module 110 is used to acquire attribute information of a plurality of cells of a worksheet to be identified;

[0321] The segmentation module 120 is used to segment the worksheet into regions according to the attribute information of the plurality of cells in the worksheet, so as to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet;

[0322] A second acquisition module 130 is used to acquire, for each of the target areas, feature data corresponding to each of the cell sequences according to attribute information of a plurality of cells included in at least one cell sequence in the target area;

[0323] The identification module 140 is used to perform table structure identification on the target cell sequence according to feature data corresponding to the target cell sequence in at least one of the cell sequences.

[0324] In one embodiment, the data of the worksheet is stored in an extensible markup language XML format; the first acquisition module 110 is used to:

[0325] Obtain XML format data corresponding to the worksheet;

[0326] determining a plurality of cells from the worksheet;

[0327] For each of the cells, the attribute information of the cell is extracted from the multiple attribute information contained in the XML format data; wherein the attribute information of the cell includes attribute values ​​of one or more attributes.

[0328] In one embodiment, the segmentation module 120 is used to:

[0329] Determine at least one rough area in the worksheet according to the attribute information of a plurality of cells in the worksheet; wherein the rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in the rough area is less than a preset threshold;

[0330] Determine at least one connected region formed by non-empty cells in each of the rough regions;

[0331] For each of the rough regions, connected regions within the rough region are merged to form the target region.

[0332] In one embodiment, the identification module 140 includes:

[0333] A determination unit, used to determine the content text feature data of the target cell sequence and feature values ​​of multiple target features from the feature data corresponding to the target cell sequence; the feature values ​​of the target features include target continuous feature values;

[0334] A processing unit, used for processing a target continuous feature value of each target feature into a corresponding target discrete feature value;

[0335] A generating unit, configured to generate a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and target discrete feature values ​​of a plurality of target features;

[0336] The recognition unit is used to input the combined feature vector corresponding to the target cell sequence into the trained table structure recognition model for processing to obtain a table structure recognition result; wherein the table structure recognition result is used to determine whether the table structure information of the target cell sequence is a title, a header, a content area or other types of data.

[0337] In one embodiment, the apparatus further comprises:

[0338] A third acquisition module is used to acquire sample feature data corresponding to a plurality of sample cell sequences respectively; wherein the sample cell sequence is a cell sequence in a target area of ​​a sample worksheet;

[0339] The screening module is used to screen multiple target features from multiple candidate features according to the candidate feature data other than the content text feature data in the sample feature data; wherein the number of the candidate features is greater than the number of the target features.

[0340] In one embodiment, the screening module is used to:

[0341] Sorting the candidate feature data by feature importance using a decision tree model to obtain a feature ranking result;

[0342] According to the feature sorting result, a plurality of target features are screened from a plurality of candidate features.

[0343] In one embodiment, the apparatus further comprises:

[0344] A binning module is used to bin the target feature according to a preset number of bins and the sample continuous characteristic value of the target feature in the sample characteristic data to obtain multiple binning intervals corresponding to the target feature; wherein different binning intervals correspond to different discrete characteristic values.

[0345] In one embodiment, the processing unit is configured to:

[0346] For each of the target features, a target binning interval to which a target continuous feature value of the target feature belongs is determined among a plurality of binning intervals corresponding to the target feature, so as to obtain a target discrete feature value of the target feature.

[0347] In one embodiment, the apparatus further comprises a training module, wherein the training module is configured to:

[0348] Acquire a sample set, wherein each sample in the sample set includes: sample feature data corresponding to a sample cell sequence and a sample label; the sample label is used to characterize whether the table structure information of the sample cell sequence is a title, a header, a content area or other types;

[0349] According to the sample feature data corresponding to the sample cell sequence, obtaining a combined feature vector corresponding to the sample cell sequence;

[0350] The table structure recognition model is trained according to the combined feature vector corresponding to the sample cell sequence and the sample label to obtain the trained table structure recognition model.

[0351] Regarding the table structure recognition device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the corresponding method embodiment, and will not be elaborated here.

[0352] In one embodiment, a table structure recognition model training device is provided, the device comprising a training module, the training module being used to:

[0353] Acquire a sample set, wherein each sample in the sample set includes: sample feature data corresponding to a sample cell sequence and a sample label; wherein the sample label is used to characterize whether the table structure information of the sample cell sequence is a title, a header, a content area or other types;

[0354] According to the sample feature data respectively corresponding to the multiple sample cell sequences, obtaining the combined feature vectors respectively corresponding to the multiple sample cell sequences;

[0355] The table structure recognition model is trained according to the combined feature vector corresponding to the sample cell sequence and the sample label to obtain the trained table structure recognition model.

[0356] Regarding the table structure recognition device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the corresponding method embodiment, and will not be elaborated here.

[0357] An embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the table structure recognition method provided by any embodiment of the present disclosure is implemented.

[0358] The device may be, but is not limited to: a terminal and / or a server. The terminal may be, but is not limited to, a mobile phone, a tablet computer, a computer, a wearable device, etc.; the server may be various types of servers; for example, the server may be, but is not limited to, a cloud server or a local server, etc.

[0359] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.

[0360] The processor may be connected to the memory via a bus or the like, and is used to read an executable program stored in the memory, for example, to implement the table structure recognition method provided by any embodiment of the present disclosure.

[0361] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores an executable program. When the executable program is executed by a processor, the table structure recognition method provided by any embodiment of the present disclosure is implemented.

[0362] Fig.10 A block diagram of an electronic device 800 is shown according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a table structure identifier, a computer, a tablet device, a personal digital assistant, etc. Fig.10 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0363] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0364] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0365] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0366] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0367] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0368] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0369] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0370] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0371] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0372] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0373] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.

[0374] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A table structure recognition method, characterized in that: The method comprises: Obtaining attribute information of multiple cells of the worksheet to be identified; According to the attribute information of a plurality of cells in the worksheet, the worksheet is segmented into regions to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet; For each of the target areas, acquiring feature data corresponding to each of the cell sequences according to attribute information of a plurality of cells included in at least one cell sequence in the target area; According to the characteristic data corresponding to the target cell sequence in at least one of the cell sequences, the table structure of the target cell sequence is identified.

2. The method according to claim 1, characterized in that: The data of the worksheet is stored in an extensible markup language XML format; the acquiring of attribute information of a plurality of cells of the worksheet to be identified includes: Obtain XML format data corresponding to the worksheet; determining a plurality of cells from the worksheet; For each of the cells, the attribute information of the cell is extracted from the multiple attribute information contained in the XML format data; wherein the attribute information of the cell includes attribute values ​​of one or more attributes.

3. The method according to claim 1 or 2, characterized in that: The step of segmenting the worksheet according to the attribute information of the plurality of cells in the worksheet to obtain at least one target area in the worksheet includes: Determine at least one rough area in the worksheet according to the attribute information of a plurality of cells in the worksheet; wherein the rough area includes at least one non-empty cell, and the number of consecutively arranged empty cell rows or empty cell columns in the rough area is less than a preset threshold; Determine at least one connected region formed by non-empty cells in each of the rough regions; For each of the rough regions, connected regions within the rough region are merged to form the target region.

4. The method according to claim 1, characterized in that: The step of performing table structure recognition on the target cell sequence according to the feature data corresponding to the target cell sequence in at least one of the cell sequences comprises: Determining content text feature data of the target cell sequence and feature values ​​of a plurality of target features from feature data corresponding to the target cell sequence; the feature values ​​of the target features include target continuous feature values; Processing the target continuous feature value of each target feature into a corresponding target discrete feature value; Generate a combined feature vector corresponding to the target cell sequence according to the content text feature data of the target cell sequence and the target discrete feature values ​​of the plurality of target features; The combined feature vector corresponding to the target cell sequence is input into the trained table structure recognition model for processing to obtain a table structure recognition result; wherein the table structure recognition result is used to determine whether the table structure information of the target cell sequence is a title, a header, a content area or other types of data.

5. The method according to claim 4, characterized in that Before the step of performing table structure recognition on the target cell sequence according to the feature data corresponding to the target cell sequence in at least one of the cell sequences, the method further comprises: Acquire sample feature data corresponding to a plurality of sample cell sequences respectively; wherein the sample cell sequence is a cell sequence in a target area of ​​a sample worksheet; According to the candidate feature data other than the content text feature data in the sample feature data, multiple target features are screened from multiple candidate features; wherein the number of the candidate features is greater than the number of the target features.

6. The method according to claim 5, characterized in that The step of screening multiple target features from multiple candidate features based on the candidate feature data other than the content text feature data in the sample feature data includes: Sorting the candidate feature data by feature importance using a decision tree model to obtain a feature ranking result; According to the feature sorting result, a plurality of target features are screened from a plurality of candidate features.

7. The method according to claim 5, characterized in that The method further comprises: According to the preset number of bins and the sample continuous characteristic value of the target feature in the sample characteristic data, the target feature is binned to obtain multiple bin intervals corresponding to the target feature; wherein different bin intervals correspond to different discrete characteristic values.

8. The method according to claim 7, characterized in that The step of processing the target continuous feature value of each target feature into a corresponding target discrete feature value includes: For each of the target features, a target binning interval to which a target continuous feature value of the target feature belongs is determined among a plurality of binning intervals corresponding to the target feature, so as to obtain a target discrete feature value of the target feature.

9. The method according to any one of claims 4 to 8, characterized in that: The training process of the table structure recognition model includes: Acquire a sample set, wherein each sample in the sample set includes: sample feature data corresponding to a sample cell sequence and a sample label; the sample label is used to characterize whether the table structure information of the sample cell sequence is a title, a header, a content area or other types; According to the sample feature data corresponding to the sample cell sequence, obtaining a combined feature vector corresponding to the sample cell sequence; The table structure recognition model is trained according to the combined feature vector corresponding to the sample cell sequence and the sample label to obtain the trained table structure recognition model.

10. A table structure recognition device, characterized in that: The device comprises: A first acquisition module is used to acquire attribute information of a plurality of cells of a worksheet to be identified; A segmentation module, used for performing region segmentation on the worksheet according to the attribute information of a plurality of cells of the worksheet, to obtain at least one target region in the worksheet; wherein different target regions belong to different tables in the worksheet; A second acquisition module is used to acquire, for each of the target areas, feature data corresponding to each of the cell sequences according to attribute information of a plurality of cells included in at least one cell sequence in the target area; The recognition module is used to perform table structure recognition on the target cell sequence according to the characteristic data corresponding to the target cell sequence in at least one of the cell sequences.

Citation Information

Cited By

  • Table structure identification method and system based on visual state space

    CN120412001A

  • A table structure recognition method and system based on visual state space

    CN120412001B