Recognition and calibration method, device, electronic device and readable storage medium

By obtaining the characteristics of merged row cells in the table and using the multi-level classification model to identify and correct the correction method, the problem of inaccurate row cell recognition in complex table structures is solved, and the accuracy of the recognition results is improved.

CN114065710BActive Publication Date: 2025-06-17ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111223231.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-06-17
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

When using classification models to identify table structure categories, the structural categories of some row cells in the more complex table structure are inaccurate, resulting in inaccurate recognition of the recognition results.

Method used

By obtaining the characteristics of the merged row cells in the table to be identified, the first classification model is used to obtain preliminary identification data, identify doubt-merged row cells, and obtain more accurate identification data based on their second characteristics and the second classification model, and then correct the structural category identification results of doubt-merged row cells.

Benefits of technology

The accuracy of the recognition results of the merged parallel cell structure category is improved, and the accuracy and reliability of the recognition results are enhanced by introducing the second feature and the second classification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065710B_ABST
    Figure CN114065710B_ABST
Patent Text Reader

Abstract

The present invention discloses an identification and correction method, device, electronic device and readable storage medium. The method includes: obtaining a first feature of a merge row cell to be identified in a table to be identified; obtaining first identification data according to the first feature and a first classification model; obtaining a suspicious merge row cell and its second feature according to the first identification data; obtaining second identification data according to the second feature and a second classification model; and correcting an identification result of a structural category of the suspicious merge row cell according to the second identification data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, and more particularly, to a method, apparatus, electronic device, and readable storage medium for identifying and correcting a table structure. Background Art

[0002] A spreadsheet consists of multiple rows. According to the content of each row in the table, the rows can be divided into different categories, such as: a big title, a row title, table content, and others. The category of each row is used as the structure category of that row, and the structure categories of all rows in the table can be used as the structure category of the table. Based on the structure category of the table, it is beneficial to generate data analysis of the table.

[0003] However, for some relatively complex table structures, there are still situations where the structure categories of some row cells are inaccurately identified. Because when using a classification model to determine the structure category of a row, in order to increase the accuracy of identifying the structure category, a binary classification model is used for each structure category. For example, the classification result of the big title model is a decimal between 0 and 1. The closer it is to 1, the more it indicates that the structure category of the corresponding row is a big title, and the closer it is to 0, the more it indicates that the structure category of the corresponding row is not a big title. This classification method may result in a row cell having similar scores for the big title, row title, content, and others, leading to an inaccurate identification result of the structure category of that row cell. Summary of the Invention

[0004] The present invention provides a new technical solution that can improve the accuracy of the identification result of the structure category of merged row cells in a table.

[0005] According to a first aspect of the present invention, there is provided a method for identifying and correcting a table structure, including:

[0006] Obtaining a first feature of a to-be-identified merged row cell in a to-be-identified table;

[0007] Obtaining first identification data according to the first feature and a first classification model;

[0008] Obtaining a suspicious merged row cell and its second feature according to the first identification data;

[0009] Obtaining second identification data according to the second feature and a second classification model;

[0010] Correcting the identification result of the structure category of the suspicious merged row cell according to the second identification data.

[0011] Optionally, the obtaining first identification data according to the first feature and a first classification model includes:

[0012] Obtain first identification data corresponding to the structural category of the merge row cell to be recognized according to the first feature and a first classification model corresponding to at least one structural category;

[0013] Wherein, the first classification model is a model for determining whether the merge row cell to be recognized belongs to its corresponding structural category.

[0014] Optionally, obtaining the suspicious merge row cells according to the first identification data includes:

[0015] Discriminate the merge row cell to be recognized with ambiguity as the suspicious merge row cell according to the first identification data.

[0016] Optionally, obtaining the suspicious merge row cells according to the first identification data includes:

[0017] Traverse the merge row cells to be recognized and obtain the total data of the first identification data of the traversed merge row cells;

[0018] Calculate the ratio of the first identification data of the traversed merge row cells to the total data and the standard deviation of the ratio;

[0019] Obtain the suspicious merge row cells according to the comparison result between the standard deviation of the traversed merge row cells and a preset threshold.

[0020] Optionally, obtaining the suspicious merge row cells according to the comparison result of the merge row cells to be recognized includes:

[0021] Take the merge row cells to be recognized with a standard deviation of the comparison result less than or equal to the threshold as the suspicious merge row cells.

[0022] Optionally, obtaining second identification data according to the second feature and a second classification model includes:

[0023] According to the second feature and the second classification model, obtain second identification data representing the structural category of the suspicious merge row cells;

[0024] Wherein, the second classification model is a model for determining the structural category to which the suspicious merge row cells belong.

[0025] Optionally, before obtaining the first feature of the merge row cells to be recognized in the table to be recognized, the method further includes:

[0026] Obtain the cell content of each cell in the table to be recognized;

[0027] Generate the feature information of at least one cell in the table to be recognized based on the cell content of each cell in the table to be recognized, where the feature information of the cell represents the structure category corresponding to the cell content of the cell;

[0028] Calculate the similarity between any two adjacent rows in the table to be recognized according to the feature information of the cells in the cell to be recognized;

[0029] Merge the two adjacent rows of cells whose similarity reaches the similarity threshold, and obtain the merged row cells to be recognized according to the merging result; wherein, the merged row cells to be recognized include at least one row of cells.

[0030] Optionally, the obtaining of the second feature of the suspicious merged row cells includes:

[0031] Determine the reference merged row cells corresponding to at least one structure category in the table to be recognized according to the first recognition data, where the reference merged row cells are the merged row cells to be recognized with no ambiguity in the recognition result of the structure category;

[0032] Generate a first feature list of at least one structure category according to the first features of the reference merged row cells of at least one structure category, and obtain the second feature of the suspicious merged row cells according to the first feature list.

[0033] Optionally, the second feature includes at least one of the following:

[0034] The first recognition data corresponding to at least one structure category of the suspicious merged row cells;

[0035] The number of rows of cells included in the suspicious merged row cells;

[0036] The number of first features with a similarity greater than a preset similarity threshold when the first feature of the suspicious merged row cells is compared with the first feature list of any structure category; wherein, the first feature list is a list composed of the first features of the merged row cells with no ambiguity in the structure category in the table to be recognized;

[0037] The structure category of the previous merged row cell of the suspicious merged row cells;

[0038] The structure category of the next merged row cell of the suspicious merged row cells;

[0039] The difference between the row number of the suspicious merged row cells and the row number of the previous blank merged row cell;

[0040] The difference between the row number of the suspicious merged row cells and the row number of the next blank merged row cell.

[0041] Optionally, the first feature includes at least one of the following:

[0042] The ratio of the number of merged cells in the merged row cells to be recognized to the number of the smallest cells in the merged row cells to be recognized;

[0043] A set of feature information of each cell in the merged row cells to be recognized;

[0044] The ratio of the number of the smallest cells with Chinese in the feature information of the merged row cells to be recognized to the number of the smallest cells with content in the merged row cells to be recognized.

[0045] Optionally, the feature information in the merged row cells to be recognized includes at least one of the following:

[0046] The ratio of the number of the smallest cells in the merged row cells to be recognized to the number of the smallest cells with content in the merged row cells to be recognized;

[0047] The number of colons in the content of the merged row cells to be recognized;

[0048] The ratio of the number of the smallest cells in the merged row cells to be recognized that are different from the feature information of the smallest cells in the merged row cell closest to the current merged row cell to the number of the smallest cells with content in the merged row cells to be recognized.

[0049] Optionally, obtaining the first recognition data according to the first feature and the first classification model includes:

[0050] Traverse each row of cells in the merged row cells to be recognized, and obtain the third recognition data of the currently traversed row according to the first feature of the currently traversed row and the first classification model corresponding to at least one structural category;

[0051] When the traversal ends, obtain the first recognition data of the merged row cells to be recognized according to the third recognition data of each row of cells in the merged row cells to be recognized.

[0052] According to a second aspect of the present disclosure, there is provided a recognition correction device for a table structure, including:

[0053] A first feature acquisition module, configured to acquire a first feature of the merged row cells to be recognized in the table to be recognized;

[0054] A first data acquisition module, configured to obtain first recognition data according to the first feature and the first classification model;

[0055] A second feature acquisition module, configured to acquire a suspicious merged row cell and its second feature according to the first recognition data;

[0056] A second data acquisition module, configured to acquire second recognition data according to the second feature and the second classification model;

[0057] A recognition result correction module, configured to correct the recognition result of the structural category of the suspicious merged row cell according to the second recognition data.

[0058] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0059] The device as described in the second aspect of the present disclosure; or,

[0060] A processor and a memory, where the memory is used to store instructions, and the instructions are used to control the processor to execute the method according to the first aspect of the present disclosure.

[0061] According to a fourth aspect of the present disclosure, there is provided a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method according to the first aspect of the present disclosure.

[0062] Through the embodiments of the present disclosure, according to the first feature and the first classification model of the merged row cell to be recognized, first recognition data is obtained, a suspicious merged row cell is obtained according to the first recognition data, second recognition data is obtained according to the second feature of the suspicious merged row cell and the second classification model, and then the recognition result of the structural category of the suspicious merged row cell is corrected according to the second recognition data. Since the second feature is more accurate than the first feature, and the context similarity relationship of the ambiguous merged row cell is introduced into the second feature, correcting the recognition result of the structural category of the suspicious merged row cell according to the second recognition data obtained according to the second feature can improve the accuracy of the recognition result of the structural category of the suspicious merged row cell.

[0063] Through the following detailed description of the exemplary embodiments of the present invention with reference to the accompanying drawings, other features and advantages of the present invention will become clear. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments of the present invention and, together with the description, are used to explain the principles of the present invention.

[0065] Figure 1 is a block diagram of an example of the hardware configuration of an electronic device that can be used to implement the embodiments of the present invention.

[0066] Figure 2 Shows a flowchart of a method for recognizing and correcting a table structure according to an embodiment of the present invention.

[0067] Figure 3 The block diagram of an identification correction device with a table structure according to an embodiment of the present invention is shown.

[0068] Figure 4 The block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed implementation manners

[0069] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present invention.

[0070] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way a limitation on the present invention or its application or use.

[0071] Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said technologies, methods, and devices should be regarded as part of the specification.

[0072] In all the examples shown and discussed herein, any specific values should be construed as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.

[0073] It should be noted that: similar reference numerals and letters denote similar items in the following drawings, and thus, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.

[0074] <Hardware configuration>

[0075] Figure 1 It is a schematic structural diagram of an electronic device that can be used to implement the embodiments of the present disclosure.

