A document information extraction method, device, equipment and storage medium thereof

Through node information extraction and document structure analysis, feature vector representations are generated and document graphs are constructed. Document information extraction is performed using GraphSAGE and BiLSTM-CRF models, which solves the problem of high computing power consumption in the existing technology and achieves fast and accurate document information. Extraction.

CN118627501BActive Publication Date: 2024-10-29HUNAN JIULI SUPPLY CHAIN CO LTD

Patent Information

Application Number
CN202411114130.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-10-29
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

Existing graph reconstruction methods are based on fully connected graphs and distance sampling methods, which consume a lot of computing power and cannot extract document information quickly and accurately.

Method used

Using node information extraction and document structure analysis, serialization processing and feature extraction are used to generate feature vector representations to construct document graphs, and the pre-trained GraphSAGE model is used to reconstruct the document graph and BiLSTM-CRF network for decoding to achieve document information extraction. .

Benefits of technology

No annotation is required, which saves annotation consumption, reduces computing resource consumption, and achieves fast, accurate and automated document information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627501B_ABST
    Figure CN118627501B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of information extraction technology, and relates to a document information extraction method, device, equipment and storage medium thereof, including node information extraction and document structure analysis of a target document; serialization processing of all node information; feature extraction of a target sequence; construction of a graph node representation based on the feature vector representation of all node information; inputting all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputting the reconstructed document graph into a preset decoding model for decoding, and completing the extraction of document information from the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a large amount of computing resources, achieving fast, accurate and automatic extraction of document information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of information extraction, and in particular to a document information extraction method, device, equipment and storage medium thereof. Background Art

[0002] With the development of informatization and digitalization, structured analysis and content extraction of documents, images and other contents have become key parts of the digital transformation of various industries. Moreover, automatic, accurate and fast information processing is the key to improving productivity. The use of manual methods to process these documents has great limitations, such as high time consumption, high labor intensity, low precision and low repeatability.

[0003] With the development of artificial intelligence technology, it is becoming more and more common to use machine learning to assist information processing. At present, there are mainly graph reconstruction based on the GCN graph neural network architecture. However, the existing graph reconstruction methods are mainly based on the full connection graph, distance sampling and other methods to define the edge. After that, the graph is reconstructed based on the edge definition results and nodes. However, the semantic features and image feature fusion of the entity node in the original document are often missing, and some original text and image information will be missing when defining edge features. In addition, the use of fully connected graphs and distance sampling methods consumes a lot of computing resources, which is not conducive to the rapid and accurate extraction of document information. Summary of the invention

[0004] The purpose of the embodiments of the present application is to propose a document information extraction method, device, equipment and storage medium thereof to solve the problem that the existing technology uses a fully connected graph and a distance sampling method, which consumes a large amount of computing resources and is not conducive to the fast and accurate extraction of document information.

[0005] In order to solve the above technical problems, the present application embodiment provides a document information extraction method, which adopts the following technical solution:

[0006] A document information extraction method comprises the following steps:

[0007] Extract node information and parse document structure of target document to obtain node information and document structure;

[0008] Serialize all node information according to the document structure to obtain a target sequence;

[0009] Inputting the target sequence and the document structure into a preset coding model for feature extraction to obtain a feature vector representation of all node information;

[0010] Constructing a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure;

[0011] Inputting all graph node representations into a preset document graph reconstruction model to reconstruct the document graph, and obtaining a reconstructed document graph output by the document graph reconstruction model, wherein the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE;

[0012] The reconstructed document graph is input into a preset decoding model for decoding to complete the extraction of document information in the target document, wherein the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

[0013] Furthermore, the step of extracting node information and parsing the document structure of the target document to obtain the node information and document structure specifically includes:

[0014] Acquire all node information contained in the target document through a preset document recognition component or a preset document parsing component, wherein the node information refers to all content blocks that need to be acquired from the target document, and the content blocks include text content blocks and non-text content blocks;

[0015] Mapping the target document into a preset two-dimensional virtual coordinate system, and identifying the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system according to the mapping result;

[0016] Representing the rectangular boxes where all the node information is located and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system as the parsed document structure;

[0017] The step of serializing all node information according to the document structure to obtain a target sequence specifically includes:

[0018] According to the coordinate information of all rectangular boxes in the two-dimensional virtual coordinate system and the rectangular boxes where all node information is located, all node information is sorted according to the arrangement rules from left to right and from top to bottom, and the sorting result is obtained as the target sequence;

[0019] The preset coding model is a language coding model based on the Transformer network architecture. The step of inputting the target sequence and the document structure into the preset coding model for feature extraction to obtain a feature vector representation of all node information specifically includes:

[0020] Identifying sequence position information of all the node information in the target sequence respectively, and generating a node number based on the sequence position information;

[0021] Based on the node number, the rectangular boxes where all the node information is located, the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system and the preset feature vector representation method, the feature vector representation of all the node information is generated one by one.

[0022] Furthermore, the step of constructing a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure specifically includes:

[0023] Cache the feature vector representations of all the node information into a preset ordered set based on the node numbers one by one to obtain a feature vector representation set;

