Table information extraction method and related device

By identifying and extracting the header and body information of the table, and using the island problem algorithm and regular expression matching rules, the express delivery price list is processed automatically, solving the problem of tedious manual data entry and improving the efficiency and accuracy of information extraction.

CN116187283BActive Publication Date: 2026-05-19SHENZHEN QIANHAI BAIDI NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN QIANHAI BAIDI NETWORK CO LTD
Filing Date
2023-03-02
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, when enterprises extract information from the express delivery price list provided by the express delivery company, the manual entry operation is cumbersome, resulting in low extraction efficiency. This is especially true when there are many destinations, as there are many copy and paste operations, which take a long time.

Method used

By identifying the table header and body information, the system extracts the target header and body information using a preset matching method. Combining the island problem algorithm and regular expression matching rules, it automates the processing of table data, reducing manual data entry steps.

Benefits of technology

It improves the efficiency and accuracy of extracting information from tables, reduces manual operations by users, and lowers the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116187283B_ABST
    Figure CN116187283B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a table information extraction method, a table information extraction device and a computer readable storage medium, which are used for extracting table information while improving the extraction efficiency of information extraction on a table to be extracted. The method comprises the following steps: obtaining a table to be extracted, identifying header information of the table to be extracted according to a preset matching method, determining body information of the table to be extracted based on the header information, extracting target header information from the header information, and extracting target body information from the body information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of table information extraction, and more specifically, to table information extraction methods, table information extraction devices, and computer-readable storage media. Background Technology

[0002] In business parcel delivery scenarios, considering the large volume of shipments, courier companies often offer discounts. After negotiation, the courier company provides the company with a price list that differs from its official website price. Therefore, the company needs to extract information from this price list for separate system maintenance and subsequent cost calculations and reconciliation. For example, if the price list is provided by SF Express, the company needs to extract key information such as the courier company, service type, destination, initial weight, initial weight price, additional weight unit, and additional weight price, and then enter this extracted information into the system.

[0003] The existing method for extracting information from the form to be extracted is to first obtain the form to be extracted (express price list) sent by the client (express company), then compare it with the express price list, and manually enter the information such as the sending area, first weight price, and additional weight price in the express price list into the company's sending system line by line to complete the extraction of information from the form to be extracted.

[0004] However, when there is a lot of content in the table to be extracted, such as when there are many destinations / flows (expanded by city, up to hundreds of rows), copying and pasting the express delivery price list of the express delivery company line by line to the fixed template supported by the enterprise system involves a lot of copy and paste operations. The time cost for users (enterprises) to manually enter and extract information is large, and the extraction efficiency of information extraction from the table to be extracted is low. Summary of the Invention

[0005] This application provides a method, device, and computer-readable storage medium for extracting table information, which improves the efficiency of information extraction from the table to be extracted.

[0006] In a first aspect, embodiments of this application provide a method for extracting table information, including:

[0007] Obtain the table to be extracted;

[0008] The header information of the table to be extracted is identified according to a preset matching method;

[0009] The table body information of the table to be extracted is determined based on the header information;

[0010] Extract the target header information from the header information, and extract the target body information from the body information.

[0011] Optionally, before identifying the header information of the table to be extracted according to the preset matching method, the method further includes:

[0012] The table to be extracted is preprocessed to obtain the preprocessed table to be extracted;

[0013] Based on the preprocessed table to be extracted, determine the valid information of the table to be extracted;

[0014] The step of identifying the header information of the table to be extracted according to a preset matching method includes:

[0015] The header information of the valid information is identified according to a preset matching method.

[0016] Optionally, the preprocessing of the table to be extracted to obtain a preprocessed table to be extracted includes:

[0017] Based on the island problem algorithm, the cell data of the table to be extracted is converted from 0 to 1 to obtain the table to be extracted after the conversion from 0 to 1.

[0018] The step of determining the valid information of the table to be extracted based on the preprocessed table to be extracted includes:

