A method and system for extracting key information from sliced ​​documents using a single model

By merging named entity recognition and relationship extraction into one model, and using deep learning structures for end-to-end training, the problems of error propagation and poor adaptability in the existing technology are solved, and document information extraction with high precision and generalization capabilities is achieved.

CN113536797BActive Publication Date: 2024-10-01BEIJING YIDAO BOSHI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110807792.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2024-10-01
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

The existing technology suffers from performance degradation caused by error propagation and task separation in named entity recognition and relationship extraction, and has poor adaptability to different fields, making it difficult to effectively utilize the information structure in the document.

Method used

It combines named entity recognition and relationship extraction into one model, uses long and short memory networks and Transformer structures for end-to-end training and prediction, and integrates information structure features through table filling methods to achieve simultaneous extraction of entity types and relationships.

Benefits of technology

It improves the accuracy and generalization ability of information extraction, reduces model error propagation, simplifies engineering implementation, and adapts to various information structures of financial slice documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113536797B_ABST
    Figure CN113536797B_ABST
Patent Text Reader

Abstract

The present invention discloses a single-model extraction method and system for key information of sliced ​​documents, and relates to the field of computer vision. The method comprises: after encoding the input information, splicing and inputting it into the Transformer model, and outputting a spliced ​​feature vector; converting the spliced ​​feature vector into a feature vector corresponding to each value in a two-dimensional table, and obtaining a three-dimensional feature vector matrix X; inputting the three-dimensional feature vector matrix X into a multi-layer multi-dimensional long-short memory network with the same structure for encoding, and obtaining a table-encoded feature vector; classifying the table-encoded feature vector, and obtaining entities and the relationship between each entity. The scheme realizes end-to-end training and prediction, avoids the problem of error propagation caused by multiple models, and makes full use of the relationship between the two tasks to promote each other and accelerate learning efficiency, thereby greatly improving the accuracy of information extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a single-model extraction method and system for key information of sliced ​​documents. Background Art

[0002] Slicing is to cut a smaller document containing the desired information from a larger document. Especially in the financial field, such as in banks, such sliced ​​documents are widely used in scenarios such as information storage, settlement and reimbursement. Figure 1-3 Several typical bank slices are shown.

[0003] The information structure within a slice is generally divided into two types: one is in the form of a kv pair, such as the one above Figure 1 and Figure 2 As shown. That is to say, there will be keywords in front of the information value to explain what kind of information is contained in the information value; the other is that there is only an information value without a keyword description. For the first case, we usually hope to make full use of the information in the document, not to define the type of information to be extracted in advance, but to use its keywords to describe it. This requires that when the information is extracted, the keywords corresponding to the information should also be extracted. In the case where there are multiple kv pairs in a slice, it is also necessary to match the extracted keywords and information, that is, the relationship between them; in the second case, there is no corresponding keyword to describe the information. As Figure 3 As shown, there is only a set of numbers, but no keywords to indicate the meaning of this set of numbers. The technician needs to define the type of information to be extracted in advance, and then correctly classify the extracted information into a certain type defined in advance. Based on these two situations, the applicant wants to use the relevant knowledge of NLP in deep learning to solve it, which includes two key technologies: named entity recognition and relationship extraction.