[0024] Based on a preset orientation information identification strategy, the rectangular boxes where all node information is located, and the coordinate information of all rectangular boxes in the two-dimensional virtual coordinate system, the orientation information between any two rectangular boxes is identified;

[0025] Determine the adjacency relationship between all nodes according to the position information, and determine the nearest nodes of all nodes according to the position information and the adjacency relationship;

[0026] According to the nearest nodes of all nodes, the nearest edge connection is performed to obtain the edge representation between nodes;

[0027] Based on the feature vector representation set and the edge representations between the nodes, a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph are constructed.

[0028] Furthermore, the step of identifying the position information between any two rectangular boxes based on the preset position information identification strategy, the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system specifically includes:

[0029] Randomly select two nodes from all nodes, wherein the two nodes are a direction reference node and a direction prediction node respectively;

[0030] According to the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system, the center coordinate information of the rectangular box corresponding to the direction reference node and the center coordinate information of the rectangular box corresponding to the direction prediction node are identified;

[0031] Taking the center coordinate information of the rectangular frame corresponding to the direction reference node as the coordinate origin, dividing the 360-degree radiation area around it into a preset number of common areas according to a fixed angle, and taking the rectangular frame corresponding to the direction reference node as a special area, and distinguishing and numbering the preset number of common areas and the one special area;

[0032] According to the rectangular box corresponding to the direction reference node and the rectangular box corresponding to the direction prediction node, determining the region distinction number of the direction prediction node relative to the direction reference node, and calculating the center coordinate distance between the direction prediction node and the direction reference node by a preset distance calculation method;

[0033] Based on the area distinction number of the direction prediction node relative to the direction reference node, the center coordinate distance between the direction prediction node and the direction reference node, and a preset direction information representation method, the direction information between the direction reference node and the direction prediction node is represented.

[0034] Furthermore, the step of determining the region distinction number of the directional prediction node relative to the directional reference node according to the rectangular frame corresponding to the directional reference node and the rectangular frame corresponding to the directional prediction node specifically includes:

[0035] Determine the rectangular box area corresponding to the direction reference node and the rectangular box area corresponding to the direction prediction node through the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system;

[0036] Determine whether the rectangular box area corresponding to the direction reference node and the rectangular box area corresponding to the direction prediction node are in a completely contained relationship or are in a completely contained relationship;

[0037] If yes, the region distinction number of the direction prediction node relative to the direction reference node is the region distinction number corresponding to the special region;

[0038] If not, the coordinate information is used to calculate the regional center coordinates of the rectangular box area corresponding to the direction reference node and the regional center coordinates of the rectangular box area corresponding to the direction prediction node, and the angle value between the line between the two regional center coordinates and the horizontal coordinate line is calculated through a preset angle algorithm. According to the angle value, the common area where the direction prediction node is located relative to the direction reference node is determined, and the regional distinction number corresponding to the common area is obtained.

[0039] Furthermore, the step of inputting all graph node representations into a preset document graph reconstruction model to reconstruct the document graph and obtaining a reconstructed document graph output by the document graph reconstruction model specifically includes:

[0040] According to the graph neural network and a preset node feature fusion formula, node feature fusion is performed on all graph nodes respectively to obtain representations of all graph nodes after feature fusion;

[0041] Based on the graph neural network and a preset direction prediction formula, predict the direction probability value between any two graph nodes;

[0042] Predicting the distance value between any two graph nodes according to the graph neural network and a preset distance prediction formula;

[0043] According to the direction probability value, the maximum probability direction predicted by the graph neural network is selected as the target direction;

[0044] Based on the target direction and the distance value, a document graph is reconstructed to obtain a reconstructed document graph output by the document graph reconstruction model.

[0045] Furthermore, before executing the step of reconstructing the document graph based on the target direction and the distance value to obtain the reconstructed document graph output by the document graph reconstruction model, the method further includes:

[0046] Grouping and sorting the target directions and the distance values ​​according to the node numbers to obtain a grouping and sorting result;

[0047] Input the grouping result and the orientation information between any two rectangular frames as comparison parameters into a preset loss function to calculate the loss degree, and obtain a loss value;

[0048] If the loss value exceeds the preset loss threshold, the preset loss function is tuned by adjusting the hyperparameters of the graph neural network, and the target direction, the distance value and the loss value are re-obtained and calculated until the loss value does not exceed the preset loss threshold. Then, the document graph is reconstructed based on the target direction and the distance value.

[0049] In order to solve the above technical problems, the embodiment of the present application also provides a document information extraction device, which adopts the following technical solution:

[0050] A document information extraction device, comprising:

[0051] The document processing module is used to extract node information and parse the document structure of the target document to obtain node information and document structure;

[0052] A serialization processing module is used to serialize all node information according to the document structure to obtain a target sequence;

[0053] A feature extraction module, used to input the target sequence and the document structure into a preset coding model for feature extraction, and obtain a feature vector representation of all node information;

[0054] A graph node construction module, used to construct a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure;

