Transaction information recognition method, system and medium based on graph neural network
By applying a graph-based neural network method in securities trading, building entity relationship diagrams and performing feature learning, the problem of low efficiency and accuracy of transaction information recognition in the existing technology is solved, and more efficient and accurate identification of transaction elements is achieved.
Patent Information
- Application Number
- CN202210002249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-01-04
AI Technical Summary
When the existing technology automatically structures transaction information in securities transactions, it is difficult to accurately identify and extract core elements such as buyers, sellers, counterparties, etc., resulting in low information recognition efficiency and accuracy.
The graph neural network is used to obtain the text to be identified, feature extraction and label prediction, and an entity relationship diagram is constructed, and a graph attention network is used to perform feature learning. Finally, a physical node is multi-classified to identify transaction element categories.
It improves the efficiency and accuracy of information classification and identification in stock securities transactions, and can more accurately combine the text characteristics and relationship characteristics of entity elements for classification and judgment.
Smart Images

Figure CN114398881B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a transaction information recognition method, system and medium based on a graph neural network. Background Art
[0002] Spot trading is the most active form of trading in the financial trading market. In spot trading, there is a large amount of unstructured trading dialogue text information, which needs to be organized into standard structured order information. For example, the spot trading dialogue text is "3Y 1000001.IB 3.5% 2kw+1XX institution YY fund to ZZ institution", which means "100001.IB bonds, with a remaining term of 3 years, at an interest rate of 3.5%, and a trading volume of 20 million", and the trading method is from "XX institution's YY fund account" to "ZZ institution".
[0003] When the trading volume is large, traders will face tremendous workload. The task of text structuring of spot trading is to automatically process such unstructured text information of bond transactions into structured information without the need for manual entry by traders. In this process, it is very difficult to identify and extract core elements such as buyers, sellers, counterparties, and bridges in the transaction information. How to correctly identify and extract counterparties is the key to the success of the structuring task.
[0004] Existing recognition technologies basically use natural language processing technology based on deep learning models to achieve text understanding and recognition, and then use logical indexing to extract the expression structure of each text to make individual judgments on transaction elements. This method relies on a pre-built rule library, which not only consumes a lot of human resources and has low coverage, but also reduces the efficiency and accuracy of transaction information recognition.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a transaction information recognition method, system and medium based on graph neural network, aiming to improve the accuracy and efficiency of transaction information recognition.
[0007] The technical solution of the present invention is as follows:
[0008] A transaction information recognition method based on graph neural network, comprising:
[0009] Get the text to be recognized;
[0010] Performing feature extraction and label prediction on the text to be recognized to obtain the labeling results of the entity elements in the text to be recognized;
[0011] Constructing a corresponding entity relationship diagram according to the annotation results of the entity elements;
[0012] After performing feature learning on the entity relationship graph through a graph attention network, an entity node feature vector is output;
[0013] Perform feature multi-classification on the entity node feature vector and output the transaction element category of each entity node.
[0014] In one embodiment, the step of extracting features and predicting labels on the text to be recognized to obtain the labeling results of entity elements in the text to be recognized includes:
[0015] Performing character encoding and vocabulary encoding on the text to be recognized to obtain character vector encoding and word vector encoding;
[0016] After performing feature extraction on the character vector encoding, a semantic feature vector of each character is output;
[0017] After extracting graph features from the word vector encoding through a graph neural network, a graph relationship feature vector of each word is output;
[0018] Performing feature fusion on the semantic feature vector and the graph relationship feature vector, and outputting a fused feature vector;
[0019] Label prediction is performed on the entity elements in the fused feature vector to obtain labeling results of the entity elements.
[0020] In one embodiment, the step of extracting graph features from the word vector encoding through a graph neural network and outputting graph relationship feature vectors of each word includes:
[0021] Constructing a corresponding vocabulary relationship graph according to the position and connection relationship of each vocabulary node in the word vector encoding;
[0022] Each word is input into the graph neural network as the initial feature vector of the corresponding vocabulary node, and the graph neural network is used to perform feature learning on the vocabulary relationship graph and then output the graph relationship feature vector of the corresponding vocabulary.
[0023] In one embodiment, the step of fusing the semantic feature vector and the graph relationship feature vector and outputting the fused feature vector includes:
[0024] The semantic feature vector and the graph relationship feature vector are concatenated to obtain a concatenated vector G. Among them, H LSTM is the semantic feature vector, is the graph relation feature vector of the mth vocabulary node;
[0025] The concatenated vector is fully connected and mapped through a preset weight matrix, and the attention relationship features between different features are calculated through a multi-head attention mechanism to perform feature fusion, and a fused feature vector R after feature fusion is obtained, where R = MultiHeadAttention (Q, K, V), Q = GW q , K = GW k , V = GW v , Q is the query matrix, K is the key matrix, V is the value matrix, W q , W k , W v Weight matrix.
[0026] In one embodiment, the character encoding and vocabulary encoding are respectively performed on the text to be recognized to obtain a character vector encoding and a word vector encoding, including:
[0027] The text to be recognized is segmented character by character by using a pre-trained model to obtain corresponding character vector encoding;
[0028] The text to be recognized is segmented into words using a preset word segmentation method, and each word is pre-trained and encoded to obtain the corresponding word vector encoding.
[0029] In one embodiment, constructing a corresponding entity relationship diagram according to the annotation results of the entity elements includes:
[0030] Perform line break segmentation on the text to be recognized to obtain a plurality of lines of sub-text;
[0031] Sort the entity elements in each line of subtext according to the annotation results of the entity elements to obtain two-dimensional position information of each entity element;
[0032] The association relationship between every two entity elements is confirmed according to a preset clustering algorithm and the two-dimensional position information, and a corresponding entity relationship graph is constructed according to the association relationship.
[0033] In one embodiment, the determining the association relationship between every two entity elements according to the preset clustering algorithm and the two-dimensional position information, and constructing a corresponding entity relationship graph according to the association relationship, includes:
[0034] Calculate the spatial distance between every two entity elements according to the two-dimensional position information;
[0035] Clustering the spatial distance between each two entity elements using a K-nearest neighbor algorithm to obtain the association relationship between the entity elements;
[0036] Construct the corresponding entity relationship diagram based on the association relationship between each entity element.
[0037] In one embodiment, the outputting of entity node feature vectors after performing feature learning on the entity graph structure through a graph attention network specifically includes:
[0038] By formula Perform feature learning on the entity relationship graph and output the entity node feature vector, where is the output feature of the l+1th layer of entity node i, represents the input feature of the lth layer of entity node i, || represents the concatenation operation, σ represents the activation function, and v j ∈N(v i ) represents all entities belonging to the entity node v i The nearest neighborhood N(v i ) within the domain node; represents the attention weight between entity node i and entity node j under the kth attention mechanism; represents the linear transformation weight matrix of the input features under the k-th attention mechanism, where is a matrix space of F×F, where F is the spatial dimension and K is the number of attention mechanisms in the graph attention network.
[0039] A transaction information recognition system based on graph neural network, the system comprising at least one processor; and
[0040] a memory communicatively connected to the at least one processor; wherein,
[0041] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned transaction information identification method based on graph neural network.
[0042] A non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the above-mentioned transaction information recognition method based on graph neural network.
[0043] Beneficial effects: The present invention discloses a transaction information identification method, system and medium based on graph neural network. Compared with the prior art, the embodiments of the present invention construct an entity relationship graph to perform feature learning and classification on the relationship between entity elements, identify the transaction institution category of each entity, and can more accurately combine the text features and relationship features of the entity elements for classification and judgment, effectively improving the efficiency and accuracy of information classification and identification in spot transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0045] Figure 1 A flow chart of a transaction information identification method based on a graph neural network provided in an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of text cutting in a transaction information recognition method based on graph neural network provided in an embodiment of the present invention;
[0047] Figure 3 An entity relationship diagram in the transaction information identification method based on graph neural network provided in an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of a model framework in a transaction information identification method based on a graph neural network provided in an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of functional modules of a transaction information identification device based on a graph neural network provided in an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of the hardware structure of a transaction information identification system based on a graph neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0052] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a transaction information identification method based on a graph neural network provided by the present invention. The transaction information identification method based on a graph neural network provided in this embodiment is suitable for automatically identifying information in a transaction process. Figure 1 As shown, the method specifically comprises the following steps:
[0053] S100: Obtain text to be recognized.
[0054] In this embodiment, the text to be identified can be the text information of the transaction dialogue in the process of spot trading, such as order information, consultation information, etc. sent between different trading institutions. By obtaining the text information in the transaction dialogue as the text to be identified, automatic structured processing is performed, without the need for traders to manually identify and enter information, so as to improve the processing efficiency of transaction information identification. Of course, in other embodiments, the text to be identified is not limited to text information in spot trading, but can also be text information in other transactions, or text information obtained by identifying and converting transaction voice information, etc., which is not limited in this embodiment.
[0055] S200: performing feature extraction and label prediction on the text to be recognized, and obtaining the labeling results of the entity elements in the text to be recognized.
[0056] In this embodiment, the acquired text to be recognized is feature extracted through a pre-trained recognition model to obtain a number of entity elements contained in the text to be recognized. The specific entity elements may include institution name, transaction direction, transaction period, transaction volume, transaction method, transaction product name, etc., and the extracted entity element features are further predicted by labels, so as to obtain the annotation results of each entity element to distinguish the categories of different entity elements, so as to facilitate the subsequent further recognition processing of the position, arrangement order and other information of entity elements of different categories in the text to be recognized, so as to provide accurate feature data for accurate transaction information recognition.
[0057] In one embodiment, step S200 includes:
[0058] Performing character encoding and vocabulary encoding on the text to be recognized to obtain character vector encoding and word vector encoding;
[0059] After performing feature extraction on the character vector encoding, a semantic feature vector of each character is output;
[0060] After extracting graph features from the word vector encoding through a graph neural network, a graph relationship feature vector of each word is output;
[0061] Performing feature fusion on the semantic feature vector and the graph relationship feature vector, and outputting a fused feature vector;
[0062] Label prediction is performed on the entity elements in the fused feature vector to obtain labeling results of the entity elements.
[0063] In this embodiment, feature extraction is divided into two parts. One part is to encode the text to be recognized at the character level to obtain the character vector encoding, and the other part is to encode the text to be recognized at the vocabulary level to obtain the word vector encoding. Specifically:
[0064] When character encoding is performed on the text to be recognized, the text to be recognized is segmented character by character through a pre-trained model to obtain corresponding character vector encoding. This embodiment specifically adopts a BERT-based pre-trained model for character encoding. BERT is a pre-trained language representation model, which emphasizes that it is no longer pre-trained by using a traditional unidirectional language model or a shallow splicing method of two unidirectional language models as in the past, but a new MLM (masked language model) is used to generate a deep bidirectional language representation, that is, for the input text, some words in the text are randomly masked with a certain probability, and then the Bert model is used to predict these masked words for pre-training to obtain a vector encoding for each character. Of course, in other embodiments, pre-trained models such as RoBerta and Ernie can also be used for character encoding, and this embodiment is not limited to this.
[0065] When the text to be recognized is lexically encoded, the text to be recognized is lexically segmented by a preset word segmentation method, and each word is pre-trained and encoded to obtain a corresponding word vector encoding. In this embodiment, the Jieba word segmentation component optimized for financial vocabulary is used to segment the text to be recognized. Jieba word segmentation is a Chinese word segmentation component that can realize functions such as word segmentation, part-of-speech tagging, and keyword extraction for Chinese text, and supports custom dictionaries. Therefore, in this embodiment, financial encyclopedia vocabulary is pre-added to the vocabulary of the Jieba word segmentation component to optimize the native Jieba word segmentation, thereby overcoming the shortcomings of the native Jieba technology in the financial professional field and improving the accuracy of text segmentation in transaction information recognition. After that, the Word2vec pre-training method is used to pre-train and encode each word to form a corresponding word vector encoding. In this embodiment, the Word2vec method with fast training speed is used for pre-training encoding to improve encoding efficiency. Of course, in other embodiments, a technology such as glove that considers global information can also be used, but its matrix decomposition also brings a greater computational burden. It can be selected according to the actual encoding speed and accuracy requirements, and this embodiment does not limit this.
[0066] After obtaining the character vector encoding and word vector encoding respectively, two parts of feature learning and extraction are performed respectively. One part is the feature learning of the character vector encoding. Specifically, the features of the sequence text after character encoding can be learned through the LSTM (Long Short-Term Memory) network structure to extract the semantic feature vector of each character. Specifically, the character vector encoding obtained by the BERT pre-training model is used as the input of the LSTM network, and the N-dimensional LSTM network structure is used for feature learning and extraction, and the N-dimensional semantic feature vector H is output. LSTM; The other part is the feature learning of word vector encoding, specifically, extracting the graph relationship features between each word through a graph neural network. Since it is necessary to sequence label entities and extract entity relationships in transaction information recognition, through the feature learning and extraction of these two parts, during sequence labeling and entity relationship extraction, the feature learning of sequence text can be used to improve the clarity of entity boundaries and ensure labeling accuracy, and the feature learning of the topological structure between each word can be used to better capture the relationship between entities, thereby improving the accuracy of transaction information recognition through the feature learning and extraction of these two parts.
[0067] In one embodiment, the step of extracting graph features from the word vector encoding through a graph neural network and outputting graph relationship feature vectors of each word includes:
[0068] Constructing a corresponding vocabulary relationship graph according to the position and connection relationship of each vocabulary node in the word vector encoding;
[0069] Each word is input into the graph neural network as the initial feature vector of the corresponding vocabulary node, and the graph neural network is used to perform feature learning on the vocabulary relationship graph and then output the graph relationship feature vector of the corresponding vocabulary.
[0070] In this embodiment, when performing feature learning on the word vector encoding, first, a corresponding vocabulary relationship graph is constructed according to the position and connection relationship of each vocabulary node in the word vector encoding. Specifically, after obtaining the word segmentation result, the start-end position of the vocabulary is used as the connection point to construct a vocabulary relationship graph, and a neighborhood matrix A of the vocabulary relationship graph is constructed. Specifically, if two vocabulary nodes m and n are connected, a value of 1 is assigned, that is, A[m, n]=1. If there is no connection between the two vocabulary nodes m and n, a value of 0 is assigned, that is, A[m, n]=0. In this way, the neighborhood matrix of the vocabulary relationship graph is obtained to characterize the connection relationship between each vocabulary node. After that, each vocabulary is used as the initial feature vector of the corresponding vocabulary node in the vocabulary relationship graph. A layer of GCN (Graph convolution Network, graph neural network) is used to perform feature learning on the structure of the vocabulary relationship graph, and then the graph relationship feature vector of the corresponding vocabulary is output. The specific GCN formula is: in, I is the identity matrix; for The degree matrix is a diagonal matrix with the elements on the diagonal being The degree of each vertex in (that is, the number of connections between each vertex and other vertices); H l is the feature of the first layer; f is the activation function. In this embodiment, the vocabulary vector encoding of the vocabulary node is used as the initial feature vector E GCN (i.e., the input of GCN), using the formula The vocabulary node features and connection features are integrated to obtain a new graph relationship feature vector H that integrates vocabulary connection features and character features. GCN , H GCN That is, the output of GCN, which realizes the learning of the graph network structure that represents the topological relationship between different entities, provides accurate graph relationship features for subsequent entity relationship extraction, and ensures the reliability of entity relationship extraction.
[0071] After extracting the contextual features at the character level and the topological relationship features at the vocabulary level, feature fusion is further performed to comprehensively utilize the features of the two parts to achieve feature complementarity. Compared with a single feature, transaction information recognition based on fusion processing will have better robustness.
[0072] In one embodiment, the semantic feature vector and the graph relationship feature vector are subjected to feature fusion, and the fused feature vector is output, including:
[0073] The semantic feature vector and the graph relationship feature vector are concatenated to obtain a concatenated vector G. Among them, H LSTM is the semantic feature vector, is the graph relation feature vector of the mth vocabulary node;
[0074] The concatenated vector is fully connected and mapped through a preset weight matrix, and the attention relationship features between different features are calculated through a multi-head attention mechanism to perform feature fusion, and a fused feature vector R after feature fusion is obtained, where R = MultiHeadAttention (Q, K, V), Q = GW q , K = GW k , V = GW v , Q is the query matrix, K is the key matrix, V is the value matrix, W q , W k , W v Weight matrix.
[0075] In this embodiment, after obtaining the semantic feature vector H of each character of the text, LSTM The basic graph relationship feature vector H of the word GCN Finally, in order to merge the two features, this embodiment directly concatenates the two feature vectors to Thus, a longer character vector is formed as the input feature of the fusion layer. In order to ensure the consistency of the length of G, when the character has a segmentation feature, When a character does not have a word segmentation graph feature, it is directly assigned a 0 vector Afterwards, in order to deepen the fusion of features, the features are further integrated through the attention mechanism, the concatenated vector is fully connected using the weight matrix, and the multi-head attention mechanism is used to calculate the attention relationship feature R = MultiHeadAttention (Q, K, V) between different features, thereby obtaining the final fusion feature vector R of each character.
[0076] After obtaining the fused feature vector, the label prediction of the fused feature vector can be performed through the sequence annotation layer to obtain the annotation results of each entity element therein. Specifically, the fused feature vector is decoded and annotated through the trained label prediction model to obtain the position and category of the entity element. The label prediction training model can use the mature CRF (conditional random fields) algorithm to achieve efficient and accurate sequence annotation. In the specific implementation, the loss function of CRF is defined as Loss1.
[0077]
[0078] in represents the probability of the rth decoding path, s(X, y path ) is the decoding path y for a given input vector X path The score, e s(X,y) is the score of the decoding path y given the input vector X, Y x is the set of decoding paths, N is the number of decoding paths, P RealPath is the probability of the true decoding path. By training the CRF model with the pre-acquired training samples until the loss function Loss1 converges, the fused vector features can be decoded and annotated efficiently and accurately, and the position and category of each entity element in the text to be identified can be accurately obtained.
[0079] S300: construct a corresponding entity relationship diagram according to the annotation results of the entity elements.
[0080] In this embodiment, based on the annotation results of each entity element in the text to be identified, including the position and category of the entity element, the corresponding entity relationship diagram is recombined and constructed according to the position of each entity element and the relationship between it and other elements, so as to realize entity relationship extraction, which serves as the judgment basis for the subsequent identification of different transaction elements, thereby improving the accuracy of subsequent transaction element identification judgment.
[0081] In one embodiment, step S300 includes:
[0082] Perform line break segmentation on the text to be recognized to obtain a plurality of lines of sub-text;
[0083] Sort the entity elements in each line of subtext according to the annotation results of the entity elements to obtain two-dimensional position information of each entity element;
[0084] The association relationship between every two entity elements is confirmed according to a preset clustering algorithm and the two-dimensional position information, and a corresponding entity relationship graph is constructed according to the association relationship.
[0085] In this embodiment, when generating an entity relationship diagram, first determine the two-dimensional position information of each entity element in the text to be recognized, such as Figure 2 As shown, since there is a line break character "\n" in the text to be identified, the text to be identified is segmented by line breaks using the "\n" character to obtain several lines of sub-text, thereby obtaining the line position of each entity name, "direction", etc., and then sorting the entity elements in each line of sub-text according to the annotation results of the entity elements, so that the row position and column position of each entity can be obtained as the two-dimensional position information of the corresponding entity element. The row number and column number of each entity are used as the two-dimensional position information, and the association relationship between each two entity elements is confirmed by a preset clustering algorithm and an entity relationship diagram is constructed. Specifically, the spatial distance between each two entity elements is calculated according to the two-dimensional position information. The spatial distance can be Manhattan distance, Euclidean distance, Mahalanobis distance, etc. In this embodiment, Euclidean distance is preferably used, which defines the entity node x i and entity node x j The Euclidean distance between The K-nearest neighbor algorithm is used to determine the relationship between two entities. Specifically, the spatial distance between each two entity elements is clustered to generate the corresponding neighborhood matrix. If the spatial distance between two entities is determined to be the same type of entity nodes by the K-nearest neighbor algorithm, they are defined as related, and the relationship between the two entity nodes is assigned a value of 1, that is, if x i ∈K(x j ) then N[i, j] = 1; if it is determined to be an entity node of different categories, it is defined as unrelated, and the relationship between the two entities is assigned to 0, that is, if Then N[i, j] = 0, K(x j ) indicates that Calculated about entity node x j The K nearest neighbors of , thereby obtaining the neighborhood matrix representing the relationship between different entity elements, and then constructing the corresponding entity relationship graph, for Figure 2 In the text to be recognized, when K in the K-nearest algorithm is 1, we can get Figure 3The entity relationship diagram shown in the figure can of course use other K values in other embodiments. The larger the K value is, the more complex the topological relationship between entities is, and the more other entities each entity needs to pay attention to, so as to improve the accuracy of entity relationship extraction. However, it will also lead to an increase in computational complexity. Therefore, the K value can be adjusted according to actual needs, and this embodiment does not limit this.
[0086] S400, outputting an entity node feature vector after performing feature learning on the entity relationship graph through a graph attention network.
[0087] In this embodiment, after obtaining the relationship graph structure between entities and the corresponding neighborhood matrix, the structure of the entity relationship graph is feature learned through GAT (graph attention network) to output the feature vector information of each entity node in the entity relationship graph, so as to learn the relationship features between different entity nodes to achieve accurate entity relationship extraction, so as to facilitate the subsequent accurate identification of transaction categories of different entity elements, such as whether the various institutions obtained are buyers, sellers, bridge institutions, etc., and further realize relationship identification on the basis of element extraction, providing an accurate judgment basis for the accurate identification of transaction element categories.
[0088] Specifically, through the formula Perform feature learning on the entity relationship graph and output the entity node feature vector, where is the output feature of the l+1th layer of entity node i, represents the input feature of the lth layer of entity node i, || represents the concatenation operation, σ represents the activation function, and v j ∈N(v i ) represents all entities belonging to the entity node v i The nearest neighborhood N(v i ) within the domain node; represents the attention weight between entity node i and entity node j under the kth attention mechanism; represents the linear transformation weight matrix of the input features under the k-th attention mechanism, where is a matrix space of F×F, where F is the spatial dimension and K is the number of attention mechanisms in the graph attention network.
[0089] In this embodiment, feature information is obtained through a GAT with a multi-head graph attention layer, which contains K independent single-head attention layers. Each single-head attention layer learns the input features through the corresponding attention mechanism to obtain the corresponding output features, and the output results of each single-head attention layer are spliced together to improve the generalization ability of the attention mechanism.
[0090] S500: Perform feature multi-classification on the entity node feature vector, and output the transaction element category of each entity node.
[0091] In this embodiment, after obtaining the feature vector information of each entity node in the entity relationship diagram, each entity node is subjected to feature multi-classification through the classification layer, thereby outputting the transaction element category of each entity node. Specifically, the classification layer adopts the softmax function for feature multi-classification, and the loss function Loss2 of the classification layer adopts the cross entropy loss function, thereby judging each entity node as a buyer, a seller or a bridge institution. Furthermore, in the transaction dialogue application scenario, if combined with the visual party of the text to be identified, each entity node can be further judged as the party, the counterparty or the bridge institution in the transaction information. For example, for a text to be identified, "A Debt 000001 3000W XX institution sold to YY institution", if the visual party viewing this message is XX institution, then the identification result of the counterparty is YY institution. On the contrary, if the visual party viewing this message is YY institution, then the identification result of the counterparty is XX institution. Then, on the basis of accurate entity labeling and entity relationship extraction, efficient and accurate transaction element identification is achieved, which greatly improves the work efficiency of traders and saves transaction information processing time.
[0092] In order to better understand the implementation process of the transaction information identification method based on graph neural network provided by the present invention, the following is combined with Figure 4 The specific model structure in the figure introduces the process of the transaction information recognition method based on graph neural network provided by the present invention:
[0093] like Figure 4As shown in the figure, after obtaining the text to be recognized, on the one hand, it is segmented into characters, and the character vector encoding is generated after character encoding through the BERT pre-training model. The feature learning and extraction of the sequence text output by BERT are carried out through the LSTM network model to obtain the semantic feature vector; on the other hand, the text to be recognized is segmented through the Jieba component, and the word vector encoding is generated after pre-training encoding through Word2Vec. In order to solve the boundary drift problem caused by the single semantic feature, the GCN-based network layer is introduced to extract the graph feature of the word vector encoding to obtain the graph relationship feature vector, so as to enhance the boundary learning ability of feature extraction; the semantic feature vector and the graph relationship feature vector are fused through the fusion layer to obtain the fused feature vector; then the entity elements in the fused feature vector are analyzed through CRF The line sequence is annotated to extract the entity elements in the text to be recognized; then the position code of each entity element and the category information of the entity element are obtained, and the entity relationship graph of the entity element is constructed as the original input information through the K-nearest neighbor algorithm; then the network structure of the entity relationship graph is feature learned through the graph attention network GAT, so as to learn the association relationship between different entity elements to achieve accurate entity relationship extraction; then the entity nodes are multi-classified through the classification layer to determine whether each entity node is a buyer, seller or bridge institution, or based on the current visual aspect, each entity node is further determined to be the party, the other party or a bridge institution, thereby realizing efficient and accurate transaction element recognition and processing of a large amount of transaction information in the current securities transaction, effectively improving the efficiency and accuracy of transaction information processing.
[0094] Another embodiment of the present invention provides a transaction information recognition device based on a graph neural network, such as Figure 5 As shown, the device comprises:
[0095] An acquisition module 11 is used to acquire the text to be recognized;
[0096] The labeling module 12 is used to extract features and predict labels of the text to be recognized, and obtain labeling results of entity elements in the text to be recognized;
[0097] A graph construction module 13, used to construct a corresponding entity relationship graph according to the annotation results of the entity elements;
[0098] A feature learning module 14 is used to perform feature learning on the entity relationship graph through a graph attention network and then output an entity node feature vector;
[0099] The classification identification module 15 is used to perform feature multi-classification on the entity node feature vector and output the transaction element category of each entity node.
[0100] The acquisition module 11, the labeling module 12, the graph construction module 13, the feature learning module 14 and the classification recognition module 15 are connected in sequence. The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which are more suitable for describing the execution process of transaction information recognition based on graph neural networks than programs. For the specific implementation methods of each module, please refer to the corresponding method embodiments above, which will not be repeated here.
[0101] Another embodiment of the present invention provides a transaction information recognition system based on a graph neural network, such as Figure 6 As shown, the system 10 includes:
[0102] One or more processors 110 and memory 120, Figure 6 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0103] The processor 110 is used to complete various control logics of the system 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0104] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the transaction information identification method based on the graph neural network in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, realizing the transaction information identification method based on the graph neural network in the above method embodiment.
[0105] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the system 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the system 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0106] One or more units are stored in the memory 120, and when executed by one or more processors 110, the transaction information recognition method based on the graph neural network in any of the above method embodiments is executed, for example, the above described transaction information recognition method based on the graph neural network is executed. Figure 1 The method comprises steps S100 to S500.
[0107] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S500.
[0108] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0109] In summary, in the transaction information identification method, system and medium based on graph neural network disclosed by the present invention, the method obtains the text to be identified; performs feature extraction and label prediction on the text to be identified to obtain the annotation results of the entity elements in the text to be identified; constructs the corresponding entity relationship graph according to the annotation results of the entity elements; outputs the entity node feature vector after feature learning on the entity relationship graph through the graph attention network; performs feature multi-classification on the entity node feature vector, and outputs the transaction element category of each entity node. By constructing an entity relationship graph to perform feature learning and classification on the relationship between entity elements, the transaction institution category of each entity is identified, and the text features and relationship features of the entity elements can be more accurately combined for classification and judgment, which effectively improves the efficiency and accuracy of information classification and identification in current securities transactions.
[0110] Of course, 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 (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.
[0111] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A transaction information recognition method based on graph neural network, characterized in that: include: Acquire the text to be recognized, where the text to be recognized is text information in a transaction process; Performing feature extraction and label prediction on the text to be recognized to obtain the labeling results of the entity elements in the text to be recognized; Constructing a corresponding entity relationship diagram according to the annotation results of the entity elements; After performing feature learning on the entity relationship graph through a graph attention network, an entity node feature vector is output; Performing feature multi-classification on the entity node feature vector, and outputting the transaction element category of each entity node; The step of constructing a corresponding entity relationship diagram according to the annotation results of the entity elements includes: Perform line break segmentation on the text to be recognized to obtain a plurality of lines of sub-text; Sort the entity elements in each line of subtext according to the annotation results of the entity elements to obtain two-dimensional position information of each entity element; The association relationship between every two entity elements is confirmed according to a preset clustering algorithm and the two-dimensional position information, and a corresponding entity relationship graph is constructed according to the association relationship, wherein the association relationship is specifically a neighborhood matrix generated by clustering the spatial distance between every two entity elements.
2. The transaction information identification method based on graph neural network according to claim 1 is characterized in that: The step of extracting features and predicting labels on the text to be identified to obtain the labeling results of entity elements in the text to be identified includes: Performing character encoding and vocabulary encoding on the text to be recognized to obtain character vector encoding and word vector encoding; After performing feature extraction on the character vector encoding, a semantic feature vector of each character is output; After extracting graph features from the word vector encoding through a graph neural network, a graph relationship feature vector of each word is output; Performing feature fusion on the semantic feature vector and the graph relationship feature vector, and outputting a fused feature vector; Label prediction is performed on the entity elements in the fused feature vector to obtain labeling results of the entity elements.
3. The transaction information identification method based on graph neural network according to claim 2 is characterized in that: The step of extracting graph features from the word vector encoding through a graph neural network and then outputting graph relationship feature vectors of each word includes: Constructing a corresponding vocabulary relationship graph according to the position and connection relationship of each vocabulary node in the word vector encoding; Each word is input into the graph neural network as the initial feature vector of the corresponding vocabulary node, and the graph neural network is used to perform feature learning on the vocabulary relationship graph and then output the graph relationship feature vector of the corresponding vocabulary.
4. The transaction information identification method based on graph neural network according to claim 2 is characterized in that: The step of fusing the semantic feature vector and the graph relationship feature vector and outputting a fused feature vector comprises: The semantic feature vector and the graph relationship feature vector are concatenated to obtain a concatenated vector G. Among them, H LSTM is the semantic feature vector, is the graph relation feature vector of the mth vocabulary node; The concatenated vector is fully connected and mapped through a preset weight matrix, and the attention relationship features between different features are calculated through a multi-head attention mechanism to perform feature fusion, and a fused feature vector R after feature fusion is obtained, where R = MultiHeadAttention (Q, K, V), Q = GW q , K = GW k , V = GW υ , Q is the query matrix, K is the key matrix, V is the value matrix, W q , W k , W υ Weight matrix.
5. The transaction information identification method based on graph neural network according to any one of claims 2 to 4, characterized in that: The step of performing character encoding and vocabulary encoding on the text to be recognized to obtain character vector encoding and word vector encoding comprises: The text to be recognized is segmented character by character by using a pre-trained model to obtain corresponding character vector encoding; The text to be recognized is segmented into words using a preset word segmentation method, and each word is pre-trained and encoded to obtain the corresponding word vector encoding.
6. The transaction information identification method based on graph neural network according to claim 1 is characterized in that: The determining the association relationship between every two entity elements according to the preset clustering algorithm and the two-dimensional position information, and constructing a corresponding entity relationship graph according to the association relationship, includes: Calculate the spatial distance between every two entity elements according to the two-dimensional position information; Clustering the spatial distance between each two entity elements using a K-nearest neighbor algorithm to obtain the association relationship between the entity elements; Construct the corresponding entity relationship diagram based on the association relationship between each entity element.
7. The transaction information identification method based on graph neural network according to claim 1 is characterized in that: The step of performing feature learning on the entity relationship graph structure through a graph attention network and outputting an entity node feature vector specifically includes: By formula Perform feature learning on the entity relationship graph and output the entity node feature vector, where is the output feature of the l+1th layer of entity node i, represents the input feature of the lth layer of entity node i, ‖ represents the concatenation operation, σ represents the activation function, and υ j ∈N(υ i ) represents all entities belonging to the node v i The nearest neighborhood N(υ i ) within the domain node; represents the attention weight between entity node i and entity node j under the kth attention mechanism; represents the linear transformation weight matrix of the input features under the k-th attention mechanism, where is a matrix space of F×F, where F is the spatial dimension and K is the number of attention mechanisms in the graph attention network.
8. A transaction information recognition system based on graph neural network, characterized in that: The system includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the transaction information identification method based on graph neural network as described in any one of claims 1-7.
9. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the transaction information identification method based on graph neural network as described in any one of claims 1-7.
Citation Information
Patent Citations
Entity relationship extraction method based on attention neural network
CN112818124A
Entity extraction method applied to network security field
CN112989831A
Data processing method and device, equipment and storage medium
CN113144624A