[0019] Based on the table to be extracted after the 0-1 conversion process, determine the data frame with the largest area;

[0020] The data within the data frame is determined to be the valid information.

[0021] Optionally, identifying the header information of the table to be extracted according to a preset matching method includes:

[0022] The table to be extracted is matched according to the preset header row regular expression matching rules;

[0023] If a target row satisfies the preset header row regular expression matching rule, then the target row is determined as a header row;

[0024] The header information is determined based on the header row.

[0025] Optionally, determining the header information based on the header row includes:

[0026] For each cell corresponding to the header row, if the projection of the cell on the horizontal axis includes at least one cell, and / or the projection on the vertical axis includes at least one cell, then it is determined that the cell has a contextual relationship.

[0027] The contextual content of the cell is determined based on the contextual relationship of the cell;

[0028] The header information is determined based on the context content corresponding to each cell.

[0029] Optionally, the target header information includes the courier company, service type, and / or initial weight and additional weight.

[0030] Extracting the target header information from the header information includes:

[0031] Extract the courier company and the service type from the header information based on a preset word segmentation algorithm; and / or

[0032] Based on preset weight regularity matching rules, the initial weight and the subsequent weight are extracted from the header information.

[0033] Optionally, the table information includes the weight values ​​corresponding to the initial weight and the subsequent weight, and / or the administrative region information corresponding to the destination;

[0034] Extracting the target table body information from the table body information includes:

[0035] After verifying the weight value, the weight value that passes the verification is taken as the extracted target weight value; and / or

[0036] The administrative region information is standardized to obtain standardized administrative region information, and the standardized administrative region information is used as the target administrative region information for extraction.

[0037] Optionally, the standardization process of the administrative region information to obtain target administrative region information, and the use of the target administrative region information as the extracted administrative region information, includes:

[0038] If the administrative region information is inconsistent with the administrative region name in the preset administrative region information, and the administrative region information in the table body information is determined to be the same administrative region as the preset administrative region information according to the preset text matching rules, then the preset administrative region information is determined as the target administrative region information; wherein, the preset text matching rules include the first character must match, there can only be one concatenated mismatched character segment, and the number of matched characters must be greater than half the length of the shorter text, etc.; and / or

[0039] If the administrative region information is not the changed administrative region information, then the changed administrative region information corresponding to the administrative region information is determined, and the changed administrative region information is used as the target administrative region information.

[0040] Secondly, embodiments of this application provide a table information extraction device, including:

[0041] The obtaining unit is used to obtain the table to be extracted.

[0042] The identification unit is used to identify the header information of the table to be extracted according to a preset matching method;

[0043] The determining unit is used to determine the body information of the table to be extracted based on the header information;

[0044] The extraction unit is used to extract target header information from the header information and target body information from the body information.

[0045] Thirdly, embodiments of this application provide a table information extraction device, including:

[0046] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;

[0047] The memory is either a short-term storage memory or a persistent storage memory;

[0048] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the aforementioned table information extraction method.

[0049] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the aforementioned table information extraction method.

[0050] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to execute the aforementioned table information extraction method.

[0051] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: it can obtain the table to be extracted, identify the header information of the table to be extracted according to the preset matching method, determine the body information of the table to be extracted based on the header information, extract the target header information from the header information, and extract the target body information from the body information. It can identify and extract key data according to the preset matching method, reduce the steps required for manual entry and extraction by users, and improve the extraction efficiency of information extraction from the table to be extracted. Attached Figure Description

[0052] Figure 1 This is a schematic diagram of the architecture of a table information extraction system disclosed in an embodiment of this application;

[0053] Figure 2 This is a flowchart illustrating a method for extracting table information disclosed in an embodiment of this application;

[0054] Figure 3 This is a schematic diagram illustrating a process for converting cell data in a courier price list from 0 to 1, as disclosed in an embodiment of this application.

[0055] Figure 4 This is a schematic diagram of a table to be extracted, as disclosed in an embodiment of this application;