[0055] A document graph reconstruction module, used to input all graph node representations into a preset document graph reconstruction model, perform document graph reconstruction, and obtain a reconstructed document graph output by the document graph reconstruction model, wherein the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE;

[0056] The decoding and extraction module is used to input the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document, wherein the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

[0057] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0058] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the document information extraction method described above when executing the computer-readable instructions.

[0059] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0060] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the document information extraction method as described above.

[0061] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0062] The document information extraction method described in the embodiment of the present application extracts node information and parses the document structure of the target document; serializes all node information according to the document structure; inputs the target sequence and the document structure into a preset coding model for feature extraction to obtain feature vector representations of all node information; constructs graph node representations corresponding to all node information in the document graph according to the feature vector representations of all node information and the document structure; inputs all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputs the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0064] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0065] Figure 2 A flowchart of an embodiment of a method for extracting document information according to the present application;

[0066] Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 201 is shown;

[0067] Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 203 is shown;

[0068] Figure 5 yes Figure 2 A flowchart of a specific embodiment of step 204 is shown;

[0069] Figure 6 yes Figure 5 A flowchart of a specific embodiment of step 502 is shown;

[0070] Figure 7 yes Figure 2 A flowchart of a specific embodiment of step 205 is shown;

[0071] Figure 8 A schematic diagram of the structure of an embodiment of a document information extraction device according to the present application;

[0072] Fig. 9 A schematic structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0074] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0075] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0076] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0077] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0078] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.

[0079] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0080] It should be noted that the document information extraction method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the document information extraction device is generally arranged in the server / terminal device.

[0081] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0082] Continue to refer Figure 2 , shows a flow chart of an embodiment of a document information extraction method according to the present application. The document information extraction method comprises the following steps:

[0083] Step 201, extract node information and parse the document structure of the target document to obtain node information and document structure.

[0084] Continue to refer Figure 3 , Figure 3 yes Figure 2 The flowchart of a specific embodiment of step 201 shown includes:

[0085] Step 301, obtaining all node information contained in a target document through a preset document recognition component or a preset document parsing component, wherein the node information refers to all content blocks that need to be obtained from the target document, and the content blocks include text content blocks and non-text content blocks;

[0086] In this embodiment, the preset document recognition component or the preset document parsing component may use an OCR optical recognition component for a target document in a picture format, and may use a PDF document parsing component for a target document in a PDF format. The text content block refers to a text information block in the target document, and the non-text content block refers to a picture, table, etc. in the target document.

[0087] Step 302, mapping the target document to a preset two-dimensional virtual coordinate system, identifying the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system according to the mapping result, wherein the coordinate information includes the coordinates of the upper left corner, the upper right corner, the lower left corner, and the lower right corner;

[0088] Step 303: Represent the rectangular boxes where all the node information is located and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system as the parsed document structure.

[0089] In this embodiment, node information extraction and document structure analysis are performed on the target document through a preset document recognition component or a preset document parsing component to obtain node information and document structure, thereby facilitating subsequent document graph reconstruction and document information extraction.

[0090] Step 202: Serialize all node information according to the document structure to obtain a target sequence.

[0091] In this embodiment, the step of serializing all node information according to the document structure to obtain the target sequence specifically includes: sorting all node information according to the coordinate information of all rectangular boxes in the two-dimensional virtual coordinate system and the rectangular boxes in which all node information are located, according to the arrangement rules from left to right and from top to bottom, to obtain the sorting result as the target sequence.

[0092] In this embodiment, by serializing all node information, it is convenient to subsequently use an encoding model, a document graph reconstruction model, and a decoding model to perform secondary processing on the node information.

[0093] Step 203: input the target sequence and the document structure into a preset coding model for feature extraction to obtain a feature vector representation of all node information.

[0094] In this embodiment, the preset encoding model is a language encoding model based on the Transformer network architecture.

[0095] Continue to refer Figure 4 , Figure 4 yes Figure 2The flowchart of a specific embodiment of step 203 shown includes:

[0096] Step 401, identifying the sequence position information of all the node information in the target sequence, and generating a node number based on the sequence position information;

[0097] Step 402 , based on the node number, the rectangular boxes where all the node information is located, the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system and the preset feature vector representation method, generate feature vector representations of all the node information one by one.

[0098] In this embodiment, the step of generating the feature vector representation of all the node information one by one based on the node number, the rectangular boxes where all the node information is located, the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system, and the preset feature vector representation method specifically includes:

[0099] According to the feature vector representation:

[0100] ;

[0101] represents the feature vectors corresponding to all the node information, where i represents the node number, Represents the "XOR" logical operation, , Indicates the node information corresponding to the node number i. represents the semantic encoding function, express The semantic features output after semantic encoding by the preset encoding model, middle Indicates the corresponding parameters passed into the function. , express The height of the rectangular frame. express The width of the rectangle. represents the embedding layer function, express The embedding layer features output after being processed by the embedding layer of the preset encoding model, and stated It can be calculated from the coordinates of the upper left corner, the upper right corner, the lower left corner and the lower right corner of the rectangular frame. middle Represents the corresponding parameters passed into the function.