[0004] Named entity recognition refers to the identification of entities with specific meanings in text, mainly including names of people, places, institutions, proper nouns, etc. Early named entity recognition methods were basically rule-based. Rule-based methods mostly use linguists to manually construct rule templates, select features including statistical information, punctuation, indicator words and direction words, central words, etc., and use pattern and string matching as the main means. Most of these methods rely on the establishment of knowledge bases and dictionaries. However, these methods often rely on specific languages, fields, and text styles. The compilation process is time-consuming and difficult to cover all language phenomena. It is particularly prone to errors. The system is not portable, and linguists need to rewrite rules for different systems. After that, as statistical methods based on large-scale corpora have achieved good results in various aspects of natural language processing, a large number of machine learning methods have emerged: hidden Markov models, language models, maximum entropy models, conditional random fields, etc. Among them, the maximum entropy model has a compact structure and good versatility. The main disadvantage is that the training time complexity is very high, sometimes even leading to unbearable training costs. In addition, due to the need for clear normalization calculations, the overhead is relatively large. Conditional random fields provide a flexible and globally optimal annotation framework for named entity recognition, but at the same time there are problems with slow convergence and long training time. With the popularity of deep learning and its wide application in natural language, many named entity recognition methods based on deep learning have emerged and have shown good results. This type of method treats named entity recognition as a sequence annotation task. The more common methods include BiLSTM+CRF, CNN+CRF, BERT, RoBERTa, etc. By utilizing the extremely strong fitting ability of the neural network model itself, feature vectors with key information can be well extracted, and this process does not require human participation but is completely obtained through training the model, which saves the lengthy and complex feature formulation process, not only saving a lot of resources and energy, but also greatly improving the accuracy of prediction.

[0005] Relation extraction aims to discover the semantic relationship between two or more entities in a text. Similar to named entity recognition, early relationship extraction was also based on rules or dependency syntax, and extracted through manual patterns. Although this type of method can create high-accuracy patterns for specific fields, it requires a lot of manual work to create all possible rules, which leads to poor robustness of the model and requires a lot of energy and resources. With the development of machine learning, supervised relationship extraction methods have emerged, mainly using technologies such as support vector machines and maximum entropy models. This type of method also has obvious defects, such as: over-reliance on carefully designed kernels to extract features, which makes the model's ability to extract features limited, prone to errors, and not robust enough when applied to new fields. The large-scale research and application of deep learning methods play a vital role in the development of the field of relationship extraction. Applying neural network models such as RNN and CNN to the supervised relationship extraction framework has become the mainstream trend today. Through the powerful fitting ability of the neural network model itself, researchers no longer need to manually design the features of the data, but let the model automatically learn the grammatical and syntactic features contained in the sentence, thereby greatly improving the robustness of the model.

[0006] Since the relation extraction task is to predict entity pairs with relationships, it has a strong reliance on the named entity recognition process. When performing relation extraction on a specific sentence, it is required to first identify the entities in the sentence, and then identify the relationship between the two entity pairs. According to the relationship between the named entity recognition task and the relation extraction task, entity recognition can be performed first and then relation extraction can be performed based on its results. This approach has several disadvantages: 1) The errors of the entity recognition module will propagate to the relation extraction module, thereby affecting its performance; 2) Dividing it into two modules and performing it separately ignores the relationship between the two subtasks, which may enhance the learning ability in the subtasks; 3) Pairing the identified entities in pairs and then classifying the relationships will generate redundant information for those unrelated entity pairs, which will increase the error rate. Summary of the invention

[0007] In view of the above shortcomings, the applicant proposes to put the two tasks into one model. Through the joint model, not only the entity type can be extracted, but also the relationship between them can be extracted together, so that the relationship extraction can be trained and extracted end-to-end, thereby improving the accuracy of prediction. Therefore, the present invention provides a single model extraction method and system for key information of sliced ​​documents. The scheme integrates the two tasks of named entity recognition and relationship extraction into one model, and uses neural network structures such as long short memory network (LSTM) and Transformer to build a model to achieve end-to-end training and prediction, and finally output the relationship between entity types or entity pairs according to the particularity of the slice information structure. The present invention relates to an accurate document key information extraction method. In view of the problem of extracting key information from sliced ​​documents, the applicant innovatively proposes to use a table filling method to put named entity recognition and relationship extraction into one model, make full use of the image, text and location features of the sliced ​​document, realize end-to-end training and prediction, avoid the problem of error propagation caused by multiple models, and make full use of the relationship between the two tasks to promote each other and accelerate learning efficiency, thereby greatly improving the accuracy of information extraction.