[0076] The electronic device 1000 may be a smart phone, a portable computer, a desktop computer, a tablet computer, a server, etc., and is not limited herein.

[0077] The electronic device 1000 may include, but is not limited to, a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so on. Among them, the processor 1100 may be a central processing unit CPU, a graphics processing unit GPU, a microprocessor MCU, etc., and is used to execute a computer program, which can be written in an instruction set such as x86, Arm, RISC, MIPS, SSE, etc. The memory 1200 includes, for example, ROM (read-only memory), RAM (random access memory), non-volatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1400 can perform wired communication using optical fibers or cables, or perform wireless communication. Specifically, it can include WiFi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, and the like. The display device 1500 is, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1600 can include, for example, a touch screen, a keyboard, a body sense input, and the like. The speaker 1700 is used to output an audio signal. The microphone 1800 is used to collect an audio signal.

[0078] Applied to the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store a computer program, and this computer program is used to control the processor 1100 to operate to implement the method according to the embodiments of the present disclosure. Those skilled in the art can design this computer program according to the solutions disclosed in the present disclosure. How this computer program controls the processor to operate is well known in the art, so it will not be described in detail here. The electronic device 1000 may be installed with an intelligent operating system (such as Windows, Linux, Android, IOS, etc.) and application software.

[0079] Those skilled in the art should understand that although Figure 1 multiple devices of the electronic device 1000 are shown, however, the electronic device 1000 in the embodiments of the present disclosure may only involve some of the devices, for example, only involve the processor 1100 and the memory 1200, etc.

[0080] Next, various embodiments and examples according to the present invention will be described with reference to the accompanying drawings.

[0081] <Method Embodiment>

[0082] In this embodiment, a method for identifying and correcting a table structure is provided. This method is implemented by an electronic device. The electronic device may be an electronic product having a processor and a memory. For example, it may be a desktop computer, a laptop computer, a mobile phone, a tablet computer, etc. In one example, the electronic device may be provided by the electronic device 1000 as Figure 1 shown.

[0083] Figure 2 A schematic flowchart of an identification and correction method for a table structure of an embodiment. As Figure 2 shown, the identification and correction method for the table structure of this embodiment includes the following steps S2100 to S2500:

[0084] Step S2100, obtain the first feature of the merge row cell to be recognized in the table to be recognized.

[0085] In this embodiment, the merge row cell to be recognized may include at least one row of cells.

[0086] In an embodiment of the present disclosure, the first feature may include at least one of the following:

[0087] The ratio of the number of merged cells in the merge row cell to be recognized to the number of the smallest cells in the merge row cell to be recognized;

[0088] The set of feature information of each cell in the merge row cell to be recognized;

[0089] The ratio of the number of the smallest cells with Chinese in the feature information of the merge row cell to be recognized to the number of the smallest cells with content in the merge row cell to be recognized.

[0090] Further, the feature information in the merge row cell to be recognized includes at least one of the following:

[0091] The ratio of the number of the smallest cells with numbers in the merge row cell to be recognized to the number of the smallest cells with content in the merge row cell to be recognized;

[0092] The number of colons in the content of the merge row cell to be recognized;

[0093] The ratio of the number of the smallest cells in the merge row cell to be recognized whose feature information is different from that of the smallest cells in the merge row closest to this merge row to the number of the smallest cells with content in the merge row cell to be recognized.

[0094] In this embodiment, a merged cell is a cell obtained by merging at least two smallest cells, and the smallest cell is a cell that cannot be split. It can be understood by those skilled in the art that each cell in the table to be recognized is either a merged cell or a smallest cell.

[0095] When calculating the ratio of the number of merged cells in the merged row cell to be recognized to the number of the smallest cells in the merged row cell to be recognized, those skilled in the art can understand that, if the merged row cell to be recognized includes at least two rows of cells, the first row has 1 merged cell and 4 smallest cells, where the merged cell is obtained by merging 2 smallest cells, then the first row has a total of 6 smallest cells, the second row has 2 merged cells and 2 smallest cells, where both of the merged cells are obtained by merging 2 smallest cells, then the second row also has a total of 6 smallest cells, and then the merged row cell to be recognized has a total of 3 merged cells and 12 smallest cells. Therefore, the ratio is 3 / 12.

[0096] When calculating the ratio of the number of the smallest cells with different characteristic information from the smallest cells in the merged row cell closest to the merged row cell to be recognized to the number of the smallest cells with content in the merged row cell to be recognized, those skilled in the art can understand that, assuming that the merged row cell to be recognized has a total of 5 smallest cells, and the characteristic information of each smallest cell in the merged row cell to be recognized is in the order of number, number, Chinese, English, and date from left to right. The merged row cell closest to the merged row cell to be recognized has two rows of cells to be recognized in the table, where the characteristic information of each smallest cell in the first row is in the order of number, number, English, English, and date from left to right, and the characteristic information of each smallest cell in the second row is in the order of number, number, English, English, and date from left to right. Only the characteristic information of the third cell in the merged row cell to be recognized is different from the corresponding cell in the merged row cell to be recognized. Therefore, the ratio of the number of the smallest cells with different characteristic information from the smallest cells in the merged row cell closest to this row to the number of the smallest cells with content in the merged row cell to be recognized is 1 / 5.

