Table information extraction method, device and equipment and storage medium

By extracting key-value pairs from tables and generating path types, and using deep learning models for structured processing, the problem of incomplete table information extraction in existing technologies is solved, achieving efficient parsing of complex semantic relationships in tables and supporting various downstream applications.

CN115114290BActive Publication Date: 2025-11-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210742502.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-11-25
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently extract complex semantic relationships from tables, resulting in incomplete information representation and failing to meet the needs of downstream applications.

Method used

By extracting key-value pairs from the table, performing serialization processing, generating paths and predicting path types, and finally generating structured data, a deep learning model is used for path type prediction and structured data generation.

Benefits of technology

It enables the complete extraction of complex semantic relationships between various attributes in a table, supporting better applications such as graph construction, information retrieval, and intelligent question answering, and has broad application prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114290B_ABST
    Figure CN115114290B_ABST
Patent Text Reader

Abstract

The present disclosure provides a table information extraction method, device and equipment, storage medium and program product, relating to the technical field of artificial intelligence such as deep learning and natural language processing. A specific embodiment of the method comprises: extracting key-value pairs in a table; performing serialization processing on the key-value pairs to generate serialized data; generating a path from a key in the key-value pairs to a value in the key-value pairs; predicting the type of the path based on the serialized data and the path; and finding the structured data of the table based on the type of the path. The embodiment can extract the complex semantic relationship between various attributes in the table, making the expression of knowledge more complete.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, such as deep learning and natural language processing. BACKGROUND

[0002] For humans, a table is an intuitive and efficient data representation form, and is widely used in various documents. A table contains a large amount of information, which is well worth further mining. In addition, unlike free text, the data in a table is organized in a semi-structured form, so the information extracted from a table is more reliable and has better data quality than the information extracted from free text. SUMMARY

[0003] Embodiments of the present disclosure provide a table information extraction method, device, equipment, storage medium and program product.

[0004] In a first aspect, embodiments of the present disclosure provide a table information extraction method, comprising: extracting key-value pairs in a table; performing serialization processing on the key-value pairs to generate serialized data; generating a path from a key in the key-value pairs to a value in the key-value pairs; predicting a type of the path based on the serialized data and the path; and finding in the table based on the type of the path to generate structured data of the table.

[0005] In a second aspect, embodiments of the present disclosure provide a table information extraction device, comprising: an extraction module configured to extract key-value pairs in a table; a serialization module configured to perform serialization processing on the key-value pairs to generate serialized data; a generation module configured to generate a path from a key in the key-value pairs to a value in the key-value pairs; a prediction module configured to predict a type of the path based on the serialized data and the path; and a finding module configured to find in the table based on the type of the path to generate structured data of the table.

[0006] In a third aspect, embodiments of the present disclosure provide an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in any of the implementations of the first aspect.

[0007] In a fourth aspect, embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to enable a computer to perform the method described in any of the implementations of the first aspect.

[0008] In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program, the computer program being executed by a processor to implement the method described in any of the implementations of the first aspect.

[0009] The table information extraction method provided by the embodiments of the present disclosure can extract complex semantic relationships between various attributes in a table, so that the expression of knowledge is more complete.

[0010] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0011] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments made with reference to the drawings. The drawings are intended to better understand the present solution and do not constitute a limitation of the present disclosure. Among them:

[0012] Figure 1 is a flowchart of one embodiment of the table information extraction method according to the present disclosure;

[0013] Figure 2 is a flowchart of another embodiment of the table information extraction method according to the present disclosure;

[0014] Figure 3 is a structural schematic diagram of a type prediction model;

[0015] Figure 4 is a structural schematic diagram of one embodiment of the table information extraction device according to the present disclosure;

[0016] Figure 5 is a block diagram of an electronic device for implementing the table information extraction method of the embodiments of the present disclosure. DETAILED DESCRIPTION

[0017] The exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to help understanding. They should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures.

[0018] It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0019] Figure 1 Flow 100 shows one embodiment of the table information extraction method according to the present disclosure. The table information extraction method includes the following steps:

[0020] Step 101: Extract the key-value pairs from the table.

[0021] In this embodiment, the execution body of the table information extraction method can extract key-value pairs from the table.