[0102] Through the language encoding model based on the Transformer network architecture, the semantic features and embedded features of all node information are extracted, and the corresponding feature vector representation is generated according to the semantic features and embedded features, wherein the embedded features include at least position features, so as to facilitate the subsequent generation of graph node representation according to the feature vector representation, and further ensure the reconstruction of the document graph.

[0103] Step 204 , constructing a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representations of all node information and the document structure.

[0104] Continue to refer Figure 5 , Figure 5 yes Figure 2 The flowchart of a specific embodiment of step 204 shown includes:

[0105] Step 501, caching the feature vector representations of all the node information into a preset ordered set based on the node numbers, to obtain a feature vector representation set;

[0106] Step 502, identifying the orientation information between any two rectangular boxes based on a preset orientation information identification strategy, the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system;

[0107] Continue to refer Figure 6 , Figure 6 yes Figure 5 The flowchart of a specific embodiment of step 502 shown includes:

[0108] Step 601, randomly selecting two nodes from all nodes, wherein the two nodes are a direction reference node and a direction prediction node respectively;

[0109] Step 602, identifying the center coordinate information of the rectangular box corresponding to the direction reference node and the center coordinate information of the rectangular box corresponding to the direction prediction node according to the rectangular boxes where all the node information is located and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system;

[0110] Step 603, taking the center coordinate information of the rectangular frame corresponding to the direction reference node as the coordinate origin, dividing the surrounding 360-degree radiation area into a preset number of common areas according to a fixed angle, and taking the rectangular frame corresponding to the direction reference node as a special area, and distinguishing and numbering the preset number of common areas and the one special area;

[0111] Specifically, assuming that the fixed angle is 45 degrees, the number of ordinary areas is 8. If the fixed angle is 30 degrees, the number of ordinary areas is 12. Of course, the more ordinary areas there are, that is, the smaller the fixed angle is, the more conducive to the accuracy of document image reconstruction.

[0112] Correspondingly, the central coordinate information of the rectangular frame corresponding to the direction reference node is used as the coordinate origin, and the 360-degree radiation area around it is divided into eight ordinary areas at 45 degrees, and the rectangular frame corresponding to the direction reference node is used as a special area, and the eight ordinary areas and the one special area are numbered differently.

[0113] Step 604, determining the region distinction number of the directional prediction node relative to the directional reference node according to the rectangular box corresponding to the directional reference node and the rectangular box corresponding to the directional prediction node, and calculating the center coordinate distance between the directional prediction node and the directional reference node by a preset distance calculation method;

[0114] In this embodiment, the step of determining the regional distinction number of the directional prediction node relative to the directional reference node according to the rectangular frame corresponding to the directional reference node and the rectangular frame corresponding to the directional prediction node specifically includes: determining the rectangular frame area corresponding to the directional reference node and the rectangular frame area corresponding to the directional prediction node through the coordinate information of all the rectangular frames in the two-dimensional virtual coordinate system; judging whether the rectangular frame area corresponding to the directional reference node and the rectangular frame area corresponding to the directional prediction node are in a complete inclusion relationship or a completely included relationship; if so, the regional distinction number of the directional prediction node relative to the directional reference node is the regional distinction number corresponding to the special area; if not, calculating the regional center coordinates of the rectangular frame area corresponding to the directional reference node and the regional center coordinates of the rectangular frame area corresponding to the directional prediction node respectively through the coordinate information, and calculating the angle value between the connecting line between the two regional center coordinates and the horizontal coordinate line through a preset angle algorithm, determining the ordinary area where the directional prediction node is located relative to the directional reference node according to the angle value, and obtaining the regional distinction number corresponding to the ordinary area.

[0115] Specifically, the angle value between the line connecting the two regional center coordinates and the horizontal coordinate line is calculated, that is, the angle value between the line connecting the regional center coordinates of the rectangular frame area corresponding to the direction reference node and the regional center coordinates of the rectangular frame area corresponding to the direction prediction node and the horizontal coordinate line is calculated.

[0116] Specifically, if it is determined that the rectangular box area corresponding to the directional reference node and the rectangular box area corresponding to the directional prediction node are in a complete containment relationship or a completely contained relationship, the area distinction number corresponding to the special area is directly set to the area distinction number of the directional prediction node relative to the directional reference node, thereby avoiding the inability to reconstruct completely overlapping node information when reconstructing the document graph, thereby ensuring the accuracy and completeness of the reconstruction.

[0117] Step 605, based on the area distinction number of the direction prediction node relative to the direction reference node, the center coordinate distance between the direction prediction node and the direction reference node, and a preset direction information representation method, the direction information between the direction reference node and the direction prediction node is represented.

[0118] In this embodiment, the step of indicating the direction information between the direction reference node and the direction prediction node based on the region distinction number of the direction prediction node relative to the direction reference node, the center coordinate distance between the direction prediction node and the direction reference node, and a preset direction information indication method specifically includes:

[0119] According to the preset position information representation method:

[0120] ;