[0056] Figure 5 This is a schematic diagram illustrating a cell context relationship disclosed in an embodiment of this application;

[0057] Figure 6 This is a schematic diagram of the structure of a table information extraction device disclosed in an embodiment of this application. Detailed Implementation

[0058] This application provides a method, device, and computer-readable storage medium for extracting table information, which improves the efficiency of information extraction from the table to be extracted.

[0059] Please see Figure 1 The architecture of the table information extraction system in this application embodiment includes:

[0060] The table information extraction device 101 and client 102 are configured. When extracting table information, the table information extraction device 101 can connect to the client 102. The client 102 can send the table to be extracted to the table information extraction device 101. The table information extraction device 101 can identify the header information and body information of the table to be extracted, and extract the target header information from the header information and the target body information from the body information.

[0061] based on Figure 1 Please refer to the table information extraction system shown. Figure 2 , Figure 2 This is a flowchart illustrating a method for extracting table information disclosed in an embodiment of this application. The method includes:

[0062] 201. Obtain the table to be extracted.

[0063] In this embodiment, when extracting table information, the table to be extracted can be obtained.

[0064] 202. Identify the header information of the table to be extracted according to the preset matching method.

[0065] After obtaining the table to be extracted, the header information of the table can be identified according to a preset matching method. This method can involve first matching the table to be extracted according to a preset header row regular expression matching rule; if a target row matches the preset header row regular expression matching rule, then that target row is identified as a header row; and then the header information is determined based on that header row. Other reasonable methods can also be used, and are not limited here.

[0066] 203. Determine the body information of the table to be extracted based on the header information.

[0067] After identifying the header information of the table to be extracted according to the preset matching method, the body information of the table to be extracted can be determined based on the header information.

[0068] 204. Extract target header information from the header information and extract target body information from the body information.

[0069] After determining the table body information of the table to be extracted based on the header information, the target header information can be extracted from the header information, and the target body information can be extracted from the body information.

[0070] In this embodiment, a table to be extracted can be obtained, the header information of the table to be extracted can be identified according to a preset matching method, the body information of the table to be extracted can be determined based on the header information, the target header information can be extracted from the header information, and the target body information can be extracted from the body information. Key data can be identified and extracted according to the preset matching method, reducing the steps required for manual entry and extraction by users and improving the extraction efficiency of information extraction from the table to be extracted.

[0071] In this embodiment of the application, there are multiple methods for identifying the header information of the table to be extracted based on a preset matching method. Figure 1 The table information extraction methods shown are described below, and one of them is described in detail below.

[0072] In this embodiment, when extracting table information, a table to be extracted can be obtained. Specifically, the table to be extracted can be a courier price list, which can be obtained from the courier price lists sent by various clients (various courier companies), or other reasonable tables; no specific limitation is made here.

[0073] After obtaining the table to be extracted, the header information of the table to be extracted can be identified according to a preset matching method.

[0074] Before identifying the header information of the table to be extracted according to the preset matching method, the table to be extracted can be preprocessed to obtain a preprocessed table. Then, the valid information of the table to be extracted is determined based on the preprocessed table. The method for identifying the header information of the table to be extracted using the preset matching method can be to identify the header information of the valid information according to the preset matching method.

[0075] One method for preprocessing the table to be extracted to obtain a preprocessed table to be extracted can be to perform 0-1 transformation processing on the cell data of the table to be extracted based on the island problem algorithm to obtain a 0-1 transformed table to be extracted. Another method for determining the valid information of the table to be extracted based on the preprocessed table to be extracted can be to first determine the data frame with the largest area based on the 0-1 transformed table to be extracted, and then determine the data in the data frame as the valid information.