[0022] In this embodiment, the table is typically organized as a two-dimensional matrix. A table organized as a two-dimensional matrix does not contain merged cells, only basic cells, and the position of each cell can be represented by a two-dimensional array. It should be noted that if the table is organized as a two-dimensional matrix, the key-value pairs can be directly extracted; if the table is not organized as a two-dimensional matrix, it is first processed into a two-dimensional matrix before extracting the key-value pairs. Specifically, if the table contains merged cells, the merged cells need to be separated into individual basic cells, and the same content needs to be filled into each basic cell. Additionally, blank rows or columns will be cleared.

[0023] In this embodiment, the aforementioned execution entity can process a table organized in a two-dimensional matrix format into key-value pairs in JSON (JavaScript Object Notation) format. Typically, clustering is performed based on the features of multiple rows and / or columns of cells in the table to determine candidate header cells. Based on these candidate header cells, information is extracted from the table, thus obtaining the key-value pairs. Clustering can include row-based feature clustering based on cells within rows and column-based feature clustering based on cells within columns.

[0024]

[0025] Table (1)

[0026] Taking Table (1) as an example, information is extracted from the table, resulting in the following key-value pairs:

[0027] {

[0028] "Serial Number": "1"

[0029] Project Name: Tightness

[0030] Unit: "g / cm3"

[0031] "Indicator Value": {

[0032] "Irregularly shaped parts": "0.70-1.00"

[0033] "Molded parts": "1.00-1.25"

[0034] “Structural parts”: “1.10-1.35”},

[0035] “Experimental method”: “GB / T 19264.2-2013 Chapter 6”}

[0036] {

[0037] “Serial number”: “2,

[0038] “Project name”: “Moisture”,

[0039] “Unit”: “%”,

[0040] “Index value”: {

[0041] “Special-shaped parts”: “≤6.0”,

[0042] “Molded parts”: “≤6.0”,

[0043] “Structural parts”: “≤4.0”},

[0044] “Experimental method”: “GB / T 19264.2-2013 Chapter 13”}

[0045] Step 102, serializing the key-value pair to generate serialized data.

[0046] In this embodiment, the execution subject described above can serialize the key-value pair to generate serialized data.

[0047] The serialized data can be a string. Generally, a key-value pair result can be processed into a string. Taking the first key-value pair result in step 101 as an example, it can be processed into: ‘Serial number: 1, Project name: Tightness, Unit: g / cm 3 , Index value: Special-shaped parts: 0.07-1.00, Index value: Molded parts: 1.00-1.25, Index value: Structural parts: 1.10-1.35, Experimental method: GB / T19264.2-2013 Chapter 6’.

[0048] Step 103, generating a path from the key in the key-value pair to the value in the key-value pair.

[0049] In this embodiment, the execution subject described above can generate a path from the key in the key-value pair to the value in the key-value pair. The path starts with the key in the key-value pair and ends with the value in the key-value pair. When the key is multi-level, it needs to be combined in order.

[0050] Taking the table in step 101 as an example, there are 6 paths starting with the index value, which are:

[0051] 1. Index value: Special-shaped parts: 0.70-1.00;

[0052] 2. Indicator value: profiled part: ≤ 6.0;

[0053] 3. Indicator value: molded part: 1.00-1.25;

[0054] 4. Indicator value: molded part: ≤ 6.0;

[0055] 5. Indicator value: structural part: 1.10-1.35;

[0056] 6. Indicator value: structural part: ≤ 4.0.

[0057] Step 104, predicting the type of the path based on the serialized data and the path.

[0058] In the embodiment, the above execution subject can predict the type of the path based on the serialized data and the path.

[0059] Wherein, the types of the cells can include but are not limited to: entity (S) type, attribute (P) type, attribute value (O) type, constraint condition (adv) type, constraint condition_value (adv_key) type, attribute_constraint_attribute value (P_adv_O) type, etc. Correspondingly, the types of the paths can include but are not limited to: entity (S) type, attribute (P) type, constraint condition (adv) type, attribute_constraint_attribute value (P_adv_O) type and other (other) type, etc.

[0060] Generally, according to the relative positions between different types of cells in the path, the type of the path can be determined. Specifically:

[0061] 1. Entity type: the last item of the path corresponds to a cell of entity type.

[0062] 2. Attribute type: the last item of the path corresponds to a cell of attribute type.

[0063] 3. Constraint condition type: the last item of the path corresponds to a cell of constraint condition type, the remaining items describe the type of the condition (adv_key), and can have a hierarchical relationship.