[0121] represents the direction information between the direction reference node and the direction prediction node, wherein n and m represent the node numbers corresponding to the direction reference node and the direction prediction node respectively, Indicates the region distinction number where the direction prediction node is located relative to the direction reference node, Represents the center coordinate distance between the direction prediction node and the direction reference node.

[0122] In this embodiment, by adopting the geometric division method, the representation of the orientation information between nodes is converted into a combination of area distinction numbers and distance information. The previous method of directly using coordinate groups and distance information is no longer used, which simplifies the calculation steps during the subsequent reconstruction of the document graph and saves a certain amount of computing power resources.

[0123] Step 503, determining the adjacency relationship between all nodes according to the position information, and determining the nearest nodes of all nodes according to the position information and the adjacency relationship;

[0124] Step 504, performing nearest edge connection based on the nearest nodes of all nodes to obtain edge representation between nodes;

[0125] Step 505: construct a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph based on the feature vector representation set and the edge representations between the nodes.

[0126] In this embodiment, the document graph includes the feature vector representation corresponding to all node information and the edge representation between the nodes, and the graph node representation corresponding to the current node information includes the feature vector representation corresponding to the current node information and the edge representation between the current node and the nearest node.

[0127] Step 205: input all graph node representations into a preset document graph reconstruction model, perform document graph reconstruction, and obtain a reconstructed document graph output by the document graph reconstruction model.

[0128] In this embodiment, the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE, wherein the graph neural network GraphSAGE includes at least a feature input layer, a feature fusion layer, a hidden layer, a bilinear layer and a softmax output layer.

[0129] Continue to refer Figure 7 , Figure 7 yes Figure 2 The flowchart of a specific embodiment of step 205 shown includes:

[0130] Step 701, performing node feature fusion on all graph nodes respectively according to the graph neural network and a preset node feature fusion formula, and obtaining representations of all graph nodes after feature fusion;

[0131] Specifically, the step of performing node feature fusion on all graph nodes respectively according to the graph neural network and a preset node feature fusion formula to obtain representations of all graph nodes after feature fusion specifically includes:

[0132] According to the preset node feature fusion method:

[0133] ;

[0134] ;

[0135] Perform node feature fusion on all graph nodes to obtain representations of all graph nodes after feature fusion, where: represents the aggregation function of the kth layer of the graph neural network, represents the update function of the kth layer of the graph neural network, It represents the hidden representation of the graph node with node number i in the kth layer of the graph neural network. Correspondingly, is the initial representation of the graph node with node number i when it is input into the document graph reconstruction model, Indicates the fusion information of the adjacent graph nodes received by the graph node with node number i in the kth layer of the graph neural network, The set of adjacent graph nodes representing the graph node with node number i, after being calculated by each layer of the graph neural network, is represented as the graph node after being fused in the final layer of the graph neural network. , and Represents the corresponding parameters passed into the function.

[0136] Step 702, predicting the direction probability value between any two graph nodes based on the graph neural network and a preset direction prediction formula;

[0137] Specifically, the step of predicting the direction probability value between any two graph nodes based on the graph neural network and a preset direction prediction formula specifically includes:

[0138] According to the preset direction prediction formula:

[0139] ;

[0140] Predict the directional probability value between any two graph nodes, where represents the prediction function used by the softmax layer of the graph neural network, represents the linear function used by the first linear layer in the bilinear layer of the graph neural network, Indicates that the graph node with node number i is represented by the node output of the final layer of the graph neural network, Indicates that the graph node with node number j is represented by the node output of the final layer of the graph neural network, middle Represents the corresponding parameters passed into the function.

[0141] Specifically, the directional prediction formula is used to predict the directional probability value between any two graph nodes, that is, to predict the probability value of one graph node (A) relative to the other graph node (B) in different regional distinction numbers. Subsequently, based on the probability value of the graph node (A) relative to the other graph node (B) in different regional distinction numbers, the probability values ​​are compared to determine the final regional distinction number of the graph node (A) relative to the other graph node (B).

[0142] Step 703, predicting the distance value between any two graph nodes according to the graph neural network and a preset distance prediction formula;

[0143] Specifically, the step of predicting the distance value between any two graph nodes according to the graph neural network and the preset distance prediction formula specifically includes:

[0144] According to the preset distance prediction formula:

[0145] ;

[0146] Predict the distance value between any two graph nodes, where represents the prediction function used by the softmax layer of the graph neural network, represents the linear function used by the second linear layer in the bilinear layer of the graph neural network, Indicates that the graph node with node number i is represented by the node output of the final layer of the graph neural network, Indicates that the graph node with node number j is represented by the node output of the final layer of the graph neural network, and middle Represents the corresponding parameters passed into the function.

[0147] Step 704: According to the direction probability value, the maximum probability direction predicted by the graph neural network is selected as the target direction;

[0148] Step 705 , reconstructing a document graph based on the target direction and the distance value, and obtaining a reconstructed document graph output by the document graph reconstruction model.