[0097] Exemplarily, the ratio of the number of the smallest cells with Chinese as the characteristic information in the merged row cell to be recognized to the number of the smallest cells with content in this row is A, and the ratio of the number of the smallest cells without Chinese as the characteristic information in the merged row cell to be recognized to the number of the smallest cells with content in the merged row cell to be recognized is 1 - A.

[0098] Furthermore, the attribute characteristics of each merged row cell to be recognized can also include: the difference between the font size of the content in the merged row cell to be recognized and the font size of the content in the merged row cell closest to the merged row cell to be recognized.

[0099] In one embodiment of the present disclosure, before performing step S2100, the method may further include steps S3100 to S3400 as shown below:

[0100] Step S3100, obtain the cell content of each cell in the table to be recognized.

[0101] Step S3200, generate feature information of at least one cell in the table to be recognized based on the cell content of each cell in the table to be recognized.

[0102] Among them, the feature information of a cell represents the structural category corresponding to the cell content of the cell.

[0103] Among them, the feature information of a cell represents the type to which the cell content of the cell belongs; specifically, the cell content of each cell in the table to be recognized can be divided into types such as Chinese, English, numbers, dates, times, blanks, etc., as the feature information of each cell in the table to be recognized.

[0104] Step S3300, calculate the similarity between any two adjacent rows in the table to be recognized according to the feature information of the cells in the cell to be recognized.

[0105] In one embodiment of the present disclosure, calculating the similarity between any two adjacent rows in the table to be recognized according to the feature information of the cells in the cell to be recognized may include: when the table to be recognized contains merged cells, determining the feature information and cell content of the merged cells as the feature information and cell content of each smallest cell constituting the merged cells; calculating the similarity between each two adjacent rows of the table to be recognized according to the feature information of each smallest cell in each row of the table to be recognized. When the table to be recognized does not contain merged cells, then calculate the similarity between each two adjacent rows of the table to be recognized according to the feature information of each smallest cell in each row of the table to be recognized.

[0106] When the table to be recognized contains merged cells, determining the feature information and cell content of the merged cells as the feature information and cell content of each smallest cell constituting the merged cells can make the number of feature information of each smallest cell in each row equal, which is beneficial to calculating the similarity between each two adjacent rows, and can also make the number of cell contents of each smallest cell in each row equal.

[0107] Those skilled in the art can understand that if the table to be recognized does not contain merged cells, that is to say, the table to be recognized only includes the smallest cells, then the number of feature information of each smallest cell in each row of the table to be recognized is equal, and the feature vector of each row of cells in the table to be recognized can be obtained according to the feature information of each smallest cell in each row.

[0108] If the table to be recognized contains merged cells, the feature information of each minimum cell in each row of the table to be recognized can be obtained to obtain the feature vector of each row of cells in the table to be recognized.

[0109] Specifically, the feature vector of each row of cells in the table to be recognized can be obtained according to the feature information of each minimum cell in each row, and then the distance between the feature vectors of every two adjacent rows can be calculated as the similarity between every two adjacent rows. If the distance between the feature vectors of two adjacent rows is larger, the similarity between every two adjacent rows is smaller; if the distance between the feature vectors of two adjacent rows is smaller, the similarity between every two adjacent rows is larger. Of course, the similarity between every two adjacent rows can also be calculated by other methods, which is not limited in this application.

[0110] The above distance can be the Euclidean distance or other distances, which is not limited in the embodiments of this application.

[0111] In one embodiment, the feature vector of this row of cells can be generated in the following manner:

[0112] Based on the correspondence between the feature information of each minimum cell in each row of the table to be recognized and a preset value, the feature vector of each row of the table to be recognized is generated, and the feature vector of each row includes the preset values corresponding to the feature information of each minimum cell in this row.

[0113] Exemplarily, the correspondence between the feature information and the preset value can be as shown in Table 1 below:

[0114] Table 1

[0115] Feature information Preset value Chinese 1 English 2 Number 3 Date 4 Time 5 Blank 0

[0116] Assume that the feature information of each minimum cell in the first row of the table to be recognized is, in order from left to right, number, date, Chinese, blank, and the feature vector of the first row of the table to be recognized is (3, 4, 1, 0).

[0117] Based on the feature vectors of each row of the table to be recognized, the similarity between two adjacent rows of the table to be recognized is calculated.

[0118] Step S3400: Merge two adjacent rows of cells whose similarity reaches the similarity threshold, and obtain the merged row of cells to be recognized according to the merge result.

[0119] In this step, the size of the similarity threshold can be set according to the actual situation.

[0120] Specifically, multiple cells in the table to be recognized are merged to obtain the merged row cells to be recognized. Then, the cell content of each cell in the merged row cells to be recognized is the cell content of each cell in all the rows merged by the merged row cells to be recognized.

[0121] Exemplarily, the similarity threshold in the embodiment of the present invention is 0.9. The similarity between the first row and the second row in the table to be recognized is 0.95; the similarity between the second row and the third row is 0.93, and the similarity between the third row and the fourth row is 0.2. Then, the first row, the second row, and the third row are merged into one row as a merged row cell to be recognized, and the cell content of each cell in the first row, the second row, and the third row in the table to be recognized is used as the cell content of each cell in the merged row cell to be recognized.

[0122] In one embodiment, the cell content of each cell in the merged row cell to be recognized refers to the cell content of each smallest cell in the merged row. If the table to be recognized contains merged cells, the execution result of step 204 can be directly obtained, and the cell content of each smallest cell in all the rows of the table to be recognized merged by the merged row is used as the cell content of each cell in the merged row.