[0076] Specifically, since the data range in the express delivery price list may not be in the first row and first column, and there may be interfering items in the price list, it is necessary to preprocess the price list, locate the data range, and eliminate interfering items. First, treat cells with data values ​​in the price list as 1, and cells without data values ​​as 0. Please refer to [link / reference] for details. Figure 3 , Figure 3 This is a flowchart illustrating a 0-1 conversion process for cell data in a courier price list, as disclosed in an embodiment of this application. Figure 3 It can be seen that, Figure 3 Below is the result of converting the express delivery price list. After conversion using 0 and 1, the problem can be viewed as an island problem, where 0 represents seawater and 1 represents land. An island is a group of adjacent 1s (representing land). Adjacency requires that the two 1s are adjacent in either the horizontal or vertical direction. We can find the bounding box of the island with the largest area, which is the data frame with the largest area (x, y, width, height). Figure 3 As shown, the range of valid data, which is the largest data frame, is (2,2,3,7), which is the second row and second column, with a width of 3 and a height of 7. Data outside the range frame is considered as interference, and data inside the range frame is considered as valid information.

[0077] One method for identifying the header information of the table to be extracted according to a preset matching method is to first match the table to be extracted according to a preset header row regular expression matching rule. If there is a target row that satisfies the preset header row regular expression matching rule, then the target row is determined as the header row, and then the header information is determined according to the header row.

[0078] Specifically, a data matrix can be constructed based on the valid data area located in the preprocessing stage. The table data is then placed into the data matrix row by row. The cell content within the valid data area can be traversed row by row from top to bottom. Regular expressions can be used to match the cell text content. If a row matches the destination, first repeated character, and subsequent repeated characters simultaneously, that row is considered the header row. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a table to be extracted, as disclosed in an embodiment of this application. Figure 4 As can be seen, the second row is the matched header row. The preset header row regular expression matching rule can be: "Destination: "City|Destination|Destination City|Destination City|Sending Location|^Arrival$", First Weight: "First Weight|Base Weight|Starting Weight", Additional Weight: "Additional Weight"", or other reasonable preset header row regular expression matching rules, which are not limited here.

[0079] One method for determining the header information based on the header row is to first determine the context relationship of each cell corresponding to the header row if the projection of the cell on the horizontal axis includes at least one cell, and / or the projection on the vertical axis includes at least one cell. Then, the context content of the cell is determined based on the context relationship of the cell. Finally, the header information is determined based on the context content of each cell.

[0080] Specifically, cells in multi-row headers have contextual relationships (parent-child relationships). Based on the matched header rows and combined with the information of merged cells in the table (spanning rows and columns), the data relationships between header cells can be constructed. Specifically, cells in the data range can be traversed from top to bottom and from left to right, establishing a parent-child relationship between each cell and the cell above it. For example, given cell C1(x,y), and cell C2(x,y-1) directly above it is a merged cell spanning multiple columns, and its projection on the horizontal axis contains cell C1, then C1's parent cell is C2, and C2 has a child cell C1. (See also...) Figure 5 , Figure 5 This is a schematic diagram illustrating a cell context relationship disclosed in an embodiment of this application, such as... Figure 5 Cells D and E have cell B as their parent, and B has child cells D and E. For example, given cell C1(x,y), the cell directly above it is C2(x,y-1), and within the data range, there is cell C3. Its projection onto the vertical axis includes both C1 and C2. Therefore, C1's parent cell is C2, and C2 has a child cell C1. Please continue reading. Figure 5 Cell C contains cells D and F vertically, with cell D being the parent cell of cell F. Specifically, cell context content can be created based on the individual cells in the header row. Please continue reading... Figure 3 The second row is the matched header row. The cell containing "First Weight" has a parent-child relationship with the cells above and below it, and its context content is "SF Express Standard - First Weight - 1kg". Similarly, the context content of the cell containing "Additional Weight" is "SF Express Standard - Additional Weight -> 1kg". It is understandable that, in addition to the context relationships described above, other reasonable context relationships are also possible, which are not limited here.