[0149] In this embodiment, before executing the step of reconstructing the document graph based on the target direction and the distance value to obtain the reconstructed document graph output by the document graph reconstruction model, the method also includes: grouping and sorting the target direction and the distance value according to the node number to obtain a grouping result; inputting the grouping result and the orientation information between any two rectangular boxes as comparison parameters into a preset loss function to calculate the loss degree and obtain a loss value; if the loss value exceeds a preset loss threshold, tuning the preset loss function by adjusting the hyperparameters of the graph neural network, and re-obtaining the target direction, the distance value and performing the loss value calculation until the loss value does not exceed the preset loss threshold, and then reconstructing the document graph based on the target direction and the distance value.

[0150] In this embodiment, the preset loss function includes a direction prediction loss function, a distance prediction loss function and a joint loss function.

[0151] Specifically, the step of inputting the grouping result and the orientation information between any two rectangular boxes as comparison parameters into a preset loss function to calculate the loss degree and obtain the loss value specifically includes: obtaining all target directions in the grouping result and the area distinction numbers respectively contained in all the orientation information; grouping all the target directions and the area distinction numbers respectively contained in all the orientation information according to the node numbers, and inputting the grouping results as calculation parameters into the direction prediction loss function to calculate the direction prediction loss value;

[0152] And, obtaining all distance values ​​in the grouping result and the center coordinate distance between two nodes respectively included in all the orientation information; grouping all the distance values ​​and the center coordinate distance between two nodes respectively included in all the orientation information according to the node number, and inputting the grouping result as a calculation parameter into the distance prediction loss function to calculate the distance prediction loss value;

[0153] Subsequently, the calculated direction prediction loss value and distance prediction loss value are used as fitting parameters and input into the joint loss function to obtain the total loss value.

[0154] Specifically, weights may be set for the direction prediction loss value and the distance prediction loss value, for example, the direction prediction loss value is a, the distance prediction loss value is b, and the weight of the direction prediction loss value is , then the weight of the distance prediction loss value is , ensuring that the sum of the weights of the two is 1, then the total loss value c corresponding to the joint loss function is .

[0155] In this embodiment, the document graph is reconstructed by using the graph neural network GraphSAGE, and the document graph is reconstructed by combining direction prediction and distance prediction. Compared with the previous direct prediction using specific coordinate information, certain prediction steps and calculations are simplified, and computing power consumption is saved. Moreover, the reconstruction of the document graph also enhances the document graph to a certain extent, making it easier for the subsequent decoding model to accurately extract document information. In addition, after a large number of documents of the same type are parsed and document information is extracted by this method, as the number of documents of the same type increases, the location information of the node information expected to be extracted in the subsequent target document can be predicted directly through the previous document information extraction experience, and fixed-point extraction can be performed directly, which is convenient for rapid and accurate extraction of document information.

[0156] Step 206: input the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document.

[0157] In this embodiment, the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

[0158] This application extracts node information and parses the document structure of the target document; serializes all node information according to the document structure; inputs the target sequence and document structure into a preset encoding model for feature extraction to obtain feature vector representations of all node information; constructs graph node representations corresponding to all node information in the document graph based on the feature vector representations of all node information and the document structure; inputs all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputs the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information.

[0159] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0160] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0161] In the embodiment of the present application, the target document is subjected to node information extraction and document structure analysis; all node information is serialized according to the document structure; the target sequence and document structure are input into a preset coding model for feature extraction to obtain feature vector representations of all node information; the graph node representations corresponding to all node information in the document graph are constructed according to the feature vector representations of all node information and the document structure; all graph node representations are input into a preset document graph reconstruction model to reconstruct the document graph; the reconstructed document graph is input into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information.

[0162] Further references Figure 8 , as a response to the above Figure 2 The present application provides an embodiment of a document information extraction device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0163] like Figure 8 As shown, the document information extraction device 800 described in this embodiment includes: a document processing module 801, a serialization processing module 802, a feature extraction module 803, a graph node construction module 804, a document graph reconstruction module 805 and a decoding extraction module 806. Among them:

[0164] The document processing module 801 is used to extract node information and parse the document structure of the target document to obtain node information and document structure;

[0165] A serialization processing module 802 is used to perform serialization processing on all node information according to the document structure to obtain a target sequence;

[0166] A feature extraction module 803 is used to input the target sequence and the document structure into a preset coding model for feature extraction to obtain a feature vector representation of all node information;

[0167] A graph node construction module 804 is used to construct a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure;

[0168] The document graph reconstruction module 805 is used to input all graph node representations into a preset document graph reconstruction model to perform document graph reconstruction and obtain a reconstructed document graph output by the document graph reconstruction model, wherein the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE;

[0169] The decoding and extraction module 806 is used to input the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document, wherein the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

[0170] This application extracts node information and parses the document structure of the target document; serializes all node information according to the document structure; inputs the target sequence and document structure into a preset encoding model for feature extraction to obtain feature vector representations of all node information; constructs graph node representations corresponding to all node information in the document graph based on the feature vector representations of all node information and the document structure; inputs all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputs the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information.

[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0172] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0173] To solve the above technical problems, the present application also provides a computer device. Fig. 9 , Fig. 9 This is a basic structural block diagram of the computer device in this embodiment.