[0064] 4. Attribute_constraint_attribute value type: the last item of the path corresponds to a cell of attribute value type, identifies the cell of constraint condition type in the path, and the remaining items are cells of attribute type. Taking the table in step 101 as an example, the 6 paths starting from the indicator value all belong to the attribute_constraint_attribute value type.

[0065] 5. Other type: the path composed of any one type of cells of entity, attribute, attribute value and constraint condition.

[0066] For example, the path of the first column in Table (1) belongs to other types, such as, for example, the serial number: 1. The path of the second column in the table belongs to the attribute type, such as, for example, the item name: tightness. The path of the third column in the table belongs to the attribute_constraint_attribute_value type, such as, for example, the unit: g / cm 3 .

[0067]

[0068] Table (2)

[0069] For example, the path of the first two columns in Table (2) belongs to the constraint condition type, such as, for example, the test item: electrical strength. The path of the last two columns in the table belongs to the attribute_constraint_attribute_value type, such as, for example, the standard value: >= 70kv.

[0070]

[0071] Table (3)

[0072] For example, the path of the first column in Table (3) belongs to the entity type, such as, for example, the transformer type: medium transformer (cooling mode ONAN or ONAF). The path of the second column in the table belongs to the constraint condition type, such as, for example, the load coefficient K1 before first-aid load: 0.7.

[0073] In step 105, the structured data of the table is generated based on the type of the path in the table.

[0074] In this embodiment, the above execution subject can generate the structured data of the table based on the type of the path in the table.

[0075] Generally, the relative positions between various types of cells can be determined according to the types of the paths, and the structured data of the table can be obtained by combining information according to the relative positions between the cells. The content of the structured data can include but is not limited to entities, attributes, attribute values, and constraint conditions, etc. For complex semantic knowledge in the table, a four-tuple including structured entities, attributes, attribute values, and constraint conditions can be used for representation, that is, (S, P, O, adv). Both S and adv can be empty, and P can be a simple string or a complex structure with levels.

[0076] The table information extraction method provided by the embodiments of the present disclosure can extract complex semantic relationships between various attributes in the table, so that the expression of knowledge is more complete. Analyzing the complex semantics in the table can express the information contained in the table completely and unambiguously, realizing deep understanding of the table, so as to better meet the needs of downstream applications such as graph construction, information retrieval, intelligent question answering, etc., and has wide application and landing prospects.

[0077] With reference to the foregoing Figure 2 FIG. 20 shows a flow 200 of still another embodiment of the table information extraction method according to the present disclosure. The table information extraction method comprises the following steps:

[0078] In step 201, key-value pairs in the table are extracted.

[0079] In step 202, the key-value pairs are serialized to generate serialized data.

[0080] In step 203, a path from a key in the key-value pair to a value in the key-value pair is generated.

[0081] In the present embodiment, the specific operations of steps 201-203 have been described in detail in the embodiment shown in steps 101-103, and will not be repeated here. Figure 1 In step 204, the serialized data and the path are input into a pre-trained type prediction model to obtain the type of the path.

[0082] In the present embodiment, the execution subject of the table information extraction method can input the serialized data and the path into the pre-trained type prediction model to obtain the type of the path.

[0083]

[0084] ​In practice, the input of the type prediction model can include the serialized data and the path, and the output can be the type of the path. The model structure of the type prediction model can include a pre-trained language model (PLM), a first fully connected layer (FC) and a second fully connected layer (FC). The embedding input of the pre-trained language model is summed by at least one of a token embedding, a segment embedding, a position embedding and a split embedding. Among them, the token embedding is the mapping of the token to the vocabulary. The segment embedding can distinguish two parts of the input. The position embedding can express the position of different tokens. The split embedding is because the serialized data is composed of multiple parts, and it is needed to help the model distinguish different parts. In order to improve the effect of the model, the type prediction model can be continuously optimized. The optimization target of the type prediction model is composed of two tasks, which are the path type prediction task and the extraction task of the condition in the path. The two tasks are executed by the first fully connected layer and the second fully connected layer. Specifically, the first fully connected layer can be used to predict the path type, and the second fully connected layer can be used to extract the constraint condition in the path. Based on the difference between the path type predicted by the first fully connected layer and the real path type, and the difference between the constraint condition extracted by the second fully connected layer and the real preset condition, the type prediction model is optimized to improve the model effect. Among them, the extraction task of the condition in the path can be designed as a sequence labeling task to label the start and end positions of various types of cells in the serialized data. The start and end positions of the condition in the serialized data are realized by prediction. That is, the start position and the end position of the labeled constraint condition are determined from the labeled serialized data, and the information between the two positions is extracted, that is, the constraint condition in the path is obtained.