[0081] It's worth noting that the header styles are not standardized; the number of rows corresponding to the header information varies across different courier companies. The header information can be a single line or multiple lines. If the header information has multiple lines, it generally contains contextual information, which may include various key details such as service type, initial weight unit, additional weight unit, and additional weight range, all of which need to be extracted. If the header information has a single line, default values ​​used in the courier industry will be applied if no information can be extracted; for example, the initial weight and additional weight might both default to 1kg. Other reasonable methods for determining the header information can also be used, but specific methods are not limited here.

[0082] After identifying the header information of the table to be extracted according to the preset matching method, the body information of the table to be extracted can be determined based on the header information.

[0083] One method for determining the table body information of the table to be extracted based on the header information could be to determine the row number corresponding to the header information, and then use the next row number after the header information as the starting row of the table body information. Other reasonable methods are also possible, and are not limited here. Please continue reading. Figure 4 ,Depend on Figure 4 As we can see, the header row is the second row, but it has a contextual relationship with the first and third rows. Therefore, the row numbers corresponding to the header information are 1 to 3. Thus, we can determine that the table body data starts from the fourth row.

[0084] After determining the table body information of the table to be extracted based on the header information, the target header information can be extracted from the header information, and the target body information can be extracted from the body information.

[0085] The method for extracting target header information from the header information may be to extract the courier company and the business type from the header information based on a preset word segmentation algorithm, and / or to extract the initial weight and the subsequent weight from the header information based on a preset weight regular expression matching rule, wherein the target header information includes the courier company, the business type, and / or the initial weight and the subsequent weight.

[0086] Specifically, the preset word segmentation algorithm can be the Mmseg word segmentation algorithm. The main idea of ​​the Mmseg word segmentation algorithm is to identify multiple different combinations of three words from left to right within a sentence that needs segmentation. Then, it selects the optimal word combination based on Mmseg's four disambiguation rules. The first word in the candidate word combination is then selected as the segmentation result for one iteration; the remaining words (i.e., the remaining part of the sentence excluding the first segmented word) continue for the next round of segmentation. It's understandable that the advantage of using the Mmseg word segmentation algorithm is that it adds contextual information to the traditional forward maximum matching algorithm, solving the problem that it only considers the word itself in each selection, ignoring related words in the context. Specifically, the Mmseg word segmentation algorithm relies on a dictionary; a dictionary of courier companies and business types can be pre-built to extract these information. Secondly, the preset weight regular expression matching rule can be: "(\\d+)\\s*(kg|KG|g|G|gram|kilogram)", which can match the numbers preceding the weight unit. It is understandable that, in addition to the preset word segmentation algorithm and preset weight regular expression matching rule described above, there can be other reasonable preset word segmentation algorithms and preset weight regular expression matching rules, which are not limited here.

[0087] One method for extracting target table body information from the table body information may be to verify the weight value and, if the verification result is qualified, extract the weight value from the table to be extracted; and / or to standardize the administrative region information to obtain target administrative region information, and use the target administrative region information as the extracted administrative region information, wherein the table body information includes the weight values ​​corresponding to the initial weight and the subsequent weight, and / or the administrative region information corresponding to the destination.

[0088] The method for standardizing the administrative region information to obtain target administrative region information and using the target administrative region information as the extracted administrative region information can be as follows: if the administrative region information is inconsistent with the administrative region name of the preset administrative region information, and the administrative region information of the table body information is determined to be the same administrative region as the preset administrative region information according to the preset text matching rules, then the preset administrative region information is determined as the target administrative region information; wherein, the preset text matching rules include the first character must match, there can only be one non-matching character segment, and the number of matched characters must be greater than half the length of the shorter text, etc.; and / or if the administrative region information is not the modified administrative region information, then the modified administrative region information corresponding to the administrative region information is determined, and the modified administrative region information is used as the target administrative region information.