[0174] The computer device 9 includes a memory 9a, a processor 9b, and a network interface 9c that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 9 with a memory 9a, a processor 9b, and a network interface 9c, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0175] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0176] The memory 9a includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 9a can be an internal storage unit of the computer device 9, such as a hard disk or memory of the computer device 9. In other embodiments, the memory 9a can also be an external storage device of the computer device 9, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 9. Of course, the memory 9a can also include both the internal storage unit of the computer device 9 and its external storage device. In this embodiment, the memory 9a is generally used to store the operating system and various application software installed on the computer device 9, such as computer-readable instructions of the document information extraction method, etc. In addition, the memory 9a can also be used to temporarily store various types of data that have been output or are to be output.

[0177] The processor 9b may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 9b is generally used to control the overall operation of the computer device 9. In this embodiment, the processor 9b is used to run the computer-readable instructions stored in the memory 9a or process data, such as running the computer-readable instructions of the document information extraction method.

[0178] The network interface 9c may include a wireless network interface or a wired network interface. The network interface 9c is generally used to establish a communication connection between the computer device 9 and other electronic devices.

[0179] The computer device proposed in this embodiment belongs to the field of information extraction technology. This application extracts node information and parses the document structure of the target document; serializes all node information according to the document structure; inputs the target sequence and document structure into a preset coding model for feature extraction to obtain feature vector representations of all node information; constructs graph node representations corresponding to all node information in the document graph according to the feature vector representations and document structure of all node information; inputs all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputs the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information.

[0180] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by a processor to enable the processor to perform the steps of the document information extraction method as described above.

[0181] The computer-readable storage medium proposed in this embodiment belongs to the field of information extraction technology. This application extracts node information and parses the document structure of the target document; serializes all node information according to the document structure; inputs the target sequence and the document structure into a preset coding model for feature extraction to obtain feature vector representations of all node information; constructs graph node representations corresponding to all node information in the document graph according to the feature vector representations and document structure of all node information; inputs all graph node representations into a preset document graph reconstruction model to reconstruct the document graph; inputs the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document. The method of first encoding the target document, constructing graph nodes from document nodes, and then decoding to obtain document information essentially uses a self-supervised learning method to extract document information, which does not require annotation, saves annotation consumption, and at the same time saves a lot of computing resources, achieving fast, accurate and automatic extraction of document information.

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

[0183] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A document information extraction method, characterized in that: The steps include: Extracting node information and parsing the document structure of the target document to obtain node information and document structure, wherein the step of extracting node information and parsing the document structure of the target document to obtain node information and document structure specifically includes: Acquire all node information contained in the target document through a preset document recognition component or a preset document parsing component, wherein the node information refers to all content blocks that need to be acquired from the target document, and the content blocks include text content blocks and non-text content blocks; Mapping the target document into a preset two-dimensional virtual coordinate system, and identifying the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system according to the mapping result; Representing the rectangular boxes where all the node information is located and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system as the parsed document structure; Serializing all node information according to the document structure to obtain a target sequence, wherein the step of serializing all node information according to the document structure to obtain a target sequence specifically includes: According to the coordinate information of all rectangular boxes in the two-dimensional virtual coordinate system and the rectangular boxes where all node information is located, all node information is sorted according to the arrangement rules from left to right and from top to bottom, and the sorting result is obtained as the target sequence; Inputting the target sequence and the document structure into a preset coding model for feature extraction to obtain a feature vector representation of all node information, wherein the preset coding model is a language coding model based on a Transformer network architecture, and the step of inputting the target sequence and the document structure into a preset coding model for feature extraction to obtain a feature vector representation of all node information specifically includes: Identifying sequence position information of all the node information in the target sequence respectively, and generating node numbers based on the sequence position information; Based on the node number, the rectangular boxes where all the node information is located, the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system, and the preset feature vector representation method, generate feature vector representations of all the node information one by one; Constructing a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure; Inputting all graph node representations into a preset document graph reconstruction model to reconstruct the document graph, and obtaining a reconstructed document graph output by the document graph reconstruction model, wherein the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE; The reconstructed document graph is input into a preset decoding model for decoding to complete the extraction of document information in the target document, wherein the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

2. The document information extraction method according to claim 1, characterized in that: The step of constructing a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure specifically includes: Cache the feature vector representations of all the node information into a preset ordered set based on the node numbers one by one to obtain a feature vector representation set; Based on a preset orientation information identification strategy, the rectangular boxes where all node information is located, and the coordinate information of all rectangular boxes in the two-dimensional virtual coordinate system, the orientation information between any two rectangular boxes is identified; Determine the adjacency relationship between all nodes according to the position information, and determine the nearest nodes of all nodes according to the position information and the adjacency relationship; According to the nearest nodes of all nodes, the nearest edge connection is performed to obtain the edge representation between nodes; Based on the feature vector representation set and the edge representations between the nodes, a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph are constructed.