[0085] For ease of understanding, Figure 3 The structure diagram of the type prediction model is shown. As Figure 3 shown, the type prediction model includes a PLM and two FCs. The input of the PLM is a path and serialized data. Among them, the path is: index value: special-shaped parts: 0.70-1.00. The serialized data is: serial number: 1, project name: tightness, unit: g / cm3, index value: special-shaped parts: 0.70-1.00, index value: die parts: 1.00-1.25, index value: structural parts: 1.10-1.35, experimental method: GB / T 19264.2-2013 Chapter 6. [SEP] and [CLS] are special characters in the model, [SEP] represents the interval of two sentences input, [CLS] is generally placed at the beginning and used to represent the features of the entire input. The output of the PLM is T [CLS], T1, T2…T m , T [SEP] , T'1, T'2…T' n . Wherein, T [CLS] represents the feature representation corresponding to [CLS] in the input. T represents token, T m represents the mth token of the first sentence of the input, and T' n represents the nth token of the second sentence of the input. Different, the input of the left FC is only T [CLS] , used for predicting the path type. The right FC is the entire output T [CLS] , T1, T2…T m , T [SEP] , T'1, T'2…T' n , used for predicting the start position and end position of the condition in the input.

[0086] Step 205, starting from the attribute value type cell in the table, find the attribute type and constraint condition type cells respectively, and constitute the structured data including attributes, attribute values and constraint conditions.

[0087] In the embodiment, the above execution subject can start from the attribute value (O) type cell in the table, find the attribute (P) type and constraint condition (adv) type cells respectively, and constitute the structured data including the attribute (P), attribute value (O) and constraint condition (adv). If there are attribute (P) type cells and attribute_constraint_attribute_value (P_adv_O) type cells at the same time, the structured data including the attribute (P) and attribute value (O) is constituted. For example, starting from the O type cell, find the P type and adv type cells to the left and up, and constitute P O adv; if there are P type (P1) and P_adv_O type (P2) cells at the same time, the two constitute a complex structure, which is generally expressed as {P1:{P2:O}}, and P is a complex structure at this time.

[0088] Step 206, starting from the constraint condition type cell that has been found, find the constraint condition_value type cell respectively, and constitute the structured data including the constraint condition and the value.

[0089] In the embodiment, the above execution subject can start from the constraint condition (adv) type cell that has been found, find the constraint condition_value (adv_key) type cell respectively, and constitute the structured data including the constraint condition (adv) and the value (key). For example, starting from the found adv type cell, find the adv_key type cell to the left and up, and constitute adv_key adv, which together constitute a structured adv.

[0090] Step 207, starting from the found cells of the attribute type, find the cells of the entity type respectively, to form the structured data including the entity and the attribute.

[0091] In the embodiment, the above execution subject can start from the found cells of the attribute (P) type, find the cells of the entity (S) type respectively, to form the structured data including the entity (S) and the attribute (P). For example, starting from the found cells of the P type, find the cells of the S type in the table to the left and up, to form S P.

[0092] Step 208, combine the structured data including the attribute, the attribute value and the constraint condition, the structured data including the constraint condition and the value, and the structured data including the entity and the attribute, to generate the structured data of the table.

[0093] In the embodiment, the above execution subject can combine the structured data including the attribute (P), the attribute value (O) and the constraint condition (adv), the structured data including the constraint condition (adv) and the value (key), and the structured data including the entity (S) and the attribute (P), to generate the structured data of the table. For example, combine the found P O adv, adv_key adv and S P, to obtain the (S, P, O, adv) four-tuple.

[0094] From Figure 2 , it can be seen that, compared with Figure 1 the corresponding embodiment, the flow 200 of the table information extraction method in the embodiment highlights the path type prediction step and the structured data generation step. Thus, the scheme described in the embodiment provides a table complex semantic parsing method based on a deep learning model, aiming to realize the parsing of complex semantics with conditional constraints in the table, and parse the table into structured complete knowledge according to semantics. The method has low requirements for input data, can process most of the common tables in reality, has a wide range of use scenarios, and can cope with semantic parsing of most common tables. The method can complete the parsing of simple semantics and complex semantics at the same time, and has flexibility and universality. Moreover, the method can help the downstream to complete more complex tasks, such as conditional reasoning.