[0123] Step S2200, obtain the first recognition data according to the first feature and the first classification model.

[0124] In this embodiment, the first classification model can be a binary classification model corresponding to a preset structure category, which is used to determine whether the merged row cell to be recognized corresponding to the first feature belongs to its corresponding structure category. The first recognition data output by the first classification model is the data indicating whether the merged row cell to be recognized belongs to its corresponding structure category. For example, the first recognition data can be any number between 0 and 1.

[0125] Specifically, the structure categories can include a main title, a row title, table content, and others. In one example, a first classification model corresponding to each structure category can be preset. That is to say, a first classification model corresponding to the main title, a first classification model corresponding to the row title, a first classification model corresponding to the table content, and a first classification model corresponding to others can be preset. The first classification model corresponding to the main title can be used to determine whether the structure category of the merged row to be recognized belongs to the main title; the first classification model corresponding to the row title can be used to determine whether the structure category of the merged row to be recognized belongs to the row title; the first classification model corresponding to the table content can be used to determine whether the structure category of the merged row to be recognized belongs to the table content; the first classification model corresponding to others can be used to determine whether the structure category of the merged row to be recognized belongs to others.

[0126] In an disclosed embodiment, by inputting the first feature into each first classification model, the first recognition data output by each first classification model, indicating whether the merge row cell to be recognized belongs to its corresponding structure category, can be obtained.

[0127] In another embodiment of the present disclosure, obtaining the first recognition data according to the first feature and the first classification model may include steps S2210 to S2220 as shown below:

[0128] Step S2210: Traverse each row cell in the merge row cell to be recognized, and obtain the third recognition data of the currently traversed row according to the first feature and the first classification model of the currently traversed row.

[0129] In this embodiment, the first feature of the currently traversed row can be input into each first classification model, and the third recognition data output by each classification model, indicating whether the currently traversed row belongs to its corresponding structure category, can be obtained.

[0130] Step S2220: When the traversal ends, obtain the first recognition data of the merge row cell to be recognized according to the third recognition data of each row cell in the merge row cell to be recognized.

[0131] The third recognition data of each row cell in the merge row cell to be recognized corresponding to any one of the first classification models can be averaged, and the obtained average value can be used as the first recognition data of the merge row cell to be recognized corresponding to the any one of the first classification models.

[0132] Step S2300: Obtain the suspicious merge row cell and its second feature according to the first recognition data.

[0133] In an embodiment of the present disclosure, the merge row cell to be recognized with ambiguity can be determined as the suspicious merge row cell according to the first recognition data.

[0134] Specifically, the suspicious merge row cell can be the merge row cell to be recognized with ambiguous recognition results, where the recognition result is the result of the structure category of the merge row cell to be recognized determined according to the first recognition data.

[0135] In an embodiment of the present disclosure, obtaining the suspicious merge row cell according to the first recognition data may include steps S2310 to S2330 as shown below:

[0136] Step S2310: Traverse the merge row cell to be recognized, and obtain the total data of the first recognition data of the traversed merge row cell.

[0137] The first recognition data of the merged row cells traversed can be the first recognition data output by each first classification model according to the first features of the merged row cells traversed. For example, according to the first features of the merged row cells traversed, the first recognition data output by the first classification model corresponding to the main title can be a1, the first recognition data output by the first classification model corresponding to the row title can be a2, the first recognition data output by the first classification model corresponding to the table content can be a3, and the first recognition data output by the first classification model corresponding to others can be a4. Then, the sum data sum of the first recognition data of the merged row cells traversed can be expressed as: sum = a1 + a2 + a3 + a4.

[0138] Step S2320, calculate the ratio of the first recognition data of the merged row cells traversed to the sum data, and the standard deviation of this ratio.

[0139] In this embodiment, it can be to calculate the ratio of each first recognition data of the merged row cells traversed to the sum data respectively, and then calculate the standard deviation of these ratios.

[0140] The ratio per1 of the first recognition data a1 output by the first classification model corresponding to the main title to the sum data sum can be expressed as: per1 = a1 / sum, the ratio per2 of the first recognition data a2 output by the first classification model corresponding to the row title to the sum data sum can be expressed as: per2 = a2 / sum, the ratio per3 of the first recognition data a3 output by the first classification model corresponding to the table content to the sum data sum can be expressed as: per3 = a3 / sum, and the ratio per4 of the first recognition data a4 output by the first classification model corresponding to others to the sum data sum can be expressed as: per4 = a4 / sum.

[0141] The standard deviation std of these ratios can be obtained through the following formula:

[0142]

[0143] Step S2330, obtain the suspicious merged row cells according to the comparison result of the standard deviation of the merged row cells traversed with the preset threshold.

[0144] The preset threshold can be set in advance according to the application scenario or specific requirements. For example, the preset threshold can be 0.2.

[0145] In the case where the standard deviation of the traversed merged row cells is greater than the preset threshold, it can be determined that the recognition result of the traversed merged row cells is not ambiguous, and the traversed merged row cells can be used as reference merged row cells. In the case where the standard deviation of the traversed merged row cells is less than or equal to the preset threshold, it can be determined that the recognition result of the traversed merged row cells is ambiguous, and the traversed merged row cells are used as suspicious merged row cells.

[0146] In this embodiment, the second feature may include at least one of the following:

[0147] The first recognition data corresponding to the suspicious merged row cells for at least one structural category;