3. The document information extraction method according to claim 2, characterized in that: The step of identifying the orientation information between any two rectangular boxes based on the preset orientation information identification strategy, the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system specifically includes: Randomly select two nodes from all nodes, wherein the two nodes are a direction reference node and a direction prediction node respectively; According to the rectangular boxes where all the node information is located, and the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system, the center coordinate information of the rectangular box corresponding to the direction reference node and the center coordinate information of the rectangular box corresponding to the direction prediction node are identified; Taking the center coordinate information of the rectangular frame corresponding to the direction reference node as the coordinate origin, dividing the 360-degree radiation area around it into a preset number of common areas according to a fixed angle, and taking the rectangular frame corresponding to the direction reference node as a special area, and distinguishing and numbering the preset number of common areas and the one special area; According to the rectangular box corresponding to the direction reference node and the rectangular box corresponding to the direction prediction node, determining the region distinction number of the direction prediction node relative to the direction reference node, and calculating the center coordinate distance between the direction prediction node and the direction reference node by a preset distance calculation method; Based on the area distinction number of the direction prediction node relative to the direction reference node, the center coordinate distance between the direction prediction node and the direction reference node, and a preset direction information representation method, the direction information between the direction reference node and the direction prediction node is represented.

4. The document information extraction method according to claim 3, characterized in that: The step of determining the region distinction number of the directional prediction node relative to the directional reference node according to the rectangular frame corresponding to the directional reference node and the rectangular frame corresponding to the directional prediction node specifically includes: Determine the rectangular box area corresponding to the direction reference node and the rectangular box area corresponding to the direction prediction node through the coordinate information of all the rectangular boxes in the two-dimensional virtual coordinate system; Determine whether the rectangular box area corresponding to the direction reference node and the rectangular box area corresponding to the direction prediction node are in a completely contained relationship or are in a completely contained relationship; If yes, the region distinction number of the direction prediction node relative to the direction reference node is the region distinction number corresponding to the special region; If not, the coordinate information is used to calculate the regional center coordinates of the rectangular box area corresponding to the direction reference node and the regional center coordinates of the rectangular box area corresponding to the direction prediction node, and the angle value between the line between the two regional center coordinates and the horizontal coordinate line is calculated through a preset angle algorithm. According to the angle value, the common area where the direction prediction node is located relative to the direction reference node is determined, and the regional distinction number corresponding to the common area is obtained.

5. The document information extraction method according to claim 2, characterized in that: The step of inputting all graph node representations into a preset document graph reconstruction model, reconstructing the document graph, and obtaining a reconstructed document graph output by the document graph reconstruction model specifically includes: According to the graph neural network and a preset node feature fusion formula, node feature fusion is performed on all graph nodes respectively to obtain representations of all graph nodes after feature fusion; Based on the graph neural network and a preset direction prediction formula, predict the direction probability value between any two graph nodes; Predicting the distance value between any two graph nodes according to the graph neural network and a preset distance prediction formula; According to the direction probability value, the maximum probability direction predicted by the graph neural network is selected as the target direction; Based on the target direction and the distance value, a document graph is reconstructed to obtain a reconstructed document graph output by the document graph reconstruction model.

6. The document information extraction method according to claim 5, characterized in that: Before executing the step of reconstructing the document graph based on the target direction and the distance value to obtain the reconstructed document graph output by the document graph reconstruction model, the method further includes: Grouping and sorting the target directions and the distance values ​​according to the node numbers to obtain a grouping and sorting result; Input the grouping result and the orientation information between any two rectangular frames as comparison parameters into a preset loss function to calculate the loss degree, and obtain a loss value; If the loss value exceeds the preset loss threshold, the preset loss function is tuned by adjusting the hyperparameters of the graph neural network, and the target direction, the distance value and the loss value are re-obtained and calculated until the loss value does not exceed the preset loss threshold. Then, the document graph is reconstructed based on the target direction and the distance value.

7. A document information extraction device, characterized in that: The document information extraction device is used to implement the steps of the document information extraction method according to any one of claims 1 to 6, and the document information extraction device comprises: The document processing module is used to extract node information and parse the document structure of the target document to obtain node information and document structure; A serialization processing module is used to serialize all node information according to the document structure to obtain a target sequence; A feature extraction module, used to input the target sequence and the document structure into a preset coding model for feature extraction, and obtain a feature vector representation of all node information; A graph node construction module, used to construct a document graph corresponding to the target document and graph node representations corresponding to all node information in the document graph according to the feature vector representation of all node information and the document structure; A document graph reconstruction module, used to input all graph node representations into a preset document graph reconstruction model, perform document graph reconstruction, and obtain a reconstructed document graph output by the document graph reconstruction model, wherein the document graph reconstruction model is pre-trained by a graph neural network GraphSAGE; The decoding and extraction module is used to input the reconstructed document graph into a preset decoding model for decoding to complete the extraction of document information in the target document, wherein the preset decoding model is composed of a BiLSTM-CRF network layer architecture for information extraction tasks.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the document information extraction method according to any one of claims 1 to 6 when executing the computer-readable instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the document information extraction method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Generative conference abstracting method based on graph convolutional neural network

    CN111460132A

Cited By

  • Method and device for generating quotation sheet based on large language model

    CN119311698A