[0008] According to a first aspect of the present invention, a single model extraction method for key information of a sliced ​​document is provided, wherein the input information of the single model includes: a sample image, a text content composed of all the text contents of the text blocks in the sample image, and the position coordinates corresponding to each word, and the extraction method includes the following steps:

[0009] Feature encoding step: after encoding the input information, concatenate and input it into the Transformer model, and output the concatenated feature vector;

[0010] Generate table input step, convert the concatenated feature vector into the feature vector corresponding to each value in the two-dimensional table, and obtain the three-dimensional feature vector matrix X;

[0011] In the table encoding step, the three-dimensional feature vector matrix X is input into a multi-layer multi-dimensional long short memory network with the same structure for encoding to obtain a table encoding feature vector;

[0012] The classification step classifies the table-encoded feature vectors to obtain entities and the relationships between entities.

[0013] Furthermore, the feature encoding step specifically includes:

[0014] Encoding the sample image to obtain a sample image feature vector;

[0015] Encoding the text content to obtain a text semantic feature vector and a text word vector;

[0016] Encoding the position coordinates to obtain a position coordinate feature vector;

[0017] The sample image feature vector, text semantic feature vector, text word vector and position coordinate feature vector are concatenated and input into the Transformer model to obtain the concatenated feature vector as output.

[0018] Furthermore, the dimensions of the sample image feature vector, text semantic feature vector, text word vector, and position coordinate feature vector are all 512.

[0019] Furthermore, encoding the sample image specifically includes:

[0020] For the sample image, a pre-trained deep convolutional neural network is used to encode the image features of the text block and its surroundings to obtain the sample image feature vector.

[0021] Here, the surrounding image features are obtained through convolution.

[0022] Furthermore, the pre-trained deep convolutional neural network is a pre-trained deep residual neural network ResNet.

[0023] Furthermore, the encoding of the text content specifically includes:

[0024] For the text content, it is sent to the pre-trained BERT (Bidirectional Encoder Representations from Transformers) for semantic encoding to obtain the text semantic feature vector; the text word vector is learned to obtain the text word vector.

[0025] Furthermore, the encoding of the position coordinates specifically includes:

[0026] Normalize the coordinate values ​​of the position coordinates corresponding to each character;

[0027] Take the coordinate values ​​of the upper left corner and the lower right corner of the four vertices as the position information of the text;

[0028] The position information of each character is pieced together in the order of input characters and dimensionally upgraded to obtain a position feature vector of all the text contents.

[0029] Here, each word in the sample image can be regarded as a small quadrilateral, so the input position coordinates are the coordinates of the four vertices.

[0030] Furthermore, the step of generating a table input specifically includes:

[0031] The input text block includes N characters, D represents the dimension of the text block, and a two-dimensional feature vector matrix S is obtained, the dimension is N×D, S i Corresponding to the feature vector of the i-th word, we further obtain a three-dimensional feature vector matrix X with a dimension of N×N×D, where X ij represents the eigenvector corresponding to the i-th row and j-th column, and S i and S j The feature vectors are concatenated and then reduced in dimension:

[0032] X ij =F(Linear([S i ; S j ]))

[0033] Linear represents a linear neural network, and F represents a nonlinear activation function. The output dimension of this module is N×N×D.

[0034] Furthermore, the multi-dimensional long-short memory network has three layers.

[0035] Furthermore, the input of the multidimensional long and short memory network is divided into two categories:

[0036] T l,i,j,1 =LSTM(T l-1,i,j ,T l,i-1,j ,T l,i,j-1 )

[0037] T l,i,j,2 =LSTM(T l-1,i,j ,T l,i+1,j ,T l,i,j+1 )

[0038] T l+1,i,j =[T l,i,j,1 ; T l,i,j,2 ],

[0039] That is, the concatenated value is used as the input of the next layer.

[0040] Among them, the three-dimensional feature vector matrix X is used as the 0th layer T before encoding 0 Input, T l+1,i,j Represents the value of the input of the i-th row and j-th column of the 1+1 layer, which consists of two parts: l,i,j,1 T l,i,j,2 Stitched together, T l,i,j,1 It is related to the values ​​of the left and top of the same layer. l,i,j,2 Relating to the same layer being to the right and below that location.