[0148] The number of rows of the cells included in the suspicious merged row cells;

[0149] The number of first features whose similarity is greater than the preset similarity threshold when the first feature of the suspicious merged row cells is compared with the first feature list of any structural category; wherein, the first feature list is a list composed of the first features of the merged row cells with no ambiguity in the structural category in the table to be recognized;

[0150] The structural category of the previous merged row cell of the suspicious merged row cells;

[0151] The structural category of the next merged row cell of the suspicious merged row cells;

[0152] The difference between the row number of the suspicious merged row cells and the row number of the previous blank merged row cell;

[0153] The difference between the row number of the suspicious merged row cells and the row number of the next blank merged row cell.

[0154] In this embodiment, the first feature list may be obtained according to the first features of the reference merged row cells.

[0155] Specifically, it may be to construct the first feature list of the main title according to the first features of the reference merged row cells whose recognition result of the structural category is the main title; construct the first feature list of the row title according to the first features of the reference merged row cells whose recognition result of the structural category is the row title; construct the first feature list of the table content according to the first features of the reference merged row cells whose recognition result of the structural category is the table content; construct the first feature list of others according to the first features of the reference merged row cells whose recognition result of the structural category is others.

[0156] In the first feature list of any structural category, it may include the first features of all reference merged row cells whose recognition result is this structural category.

[0157] Step S2400: Obtain second recognition data according to the second feature and the second classification model.

[0158] The second classification model can be a four-classification model, which can be used to determine which one of the structural categories of the suspected merged row cells is a major title, a row title, table content, or others.

[0159] Specifically, the second feature can be input into the second classification model, and the second classification model can output the second recognition data indicating the structural category to which the suspected merged row cells belong.

[0160] Step S2500: Correct the recognition result of the structural category of the suspected merged row cells according to the second recognition data.

[0161] In this embodiment, the recognition result of the structural category of the merged row cells to be recognized can be determined in advance according to the first recognition data. Since the recognition result of the suspected merged row cells determined according to the first recognition data is ambiguous, the recognition result of the suspected merged row cells obtained according to the first recognition data can be corrected according to the second recognition data. That is to say, in the table to be recognized, the recognition result of the merged row cells to be recognized whose recognition result determined according to the first recognition data is not ambiguous is determined according to the first recognition data; the recognition result of the suspected merged row cells whose recognition result determined according to the first recognition data is ambiguous is determined according to the second recognition data.

[0162] Through the embodiments of the present disclosure, first recognition data is obtained according to the first feature and the first classification model of the merged row cells to be recognized, suspected merged row cells are obtained according to the first recognition data, second recognition data is obtained according to the second feature and the second classification model of the suspected merged row cells, and then the recognition result of the structural category of the suspected merged row cells is corrected according to the second recognition data. Since the second feature is more accurate than the first feature, and the context similarity relationship of the ambiguous merged row cells is introduced into the second feature, correcting the recognition result of the structural category of the suspected merged row cells according to the second recognition data obtained according to the second feature can improve the accuracy of the recognition result of the structural category of the suspected merged row cells.

[0163] <Device Embodiment>

[0164] In this embodiment, a recognition and correction device 4000 for a table structure is provided, as Figure 3As shown, it includes a first feature acquisition module 4100, a first data acquisition module 4200, a second feature acquisition module 4300, a second data acquisition module 4400, and a recognition result correction module 4500. The first feature acquisition module 4100 is used to acquire the first features of the merge row cells to be recognized in the table to be recognized; the first data acquisition module 4200 is used to obtain first recognition data according to the first features and the first classification model; the second feature acquisition module 4300 is used to acquire the suspicious merge row cells and their second features according to the first recognition data; the second data acquisition module 4400 is used to obtain second recognition data according to the second features and the second classification model; the recognition result correction module 4500 is used to correct the recognition result of the structural category of the suspicious merge row cells according to the second recognition data.

[0165] In an embodiment of the present disclosure, the first data acquisition module 4200 may further be used for:

[0166] According to the first features and the first classification model corresponding to at least one structural category, obtain the first recognition data of the structural category corresponding to the merge row cells to be recognized;

[0167] Wherein, the first classification model is a model for determining whether the merge row cells to be recognized belong to the corresponding structural category.

[0168] In an embodiment of the present disclosure, the second feature acquisition module 4300 may further be used for:

[0169] According to the first recognition data, determine the merge row cells to be recognized with ambiguity as suspicious merge row cells.

[0170] In an embodiment of the present disclosure, the second feature acquisition module 4300 may further include:

[0171] A traversal unit, configured to traverse the merge row cells to be recognized and obtain the total data of the first recognition data of the traversed merge row cells;

[0172] A calculation unit, configured to calculate the ratio of the first recognition data of the traversed merge row cells to the total data and the standard deviation of the ratio;

[0173] An acquisition unit, configured to obtain suspicious merge row cells according to the comparison result between the standard deviation of the traversed merge row cells and a preset threshold.

[0174] In an embodiment of the present disclosure, the acquisition unit may further be used for:

[0175] Regard the merge row cells to be recognized with the comparison result indicating that the standard deviation is less than or equal to the threshold as suspicious merge row cells.

[0176] In one embodiment of the present disclosure, the second data acquisition module 4400 may further be configured to:

[0177] Obtain second identification data representing the structural category of the suspicious merged row cells according to the second feature and the second classification model;