[0095] Further referring to Figure 4 , as an implementation of the method shown in the above figures, the disclosure provides an embodiment of a table information extraction device, which corresponds to the method embodiment shown in Figure 1 . The device can be specifically applied in various electronic devices.

[0096] As Figure 4As shown, the table information extraction device 400 in this embodiment can include an extraction module 401, a serialization module 402, a generation module 403, a prediction module 404, and a lookup module 405. Among them, the extraction module 401 is configured to extract key-value pairs in the table; the serialization module 402 is configured to perform serialization processing on the key-value pairs to generate serialized data; the generation module 403 is configured to generate a path from a key in the key-value pair to a value in the key-value pair; the prediction module 404 is configured to predict the type of the path based on the serialized data and the path; and the lookup module 405 is configured to look up in the table based on the type of the path to generate structured data of the table.

[0097] In this embodiment, the specific processing of the extraction module 401, the serialization module 402, the generation module 403, the prediction module 404, and the lookup module 405 in the table information extraction device 400 and the technical effects brought by them can be referred to Figure 1 The related description of steps 101-105 in the corresponding embodiment will not be repeated here.

[0098] In some optional implementation manners of this embodiment, the prediction module 404 is further configured to input the serialized data and the path into a pre-trained type prediction model to obtain the type of the path.

[0099] In some optional implementation manners of this embodiment, the type prediction model includes a pre-trained language model, a first fully connected layer, and a second fully connected layer, an embedding input by the pre-trained language model is obtained by summing at least one of token embedding, segment embedding, position embedding, and separation embedding, the first fully connected layer is used to predict the path type, and the second fully connected layer is used to extract a constraint condition in the path.

[0100] In some optional implementation manners of this embodiment, the type of the path includes at least one of the following: an entity type, an attribute type, a constraint condition type, an attribute_constraint_condition_attribute value type, and other types, and the content of the structured data includes at least one of the following: an entity, an attribute, an attribute value, and a constraint condition.

[0101] In some optional implementation manners of this embodiment, the lookup module 405 includes a lookup submodule configured to determine the relative positions between cells of various types according to the type of the path, and combine information according to the relative positions to obtain the structured data of the table.

[0102] In some optional implementation forms of the embodiment, the searching submodule comprises: a first searching unit configured to search, from the cell of the attribute value type in the table, the cells of the attribute type and the constraint condition type respectively, to form the structured data comprising the attribute, the attribute value and the constraint condition; a second searching unit configured to search, from the searched cell of the constraint condition type, the cell of the constraint condition_value type respectively, to form the structured data comprising the constraint condition and the value; a third searching unit configured to search, from the searched cell of the attribute type, the cell of the entity type respectively, to form the structured data comprising the entity and the attribute; and a combining unit configured to combine the structured data comprising the attribute, the attribute value and the constraint condition, the structured data comprising the constraint condition and the value, and the structured data comprising the entity and the attribute, to generate the structured data of the table.

[0103] In some optional implementation forms of the embodiment, the first searching unit is further configured to, if the cell of the attribute type and the cell of the attribute_constraint_condition_attribute_value type exist simultaneously, form the structured data comprising the attribute and the attribute value.

[0104] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of the user personal information involved in the technical solution comply with the relevant laws and regulations and do not violate public order and good customs.

[0105] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0106] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.

[0107] As Figure 5As shown, the device 500 includes a computing unit 501 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0108] A plurality of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0109] The computing unit 501 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs various methods and processes described above, such as the table information extraction method. For example, in some embodiments, the table information extraction method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the table information extraction method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the table information extraction method by any other appropriate means, such as by means of firmware.

[0110] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0111] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0112] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0113] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0114] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0115] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server is generally established by computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of distributed systems, or servers combined with blockchains.

[0116] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without departing from the desired results provided by the technical solutions of the present disclosure, and this is not limited herein.

[0117] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above.

Claims