[0041] Furthermore, the dimension of the table encoding feature vector is N×N×D.

[0042] Furthermore, the classification step includes:

[0043] Diagonal node classification: Softmax is performed on the node vectors located on the diagonal of the table. The category used here is the entity category, and the extracted one is the entity;

[0044] Classification of other nodes: Softmax is performed on the node vectors except the diagonal in the table. The categories used here are relationship categories, and the extracted ones are the relationships between entities.

[0045] According to a second aspect of the present invention, a single model extraction device for key information of a slice document is provided, the device is operated based on the method provided in any of the above aspects, and the device comprises:

[0046] The feature encoding module is used to encode the input information, concatenate and input it into the Transformer model, and output the concatenated feature vector;

[0047] Generate a table input module, which is used to convert the concatenated feature vector into a feature vector corresponding to each value in the two-dimensional table to obtain a three-dimensional feature vector matrix X;

[0048] A table encoding module is used to input the three-dimensional feature vector matrix X into a multi-layer multi-dimensional long-short memory network with the same structure for encoding to obtain a table encoding feature vector;

[0049] The classification module is used to classify the table encoding feature vector to obtain entities and the relationship between entities.

[0050] According to a third aspect of the present invention, a single model extraction system for key information of sliced ​​documents is provided, the system comprising: a processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to execute the single model extraction method for key information of sliced ​​documents as described in any of the above aspects.

[0051] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed by a processor, the single model extraction method for key information of sliced ​​documents as described in any of the above aspects is implemented.

[0052] Beneficial effects of the present invention:

[0053] 1) Named entity recognition and relationship extraction are put into one model through table filling method, which realizes end-to-end training and prediction, avoids error propagation caused by multiple models, and speeds up learning efficiency;

[0054] 2) There are two main information structures of financial bill slice documents, namely, with keywords and without keywords. When there are keywords, we make full use of keywords by extracting the relationship between keywords and actual information to more accurately explain the meaning of the corresponding information; when there are no keywords, we can also get the information we want by extracting pre-defined entity categories. In this way, one model can solve all these situations well, avoiding the work of training multiple models for different situations;

[0055] 3) It has strong generalization ability and fully and efficiently utilizes document features, including the grammar and semantics of the text, the relationship between texts in sentences, the location information of texts on images, etc. It has relatively little reliance on layout.

[0056] 4) It is more in line with the needs of actual production scenarios. One model is smaller than multiple models; engineering is more convenient, and there is no need to consider the connection and conversion between models; it is easier to find the cause of errors in actual scenarios and facilitate subsequent maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0058] Figure 1-3 This is an example diagram of a bank slice sample in the prior art;

[0059] Figure 4 An example diagram of the table filling method is shown;

[0060] Figure 5 is a flow chart of an algorithm according to an embodiment of the present invention;

[0061] Figure 6 4 is a diagram of an algorithm structure according to an embodiment of the present invention.

[0062] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0064] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein, for example.

[0065] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.

[0066] Multiple includes two or more.

[0067] It should be understood that the term "and / or" used in this disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone.

[0068] First, through Figure 4 The following example illustrates the basic principle of the table filling method:

[0069] If the applicant wants to extract the entities in the sentence "Bruce Lee was born in San Francisco, USA" and the relationships between them, first, you need to define the entity types you want to extract: person (PER), location (LOC) and the relationships: born (born_in), located (loc_in). Then, the applicant constructs a Figure 1 In the table shown, each value in the table represents the relationship between the two words in its corresponding row and column. The values ​​on the diagonal represent entity types, the other positions represent the relationship between entities, and the blank space represents no relationship. Such a table filling problem allows applicants to put two tasks into one model, thereby avoiding the error propagation caused by the two models, and effectively utilizing the mutually reinforcing relationship between the two tasks to improve the overall accuracy.