[0178] Wherein, the second classification model is a model for determining the structural category to which the suspicious merged row cells belong.

[0179] In one embodiment of the present disclosure, the identification correction device 4000 may further include:

[0180] A content acquisition unit, configured to acquire the cell content of each cell in the table to be recognized;

[0181] An information generation unit, configured to generate feature information of at least one cell in the table to be recognized based on the cell content of each cell in the table to be recognized, where the feature information of the cell represents the structural category corresponding to the cell content of the cell;

[0182] A similarity calculation unit, configured to calculate the similarity between any two adjacent rows in the table to be recognized according to the feature information of the cells in the cell to be recognized;

[0183] A merging unit, configured to merge two adjacent rows of cells whose similarity reaches the similarity threshold, and obtain the merged row cells to be recognized according to the merging result; wherein, the merged row cells to be recognized include at least one row of cells.

[0184] In one embodiment of the present disclosure, the second feature acquisition module 4300 may further include:

[0185] A reference row determination unit, configured to determine reference merged row cells corresponding to at least one structural category in the table to be recognized according to the first identification data, where the reference merged row cells are the merged row cells to be recognized whose identification results of the structural category are not ambiguous;

[0186] A list construction unit, configured to generate a first feature list of at least one structural category according to the first features of the reference merged row cells of at least one structural category, and further obtain the second feature of the suspicious merged row cells according to the first feature list.

[0187] In one embodiment of the present disclosure, the second feature includes at least one of the following:

[0188] The first identification data of the suspicious merged row cells corresponding to at least one structural category;

[0189] The number of rows of cells included in the suspicious merged row cells;

[0190] The number of first features of the merge row cell in doubt that has a similarity greater than a preset similarity threshold when compared with the list of first features of any structural category; wherein, the list of first features is composed of the first features of the merge row cells in the table to be recognized where the structural category is not ambiguous.

[0191] The structural category of the previous merge row cell of the merge row cell in doubt.

[0192] The structural category of the next merge row cell of the merge row cell in doubt.

[0193] The difference between the row number of the merge row cell in doubt and the row number of the previous blank merge row cell.

[0194] The difference between the row number of the merge row cell in doubt and the row number of the next blank merge row cell.

[0195] In an embodiment of the present disclosure, the first feature includes at least one of the following:

[0196] The ratio of the number of merged cells in the merge row cell to be recognized to the number of the smallest cells in the merge row cell to be recognized.

[0197] The set of feature information of each cell in the merge row cell to be recognized.

[0198] The ratio of the number of the smallest cells with Chinese in the feature information of the merge row cell to be recognized to the number of the smallest cells with content in the merge row cell to be recognized.

[0199] In an embodiment of the present disclosure, the feature information in the merge row cell to be recognized includes at least one of the following:

[0200] The ratio of the number of the smallest cells with numbers in the merge row cell to be recognized to the number of the smallest cells with content in the merge row cell to be recognized.

[0201] The number of colons in the content of the merge row cell to be recognized.

[0202] The ratio of the number of the smallest cells in the merge row cell to be recognized whose feature information is different from that of the smallest cells in the merge row cell closest to this merge row to the number of the smallest cells with content in the merge row cell to be recognized.

[0203] In an embodiment of the present disclosure, the first data acquisition module 4200 may further include:

[0204] A row traversal unit for traversing each row cell in the merged row cell to be recognized, and obtaining third recognition data of the currently traversed row according to the first feature of the currently traversed row and the first classification model corresponding to at least one structural category;

[0205] A data obtaining unit for obtaining first recognition data of the merged row cell to be recognized according to the third recognition data of each row cell in the merged row cell to be recognized when the traversal ends.

[0206] Those skilled in the art should understand that the table structure recognition and correction device 4000 can be implemented in various ways. For example, the table structure recognition and correction device 4000 can be implemented by configuring a processor with instructions. For example, the instructions can be stored in a ROM, and when the device is started, the instructions are read from the ROM into a programmable device to implement the table structure recognition and correction device 4000. For example, the table structure recognition and correction device 4000 can be solidified into a dedicated device (such as an ASIC). The table structure recognition and correction device 4000 can be divided into independent units, or they can be combined together to implement. The table structure recognition and correction device 4000 can be implemented by one of the above various implementation methods, or can be implemented by a combination of two or more of the above various implementation methods.

[0207] In this embodiment, the table structure recognition and correction device 4000 can have various implementation forms. For example, the table structure recognition and correction device 4000 can be a functional module running in any software product or application program that provides table structure recognition services, or a peripheral embedment, plug-in, patch, etc. of these software products or application programs, and can also be these software products or application programs themselves.

[0208] <Embodiment of Electronic Device>

[0209] The present disclosure also provides an electronic device 5000.

[0210] In one embodiment, the electronic device 5000 may include the aforementioned table structure recognition and correction device 4000.

[0211] In another embodiment, the electronic device 5000 may further include, as Figure 4 shown, a processor 5100 and a memory 5200. The memory 5200 is used to store executable instructions; the instructions are used to control the processor 5100 to execute the aforementioned table structure recognition and correction method.

[0212] In this embodiment, the electronic device 5000 can be any electronic product with a processor 5100 and a memory 5200, such as a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, a workstation, a game console, a server, etc.

[0213] <Readable storage medium embodiment>

[0214] In this embodiment, a readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the recognition and correction method for the table structure in any embodiment of the present disclosure.