[0089] Specifically, the column values ​​corresponding to each data point in the header information can be extracted into the table body information. For the initial weight and subsequent weight values ​​in the table body information, since these are numerical values, numerical format and data range validation are required. If the validation result is satisfactory, the weight value with the satisfactory result is used as the extracted target weight value. If the validation result is unsatisfactory, the failure reason corresponding to the unsatisfactory weight value is recorded for subsequent feedback to the user. Regarding the administrative region information corresponding to the destination in the table body information, since different courier companies use different methods to represent destinations in their price lists, there may be issues with administrative region name distinctions and administrative region downgrading. For example, "Hainan Tibetan Autonomous Prefecture" under Qinghai Province may appear as the abbreviation "Hainan Prefecture" on some courier price lists. Faced with similar situations, it is necessary to perform text matching on the administrative region table of the system (the system in the table information extraction device) and convert it into a unified representation based on the system. The text matching rules can be: (1) the first character must match, (2) there can only be one segment of characters that do not match, and (3) the number of matched characters must be greater than half the length of the shorter text. When all three conditions are met, it can be considered that the two texts represent the same administrative region. For the problem of administrative region downgrading, for example, due to the failure to update the express delivery price list in time, a third-level administrative region appears on the express delivery price list, while the original administrative region was a second-level administrative region. In the face of this situation, the system needs to automatically match the third-level administrative region and then find the second-level administrative region. Among them, for the administrative region level, the first level is greater than the second level, and the second level is greater than the third level. For example, for "Guangdong Shenzhen Nanshan", the corresponding administrative region level is: "First-level administrative region: Guangdong, second-level administrative region: Shenzhen, third-level administrative region: Nanshan". Specifically, the administrative divisions in the imported files are not up-to-date, and the city names have been updated. For example, Xichang City in Sichuan Province has been downgraded from a second-level to a third-level administrative division, and its second-level administrative division is Liangshan Prefecture. Therefore, the actual data entered into the system should be "Liangshan Prefecture in Sichuan Province".

[0090] It is understood that, in addition to the method described above for preprocessing the table to be extracted to obtain a preprocessed table to be extracted; in addition to the method described above for identifying the header information of the table to be extracted according to a preset matching method; in addition to the method described above for determining the header information based on the header row; in addition to the method described above for extracting target header information from the header information; in addition to the method described above for extracting target body information from the body information; in addition to the method described above for standardizing the administrative region information to obtain target administrative region information and using the target administrative region information as the extracted administrative region information; other reasonable methods may also be used, and specific methods are not limited here.

[0091] It is worth mentioning that, in order to better understand the inventive points of the embodiments of this application, another prior art is described below:

[0092] Another existing method for extracting information from the form to be extracted involves first obtaining the form (express delivery price list) sent by the client (express delivery company) and pre-obtaining a standard template supported by the enterprise system. Then, the express delivery company's price list is copied and pasted into the standard template supported by the enterprise system, and finally, it is imported into the system in batches via file upload to complete the information extraction. However, although it eliminates the need to copy and paste the express delivery company's price list line by line into the standard template supported by the enterprise system, it does require downloading and uploading the standard template. Therefore, the steps required for manual data entry and extraction by the user (enterprise) are still numerous, resulting in low efficiency in extracting information from the form.

[0093] In this embodiment, a table to be extracted can be obtained. The header information of the table to be extracted is identified according to a preset matching method. Based on the header information, the table body information is determined. Target header information is extracted from the header information, and target table body information is extracted from the table body information. Key data can be identified and extracted according to the preset matching method, reducing the steps required for manual data entry and improving the efficiency of information extraction from the table to be extracted. Secondly, during the preprocessing of the table to be extracted, the island problem algorithm can be used to perform 0-1 conversion on the cell data of the table to be extracted, improving the accuracy of determining the valid information in the table to be extracted and thus improving the accuracy of information extraction. Furthermore, this invention can directly extract information from the table to be extracted (such as a price list for a courier company), reducing errors that may occur during manual data entry and improving the accuracy of information extraction from the table to be extracted.

[0094] The table information extraction method in the embodiments of this application has been described above. The table information extraction device in the embodiments of this application is described below. Please refer to [link / reference]. Figure 2 One embodiment of the table information extraction device in this application includes:

[0095] The obtaining unit is used to obtain the table to be extracted.

[0096] The identification unit is used to identify the header information of the table to be extracted according to a preset matching method;

[0097] The determining unit is used to determine the body information of the table to be extracted based on the header information;

[0098] The extraction unit is used to extract target header information from the header information and target body information from the body information.

[0099] In this embodiment, a table to be extracted can be obtained, the header information of the table to be extracted can be identified according to a preset matching method, the body information of the table to be extracted can be determined based on the header information, the target header information can be extracted from the header information, and the target body information can be extracted from the body information. Key data can be identified and extracted according to the preset matching method, reducing the steps required for manual entry and extraction by users and improving the extraction efficiency of information extraction from the table to be extracted.

[0100] The table information extraction device in the embodiments of this application is described in detail below. Please refer to [link / reference]. Figure 3 Another embodiment of the table information extraction device in this application includes:

[0101] The obtaining unit is used to obtain the table to be extracted.

[0102] The identification unit is used to identify the header information of the table to be extracted according to a preset matching method;

[0103] The determining unit is used to determine the body information of the table to be extracted based on the header information;

[0104] The extraction unit is used to extract target header information from the header information and target body information from the body information.

[0105] The table information extraction device also includes: a preprocessing unit;

[0106] The preprocessing unit is used to preprocess the table to be extracted to obtain the preprocessed table to be extracted.

[0107] The determining unit is further configured to determine the valid information of the table to be extracted based on the preprocessed table to be extracted;

[0108] The identification unit is specifically used to identify the header information of the valid information according to a preset matching method.

[0109] The preprocessing unit is specifically used to perform 0-1 conversion processing on the cell data of the table to be extracted based on the island problem algorithm, so as to obtain the table to be extracted after 0-1 conversion processing;

[0110] The determining unit is specifically used to determine the data frame with the largest area based on the table to be extracted after the 0-1 conversion process, and to determine the data in the data frame as the valid information.

[0111] The identification unit is specifically used to match the table to be extracted according to the preset header row regular expression matching rule. If there is a target row that meets the preset header row regular expression matching rule, the target row is determined as the header row, and the header information is determined according to the header row.

[0112] The determining unit is specifically used to determine, for each cell corresponding to the header row, if the projection of the cell on the horizontal axis includes at least one cell, and / or the projection on the vertical axis includes at least one cell, then the cell is determined to have a context relationship, the context content of the cell is determined based on the context relationship of the cell, and the header information is determined according to the context content corresponding to each cell.

[0113] The extraction unit is specifically used to extract the courier company and the business type from the header information based on a preset word segmentation algorithm; and / or to extract the initial weight and the subsequent weight from the header information based on a preset weight regular expression matching rule. The target header information includes the courier company, the business type, and / or the initial weight and the subsequent weight.

[0114] The extraction unit is specifically used to verify the weight value and use the weight value that is qualified as the target weight value for extraction; and / or to standardize the administrative region information to obtain standardized administrative region information, and use the standardized administrative region information as the target administrative region information for extraction. The table body information includes the weight values ​​corresponding to the initial weight and the subsequent weight, and / or the administrative region information corresponding to the destination.

[0115] The extraction unit is specifically configured to determine the preset administrative region information as the target administrative region information if the administrative region information is inconsistent with the administrative region name of the preset administrative region information, and the administrative region information of the table body information is determined to be the same administrative region as the preset administrative region information according to the preset text matching rules; wherein, the preset text matching rules include the first character must match, there can only be one non-matching character segment, and the number of matched characters must be greater than half the length of the shorter text, etc.; and / or if the administrative region information is not the changed administrative region information, determine the changed administrative region information corresponding to the administrative region information, and use the changed administrative region information as the target administrative region information.

[0116] In this embodiment, each unit in the table information extraction device performs the functions described above. Figure 2 The operation of the table information extraction device in the illustrated embodiment will not be described in detail here.