[0070] The specific algorithm flow chart of the technical solution of the present invention is as follows Figure 5 As shown, Figure 6 The algorithm structure diagram is shown.

[0071] Example

[0072] 1) Feature encoding module

[0073] The input of the model is the sample image itself, a piece of text composed of all the contents in the sample, and the position coordinates of each word. The main task of this module is to encode these inputs and generate feature vectors that can be input into subsequent modules. For the input image, the most important thing is to normalize the size with unchanged aspect ratio and fill the border with 0, so that the image size can support the convolution and downsampling operations required by the neural network in the encoding module, and maximize the retention of global and local feature information. Image feature encoding mainly uses deep convolutional neural networks to encode the image features of text blocks and their surroundings. This step uses a pre-trained deep residual neural network ResNet with powerful representation capabilities. 1 As a feature encoding network. The goal of this step is to output the image feature encoding corresponding to each text box. Therefore, it is necessary to apply a pooling operation at the corresponding position of the network output feature map to obtain the corresponding image feature encoding. The dimension of this feature is 512.

[0074] For the text content, the applicant first sends it to BERT for semantic encoding. Bert is a pre-trained model trained on a massive corpus with cleverly designed unsupervised learning tasks. With its powerful semantic understanding and representation capabilities, the feature vector obtained after Bert encoding the text content can well represent the text semantics. The dimension of the feature vector is 512.

[0075] The second encoding of text content is the learning of text word vectors. This vector is initialized to a random value and is continuously updated as the model is trained, so that the semantic and grammatical features unique to the sample can be learned. The feature vector dimension is 512.

[0076] Each word on the sample image can be regarded as a small quadrilateral, so the input position coordinates are the coordinates of the four vertices. First, the coordinate values ​​need to be normalized to normalize the coordinates to between [0,1] to eliminate the influence of coordinate values ​​of different sizes under different image sizes on the invariance of the learned model. Here, it is assumed that each quadrilateral is approximately a rectangle, and only the coordinate values ​​of the upper left corner and the lower right corner of the four vertices are taken as the position information of the word. The position information of each word is pieced together as the position feature vector of the entire text in the order of the input text. In order to keep the position feature vector and the previous two feature vectors in the same dimensional feature space, a linear neural network and a nonlinear activation function are used here to perform a dimensionality increase operation on the original position feature vector. The dimension of this feature vector is 512.

[0077] After obtaining the above four feature vectors, the applicant concatenates them in one dimension of the feature space as a new feature vector for the corresponding text, and the dimension of the concatenated feature vector is 2048. Then the applicant sends the new feature vector to the Transformer. With its powerful self-attention mechanism and multi-head and multi-layer network structure, the model can learn the relationship between the entire text, which provides key information for subsequent relationship extraction and entity extraction.

[0078] Transformer is a model based on the encoder-decoder structure. It abandons the RNN in the previous seq2seq model and adopts Self-attention or Multi-head-self-attention to enable the input data to be processed in parallel, thereby improving operation efficiency.

[0079] At this point, the entire feature encoding module is completed, and a feature vector with a dimension of 2048 is obtained for each character. These feature vectors not only contain the grammatical and semantic information of the character itself, as well as the sentence features unique to this type of sample, but also the relationship between characters, which lays a solid foundation for the final high-precision output of the model.

[0080] 2) Generate table input module

[0081] The function of this module is to convert the feature vector output by the feature encoding module into the feature vector corresponding to each value in the two-dimensional table, so as to be used as the input of the subsequent table encoding module.

[0082] Assume that the input is a piece of content with N characters, and D represents the dimension of the feature vector obtained after the feature encoding module, which is 2048. Then there is a feature vector matrix S = N × D, S iThe feature vector corresponding to the i-th word. The technical solution of the present invention is a feature vector matrix X, whose dimension is N×N×D, where X ij represents the eigenvector corresponding to the i-th row and j-th column. Here, S i and S j The feature vectors are concatenated and then reduced in dimension:

[0083] X ij =F(Linear([S i ; S j ]))

[0084] Linear represents a linear neural network, and F represents a nonlinear activation function. The output dimension of this module is N×N×D.

[0085] 3) Table encoding module

[0086] from Figure 6 It can be seen that the module is composed of multiple layers of multi-dimensional long short-term memory networks (MD-LSTM) with the same structure. The purpose of multi-layer superposition is to enable the model to learn higher-level features as the number of layers increases, so as to better solve subsequent tasks. Of course, the more layers, the better. Too many layers may lead to overfitting and poor generalization ability. Through experiments, the applicant found that for slice samples, the prediction effect is relatively good when the number of layers is 3.

[0087] Regarding the input of MD-LSTM, the technical solutions of the present invention are mainly divided into two categories:

[0088] T l,i,j,1 =LSTM(T l-1,i,j ,T l,i-1,j ,T l,i,j-1 )

[0089] T l,i,j,2 =LSTM(T l-1,i,j ,T l,i+1,j ,T l,i,j+1 )

[0090] T l+1,i,j =[T l,i,j,1 ; T l,i,j,2 ]

[0091] Here T l+1,i,j Represents the value of the input in the i-th row and j-th column of the l-th layer, which consists of two parts: l,i,j,1 T l,i,j,2 T l,i,j,1 T l,i,j,2 The same part is that they are all related to the value of the position in the previous layer; the difference is: T l,i,j,1 It is related to the values ​​on the left and above of the same layer, while Tl,i,j,2 It is related to the right and bottom of the same layer. Since each value in the table is calculated according to this method, it can be seen that the values ​​of all positions in the table of all layers are related. By training the model, we can learn which correlations are beneficial, which are not beneficial or even harmful, so as to avoid harm and take advantage of these relationships to improve the ability to complete tasks. The output dimension of this module is N×N×D.

[0092] 4) Classifier module

[0093] The main function of this module is to perform softmax processing on the vector output by the model to obtain the type corresponding to each position in the table.

[0094] from Figure 3 As can be seen, this module consists of two classifiers:

[0095] (i) Diagonal node classification: Softmax is performed on the node vectors located on the diagonal of the table. The category used here is the entity category, and the extracted one is the entity.

[0096] (ii) Classification of other nodes: Softmax is performed on the node vectors except the diagonal in the table. The categories used here are relationship categories, and the extracted ones are the relationships between entities.

[0097] In the background art, it is mentioned that slice documents have multiple information structures, and the table filling method proposed by the applicant can well solve various different information structures. Here, what is done in advance is to put "keywords" as a type of entity into the entity category of the technical solution of the present invention.

[0098] If in a slice with keywords, you do not want to use pre-defined entity types to indicate entity categories, but want to define what the entity is by keywords. That is to say, if the entity types output by the diagonal classifier contain "keyword" types, then these entity types are not used, but the remaining node classifiers are used to obtain the various kv relationships, thereby defining the entity by keywords;

[0099] If the entity types output by the diagonal classifier do not have the "keyword" type, then these types are used to define the entity.