[0215] The present invention may be a system, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon for causing a processor to implement various aspects of the present invention.

[0216] The computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not construed as an instantaneous signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.

[0217] The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0218] The computer program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present invention.

[0219] Aspects of the present invention are described herein with reference to the flowchart and / or block diagram of a method, apparatus (system), and computer program product according to embodiments of the present invention. It should be understood that each block of the flowchart and / or block diagram, and the combinations of blocks in the flowchart and / or block diagram, can be implemented by computer - readable program instructions.

[0220] These computer - readable program instructions can be provided to a processor of a general - purpose computer, a special - purpose computer, or other programmable data - processing apparatus to produce a machine such that, when the instructions are executed by the processor of the computer or other programmable data - processing apparatus, a device is created that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions can also be stored in a computer - readable storage medium, which causes a computer, a programmable data - processing apparatus, and / or other devices to operate in a particular manner. Thus, the computer - readable medium storing the instructions includes a manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0221] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0222] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions. As is well known to those skilled in the art, implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.

[0223] The embodiments of the present invention have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of technologies in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. An identification and correction method, characterized in that, Including: Obtain the first feature of the merge row cells to be recognized in the table to be recognized; Obtain first recognition data according to the first feature and the first classification model; Obtain the suspicious merge row cells and their second features according to the first recognition data; Obtain second recognition data according to the second feature and the second classification model; Correct the recognition result of the structural category of the suspicious merge row cells according to the second recognition data; The obtaining the suspicious merge row cells according to the first recognition data includes: Traverse the merge row cells to be recognized, and obtain the total data of the first recognition data of the traversed merge row cells; Calculate the ratio of the first recognition data of the traversed merge row cells to the total data and the standard deviation of the ratio; Take the merge row cells to be recognized whose comparison result shows that the standard deviation is less than or equal to the threshold as the suspicious merge row cells.

2. The method according to claim 1, characterized in that, The obtaining the first recognition data according to the first feature and the first classification model includes: Obtain the first recognition data corresponding to the structural category of the merge row cells to be recognized according to the first feature and the first classification model corresponding to at least one structural category; Wherein, the first classification model is a model for determining whether the merge row cells to be recognized belong to the corresponding structural category.

3. The method according to claim 1, characterized in that, The obtaining the second recognition data according to the second feature and the second classification model includes: Obtain the second recognition data representing the structural category of the suspicious merge row cells according to the second feature and the second classification model; Wherein, the second classification model is a model for determining the structural category to which the suspicious merge row cells belong.

4. The method according to claim 1, characterized in that, Before obtaining the first feature of the merge row cells to be recognized in the table to be recognized, the method further includes: Obtain the cell content of each cell in the table to be recognized; Based on the cell content of each cell in the table to be recognized, generate the feature information of at least one cell in the table to be recognized, and the feature information of the cell represents the structural category corresponding to the cell content of the cell; Calculate the similarity between any two adjacent rows in the table to be recognized according to the feature information of the cells in the table to be recognized; Merge the two adjacent rows of cells whose similarity reaches the similarity threshold, and obtain the merge row cells to be recognized according to the merge result; wherein, the merge row cells to be recognized include at least one row of cells.

5. The method according to claim 1, characterized in that, Obtaining the second feature of the suspicious merge row cells includes: Determine the reference merge row cells corresponding to at least one structural category in the table to be recognized according to the first recognition data, wherein the reference merge row cells are the merge row cells to be recognized whose recognition result of the structural category is not ambiguous; Generate a first feature list of at least one structural category according to the first features of the reference merge row cells of at least one structural category, and obtain the second feature of the suspicious merge row cells according to the first feature list.

6. The method according to claim 1, characterized in that, The obtaining the first recognition data according to the first feature and the first classification model includes: Traverse each row cell in the merge row cell to be recognized, and obtain the third recognition data of the currently traversed row according to the first feature of the currently traversed row and the first classification model corresponding to at least one structural category; In the case where the traversal ends, obtain the first recognition data of the merge row cell to be recognized according to the third recognition data of each row cell in the merge row cell to be recognized.

7. An identification and correction device for a table structure, characterized in that, It includes: A first feature acquisition module, configured to acquire the first feature of the merge row cell to be recognized in the table to be recognized; A first data acquisition module, configured to acquire the first recognition data according to the first feature and the first classification model; A second feature acquisition module, configured to acquire the suspicious merge row cell and its second feature according to the first recognition data; A second data acquisition module, configured to acquire the second recognition data according to the second feature and the second classification model; A recognition result correction module, configured to correct the recognition result of the structural category of the suspicious merge row cell according to the second recognition data; The acquiring the suspicious merge row cell according to the first recognition data includes: Traverse the merge row cell to be recognized, and obtain the total data of the first recognition data of the traversed merge row cell; Calculate the ratio of the first recognition data of the traversed merge row cell to the total data and the standard deviation of the ratio; Use the merge row cell to be recognized whose comparison result indicates that the standard deviation is less than or equal to the threshold as the suspicious merge row cell.

8. An electronic device, characterized in that, It includes: The device according to claim 7; Or, A processor and a memory, the memory is used to store instructions, and the instructions are used to control the processor to execute the method according to any one of claims 1 to 6.

9. A readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Table batch processing method, system and device and storable medium

    CN110287459A

  • Method and device for identifying table structure and electronic equipment

    CN112528703A