[0117] Please refer to the following: Figure 4 Another embodiment of the table information extraction device 400 in this application includes:

[0118] Central processing unit 401, memory 405, input / output interface 404, wired or wireless network interface 403, and power supply 402;

[0119] Memory 405 is either a short-term storage memory or a persistent storage memory;

[0120] The central processing unit 401 is configured to communicate with the memory 405 and execute instructions stored in the memory 405 to perform the aforementioned operations. Figure 2 The method in the illustrated embodiment.

[0121] This application also provides a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the aforementioned actions. Figure 1 The method in the illustrated embodiment.

[0122] This application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to perform the aforementioned... Figure 1 The method in the illustrated embodiment.

[0123] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0126] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0127] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0128] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for extracting information from a table, characterized in that, include: Obtain the table to be extracted; The header information of the table to be extracted is identified according to a preset matching method, including: The table to be extracted is matched according to the preset header row regular expression matching rules; If a target row satisfies the preset header row regular expression matching rule, then the target row is determined as a header row; For each cell corresponding to the header row, if the projection of the cell on the horizontal axis includes at least one cell, and / or the projection on the vertical axis includes at least one cell, then it is determined that the cell has a contextual relationship. The contextual content of the cell is determined based on the contextual relationship of the cell; The header information is determined based on the context content corresponding to each cell; The table body information of the table to be extracted is determined based on the header information; Extract the target header information from the header information, and extract the target body information from the body information.

2. The method according to claim 1, characterized in that, Before identifying the header information of the table to be extracted according to the preset matching method, the method further includes: The table to be extracted is preprocessed to obtain the preprocessed table to be extracted; Based on the preprocessed table to be extracted, determine the valid information of the table to be extracted; The step of identifying the header information of the table to be extracted according to a preset matching method includes: The header information of the valid information is identified according to a preset matching method.

3. The method according to claim 2, characterized in that, The preprocessing of the table to be extracted to obtain the preprocessed table to be extracted includes: Based on the island problem algorithm, the cell data of the table to be extracted is converted from 0 to 1 to obtain the table to be extracted after the conversion from 0 to 1. The step of determining the valid information of the table to be extracted based on the preprocessed table to be extracted includes: Based on the table to be extracted after the 0-1 conversion process, determine the data frame with the largest area; The data within the data frame is determined to be the valid information.

4. The method according to claim 1, characterized in that, The target header information includes the courier company, service type, and / or initial weight and additional weight. Extracting the target header information from the header information includes: Extract the courier company and the business type from the header information based on a preset word segmentation algorithm; and / or Based on preset weight regularity matching rules, the initial weight and the subsequent weight are extracted from the header information.

5. The method according to claim 1, characterized in that, The table information includes the weight values ​​corresponding to the initial weight and the additional weight, and / or the administrative region information corresponding to the destination; The step of extracting target table body information from the table body information includes: After verifying the weight value, the weight value that passes the verification is taken as the extracted target weight value. and / or The administrative region information is standardized to obtain standardized administrative region information, and the standardized administrative region information is used as the target administrative region information for extraction.

6. The method according to claim 5, characterized in that, The standardization process of the administrative region information to obtain target administrative region information, and the use of the target administrative region information as the extracted administrative region information, includes: If the administrative region information is inconsistent with the administrative region name in the preset administrative region information, and the administrative region information in the table body information is determined to be the same administrative region as the preset administrative region information according to the preset text matching rules, then the preset administrative region information is determined as the target administrative region information; wherein, the preset text matching rules include the first character must match, there can only be one concatenated mismatched character segment, and the number of matched characters must be greater than half the length of the shorter text; and / or If the administrative region information is not the changed administrative region information, then the changed administrative region information corresponding to the administrative region information is determined, and the changed administrative region information is used as the target administrative region information.

7. A table information extraction device, characterized in that, include: Central processing unit and memory; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 6.

9. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1 to 6.