[0100] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0101] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above implementation method 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 invention, 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, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0103] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A method for extracting key information from a single model of a financial bill slice document, wherein the financial bill slice document includes a structure with keyword information and a structure without keyword information; the input information of the single model include: A sample image, a text content composed of all the text contents of the text blocks in the sample image, and the position coordinates corresponding to each word, characterized in that the method comprises the following steps: In the feature encoding step, the input information is encoded, concatenated and input into the Transformer model, and the concatenated feature vector is output, including: Encoding the sample image to obtain a sample image feature vector; Encoding the text content to obtain a text semantic feature vector and a text word vector; Encoding the position coordinates to obtain a position coordinate feature vector; Concatenate the sample image feature vector, text semantic feature vector, text word vector, and position coordinate feature vector, and input them into the Transformer to obtain the concatenated feature vector as output; Generate table input step, convert the concatenated feature vector into the feature vector corresponding to each value in the two-dimensional table, and obtain the three-dimensional feature vector matrix X, including: The input text block includes N characters, D represents the dimension of the text block, and a two-dimensional feature vector matrix S is obtained, the dimension is N×D, S i Corresponding to the feature vector of the i-th word, we further obtain a three-dimensional feature vector matrix X with a dimension of N×N×D, where X ij represents the eigenvector corresponding to the i-th row and j-th column, and S i and S j The feature vectors are concatenated and then reduced in dimension: X ij =F(Linear([S i ;S j ])) Where Linear represents a linear neural network, and F represents a nonlinear activation function; In the table encoding step, the three-dimensional feature vector matrix X is input into a multi-dimensional long short memory network with multiple layers of the same structure for encoding to obtain a table-encoded feature vector, wherein the number of layers of the multi-dimensional long short memory network is 3 layers. Among them, in the table encoding step, the input of the multi-dimensional long and short memory network is divided into two categories: T l,i,j,1 =LSTM(T l-1,i,j ,T l,i-1,j ,T l,i,j-1 ) T l,i,j,2 =LSTM(T l-1,i,j ,T l,i+1,j ,T l,i,j+1 ) T l+1,i,j =[T l,i,j,1 ;T l,i,j,2 ] Among them, the three-dimensional feature vector matrix X is used as the 0th layer T before encoding 0 Input, T l+1,i,j Represents the value of the input of the i-th row and j-th column of the 1+1 layer, which consists of two parts T l,i,j,1 T l,i,j,2 Stitched together, T l,i,j,1 It is related to the values ​​of the left and top of the same layer. l,i,j,2 It is related to the same layer being located to the right and below of this location; The classification step classifies the table encoding feature vector to obtain entities and the relationships between entities, including: Diagonal node classification: Softmax is performed on the node vectors located on the diagonal of the table. The category used here is the entity category, and the extracted one is the entity; Classification of other nodes: Softmax is performed on the node vectors except the diagonal in the table. The categories used here are relationship categories, and the extracted ones are the relationships between entities. Among them, if there is a "keyword" type in the output entity category, the various kv relationships are obtained through the classification of the remaining nodes, so as to define the entity through the keyword; if there is no "keyword" type in the output entity category, these entity types are used to define the entity.

2. According to the single model extraction method of key information of sliced ​​documents according to claim 1, It is characterized in that The encoding of the sample image specifically includes: For the sample image, a pre-trained deep convolutional neural network is used to encode the image features of the text block and its surroundings to obtain the sample image feature vector.

3. According to claim 2, the single model extraction method for key information of slice documents, It is characterized in that The pre-trained deep convolutional neural network is a pre-trained deep residual neural network ResNet.

4. According to claim 1, the single model extraction method for key information of slice documents, It is characterized in that The encoding of the text content specifically includes: For the text content, it is sent to the pre-trained BERT model for semantic encoding to obtain the text semantic feature vector; the text word vector is learned to obtain the text word vector.

5. According to claim 1, the single model extraction method for key information of slice documents, It is characterized in that The encoding of the position coordinates specifically includes: Normalize the coordinate values ​​of the position coordinates corresponding to each character; Take the coordinate values ​​of the upper left corner and the lower right corner of the four vertices as the position information of the text; The position information of each character is pieced together in the order of input characters and dimensionally upgraded to obtain a position feature vector of all the text contents.

6. A single model extraction device for key information of sliced ​​documents, the device is operated based on the method according to any one of claims 1 to 5, the device include: A feature encoding module is used to encode the input information, concatenate and process it to output a concatenated feature vector; Generate a table input module, which is used to convert the concatenated feature vector into a feature vector corresponding to each value in the two-dimensional table to obtain a three-dimensional feature vector matrix X; A table encoding module is used to input the three-dimensional feature vector matrix X into a multi-layer multi-dimensional long-short memory network with the same structure for encoding to obtain a table encoding feature vector; The classification module is used to classify the table encoding feature vector to obtain entities and the relationship between entities.