1. A table information extraction method, comprising: extracting key-value pairs in a table; serializing the key-value pairs to generate serialized data; generating a path from a key in the key-value pairs to a value in the key-value pairs; inputting the serialized data and the path into a pre-trained type prediction model to obtain a type of the path, the type prediction model comprising a pre-trained language model, a first fully connected layer, and a second fully connected layer, an embedding input to the pre-trained language model being obtained by summing at least one of a token embedding, a segment embedding, a position embedding, and a separation embedding, the first fully connected layer being used to predict a path type, and the second fully connected layer being used to extract a constraint condition in the path; based on the type of the path, searching in the table to generate structured data of the table.

2. The method of claim 1, wherein, The type of the path includes at least one of an entity type, an attribute type, a constraint condition type, an attribute_constraint_condition_attribute value type, and other types, and the content of the structured data includes at least one of an entity, an attribute, an attribute value, and a constraint condition.

3. The method of claim 2, wherein, The generating of the structured data of the table based on the type of the path includes: determining relative positions among various types of cells in the table according to the type of the path, and combining information according to the relative positions to obtain the structured data of the table.

4. The method of claim 3, wherein, The determining of the relative positions among various types of cells in the table according to the type of the path includes: starting from an attribute value type cell in the table, respectively searching for an attribute type cell and a constraint condition type cell to form structured data including an attribute, an attribute value, and a constraint condition; starting from a constraint condition type cell that has been searched, respectively searching for a constraint condition_value type cell to form structured data including a constraint condition and a value; starting from an attribute type cell that has been searched, respectively searching for an entity type cell to form structured data including an entity and an attribute; combining the structured data including the attribute, the attribute value, and the constraint condition, the structured data including the constraint condition and the value, and the structured data including the entity and the attribute to generate the structured data of the table.

5. The method of claim 4, wherein, The starting from the attribute value type cell in the table, respectively searching for the attribute type cell and the constraint condition type cell to form the structured data including the attribute, the attribute value, and the constraint condition includes: if an attribute type cell and an attribute_constraint_condition_attribute value type cell exist at the same time, forming structured data including an attribute and an attribute value.

6. A table information extraction apparatus, comprising: an extraction module configured to extract key-value pairs in a table; a serialization module configured to serialize the key-value pairs to generate serialized data; a generation module configured to generate a path from a key in the key-value pairs to a value in the key-value pairs; The prediction module is configured to input the serialized data and the path into a pre-trained type prediction model to obtain a type of the path, the type prediction model comprising a pre-trained language model, a first fully connected layer, and a second fully connected layer, an input embedding of the pre-trained language model being obtained by summing at least one of a token embedding, a segment embedding, a position embedding, and a separator embedding, the first fully connected layer being used to predict a path type, and the second fully connected layer being used to extract a constraint condition in the path. The searching module is configured to search in the table based on the type of the path to generate structured data of the table.

7. The apparatus of claim 6, wherein, The type of the path comprises at least one of an entity type, an attribute type, a constraint condition type, an attribute_constraint_condition_attribute value type, and another type, and content of the structured data comprises at least one of an entity, an attribute, an attribute value, and a constraint condition.

8. The apparatus of claim 7, wherein, The searching module comprises: A searching sub-module configured to determine relative positions among cells of various types in the table according to the type of the path, and to combine information according to the relative positions to obtain the structured data of the table.

9. The apparatus of claim 8, wherein, The searching sub-module comprises: A first searching unit configured to start from a cell of the attribute value type in the table, search cells of the attribute type and the constraint condition type respectively, and compose structured data comprising an attribute, an attribute value, and a constraint condition; A second searching unit configured to start from a cell of the constraint condition type that has been searched, search cells of a constraint condition_value type respectively, and compose structured data comprising a constraint condition and a value; A third searching unit configured to start from a cell of the attribute type that has been searched, search cells of the entity type respectively, and compose structured data comprising an entity and an attribute; A combining unit configured to combine the structured data comprising the attribute, the attribute value, and the constraint condition, the structured data comprising the constraint condition and the value, and the structured data comprising the entity and the attribute to generate the structured data of the table.

10. The apparatus of claim 9, wherein, The first searching unit is further configured to: If the cell of the attribute type and the cell of the attribute_constraint_condition_attribute value type exist at the same time, compose structured data comprising the attribute and the attribute value. 11.An electronic device comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5. 12.A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-5. 13.A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1-5. ​

Citation Information

Patent Citations

  • Entity and relationship extraction method for unstructured form document

    CN111274327A