An event detection method integrating graph attention and graph convolutional network
By combining graph attention and graph convolution network, neighbor weights are learned dynamically and weights are allocated according to the importance of nodes, the problem of incomplete information extraction of existing event detection methods is solved, and the accuracy of event detection and information extraction capabilities are improved.
Patent Information
- Application Number
- CN202210301353.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-25
AI Technical Summary
When using a single graph convolutional neural network or graph attention neural network, existing event detection methods cannot fully utilize the advantages of both, resulting in incomplete information extraction and low accuracy.
Fusion graph attention and graph convolution networks, by combining GCN and GAT vectors, dynamically learn neighbor weights and assign different weights according to the importance of nodes, fully extract text information, and improve the accuracy of trigger word recognition and classification.
By fusion of graph attention and graph convolution network, the error transmission problem of traditional models is overcome, the accuracy of event detection and information extraction capabilities are improved, and the ability to recognize and classify trigger words is enhanced.
Smart Images

Figure CN114647730B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of event detection, and in particular to an event detection method integrating graph attention and graph convolutional network. Background Art
[0002] With the advent of the era of data explosion, the amount of data on the Internet has shown an exponential growth, and these data contain a large amount of valuable information that has not been discovered. Faced with such a large amount of data, it is time-consuming and laborious to rely solely on manual screening of information and it is impossible to extract information in large batches, but missing some important data will cause losses to many organizations and individuals. Therefore, using natural language technology to automatically screen and extract the information people need to ensure the timeliness and completeness of information is an effective means of mining data and automatically extracting information, such as content recommendation in e-commerce platforms, public opinion monitoring on social networking platforms, and intelligent question-and-answer functions in online customer service. In recent years, deep learning has been widely used in the field of natural language processing, such as syntactic analysis and named entity recognition, and natural language processing technology has also made a huge leap.
[0003] Event extraction is a method used in existing natural language processing technology to extract information. It aims to present unstructured text containing event information in a structured form. It has a wide range of applications in automatic summarization, automatic question answering, information retrieval and other fields. The event in the definition of Automatic Content Extraction (ACE) consists of a trigger word (Trigger) and an element (Argument) that describes the event structure. Among them, the trigger word refers to the core word that can clearly indicate the occurrence of an event in a sentence. It is the most important feature word that determines the type of event, determines the event category and subcategory, and is usually a verb or noun phrase. Elements are used to fill in the event template, and both fully describe the event itself.
[0004] The event extraction task consists of two steps: event detection and argument detection. Event detection mainly identifies trigger words and the event types and subtypes they represent based on the context. The ACE2005 dataset defines 8 event categories and 33 subcategories. Each event category or subcategory corresponds to a unique event template. Figure 1 , which is a schematic diagram of an event detection example. In this sentence, the first event belongs to the death (die) event in the life (life) category, and the trigger word is died; the second event belongs to the attack (attack) event in the conflict (conflict) category, and the trigger word is fired.
[0005] Existing event detection methods mainly use recurrent neural networks (RNN) and graph neural networks (GNN) to identify and classify event trigger words. Among them, when using GNN for event detection, only a single graph convolutional neural network (GCN) or graph attention neural network (GAT) is used. This method of use does not take into account the advantages and disadvantages of both and has certain limitations: the graph convolutional neural network can dynamically learn neighbor weights, but ignores the relationship between nodes and cannot assign different weights to each neighbor node according to the importance of the node; the graph attention neural network considers the relationship between each node but cannot dynamically learn neighbor weights and does not make full use of edge information. Using them alone cannot combine their respective advantages to complement each other, and will also cause the model to extract incomplete information and low accuracy. Summary of the invention
[0006] Based on this, the purpose of the present invention is to provide an event detection method that integrates graph attention and graph convolutional network, combines graph convolutional neural network and graph attention neural network, and fully extracts text information through the complementary advantages of the two, thereby improving the accuracy of trigger word recognition and classification.
[0007] The present invention is achieved through the following technical solutions:
[0008] An event detection method integrating graph attention and graph convolutional network, comprising the steps of:
[0009] S1: vectorize the sentence to be tested to obtain the sentence vector to be tested;
[0010] S2: Obtaining a BIO vector, a POS vector and a dependency syntactic graph according to the sentence vector to be tested;
[0011] S3: Encode the BIO vector to obtain a BERT vector;
[0012] S4: Combining the BERT vector and the POS vector to obtain a word vector, and obtaining a labeled sentence vector according to the word vector;
[0013] S5: performing feature extraction on the annotated sentence vector and the dependency syntax graph to obtain a GCN vector and a GAT vector, and calculating a fusion vector based on the GCN vector and the GAT vector;
[0014] S6: Classify and identify the fusion vector to obtain the trigger words and their classification of the sentence to be tested.
[0015] The event detection method integrating graph attention and graph convolutional network described in the present invention combines the GCN vector and the GAT vector to obtain a fused vector during feature extraction. On the one hand, it can dynamically learn neighbor weights, and on the other hand, it can make full use of edge information and assign different weights to neighbor nodes according to the importance of the nodes, thereby fully extracting text information and improving the accuracy of trigger word recognition and classification.
[0016] Furthermore, the method for acquiring the sentence vector to be tested is: encoding each word in the sentence to be tested from text to digital by looking up a dictionary to obtain the sentence vector to be tested;
[0017] The BIO vector is obtained by: performing BIO annotation on the sentence vector to be tested, marking each word as BX, IX or O, thereby obtaining the BIO vector;
[0018] The POS vector is obtained by: performing POS annotation on the sentence vector to be tested to obtain the POS vector;
[0019] The dependency syntax graph is obtained by: parsing the sentence vector to be tested using dependency technology to obtain a dependency syntax tree, forming a node set from words in the dependency syntax tree, and obtaining a dependency edge set based on dependency arcs in the dependency syntax tree, thereby constructing the dependency syntax graph.
[0020] Through BIO annotation, the type and position of each word in the sentence can be annotated to improve the recognition and label classification capabilities of trigger words, thereby improving the accuracy of event detection. The POS annotation mode can solve the problem that one-hot encoding cannot extract word parts of speech.
[0021] Furthermore, the dependency edge set includes a forward dependency edge set, a reverse dependency edge set and a self-loop dependency edge set;
[0022] The dependency syntax graph includes a forward dependency syntax graph, a reverse dependency syntax graph and a self-loop dependency syntax graph.
[0023] By constructing three different edge sets to construct different dependency syntactic graphs of the same sentence to achieve the best effect of feature extraction, syntactic information can be extracted to the maximum extent.
[0024] Furthermore, the word vector is defined as:
[0025] x i =[w ib ,w ip ] (4)
[0026] In the formula, x iRepresents word w i The word vector of , i∈[1,n], n is a positive integer; w ib Represents word w i The BERT vector, w ip Represents word w i POS vector, [,] represents the connection operation;
[0027] The annotation sentence vector is defined as:
[0028] H=(x1,x2,...,x n ) (5)
[0029] Where H represents the labeled sentence vector.
[0030] Furthermore, step S5 is specifically as follows:
[0031] S51: Calculate the dependency weight and attention coefficient of each dependency edge in the dependency syntax graph, obtain the GCN vector according to the dependency weight, and calculate the GAT vector according to the attention coefficient;
[0032] S52: Calculate the fusion vector according to the GCN vector and the GAT vector;
[0033] S53: Determine whether the calculation times of the fusion vector reaches a predetermined number of times. If yes, execute step S6. If no, use the fusion vector as the labeled sentence vector and return to step S51.
[0034] The fusion vector is calculated by GCN vector and GAT vector, so that in the feature extraction process, while paying attention to neighbor nodes, different weights can be assigned according to the direct importance of different nodes, thereby enhancing the ability to extract information and improving the accuracy of event detection.
[0035] Furthermore, the calculation formula of the dependency weight is:
[0036]
[0037] In the formula, represents the dependency weight of the dependency edge, σ() represents the sigmoid function, The word vector representing the starting node of the dependency edge, represents the weight matrix in the gating mechanism, represents the bias matrix in the gating mechanism, m represents the number of calculations, when m = 1,
[0038] The calculation formula of the GCN vector is:
[0039]
[0040] In the formula, represents the GCN vector, f() represents the activation function, Indicates that the starting point is node v i The sum of the dependency weights of the dependency edges of i Represents node v j For the node v i neighbor nodes.
[0041] Furthermore, the calculation formula of the attention coefficient is:
[0042]
[0043] In the formula, Represents the attention coefficient, representing the node v j For the node v i The importance of the node v j For the node v i Neighbor nodes; k∈N i Represents node v k For the node v i One of the neighbor nodes of v; W represents the transformation matrix, through which the node v is transformed i The word vector of Dimension scaling is performed to obtain the node v i The middle vector Similarly, the node v is calculated j The middle vector Indicates that the node v i The middle vector and the node v j The middle vector They are combined by splicing; a represents a single-layer feedforward neural network, T represents the transpose of the matrix; LeakyReLU represents the activation function for nonlinear processing; the numerator of formula (8) represents the node v j For the node v i The attention coefficient of the node v i All neighbor nodes of the node v i The sum of the attention coefficients is finally divided by the exponential function of the natural constant e to achieve softmax normalization;
[0044] The calculation formula of the GAT vector is:
[0045]
[0046] In the formula, Represents the GAT vector.
[0047] Furthermore, the calculation formula of the fusion vector is:
[0048]
[0049] In the formula, Represents the fusion vector.
[0050] Furthermore, step S6 is specifically as follows:
[0051] A classification feature vector is calculated based on the fusion vector, and then the classification probability of each word is calculated based on the classification feature vector; the first K words are output as trigger words according to the size of the classification probability, or a probability threshold is set according to the data distribution of the classification probability, and the words with classification probability greater than the probability threshold are output as trigger words; and the event category of the trigger word is determined.
[0052] Furthermore, the calculation formula of the classification feature vector is:
[0053]
[0054] In the formula, h fin represents the classification feature vector, g() represents a nonlinear activation function, W' and b represent the weight matrix and bias value respectively;
[0055] The calculation formula of the classification probability is:
[0056] y i =softmax(h fin ) (12)
[0057] In the formula, y i Represents the i-th word w i The classification probability, softmax() represents the softmax function
[0058] Compared with the prior art, the event detection method provided by the present invention combines the graph attention network and the graph convolutional network in parallel, which can not only dynamically learn neighbor weights, but also make full use of edge information and assign different weights to neighbor nodes according to the importance of the nodes. Through the complementary advantages of the two, the error transmission problem brought by the traditional pipeline model is overcome, so that text information can be fully extracted during event detection, and the accuracy of trigger word recognition and classification can be improved. In addition, when performing data preprocessing of text, through BIO annotation, POS annotation and the construction of different dependency syntactic graphs, syntactic information can be extracted to the maximum extent, further improving the recognition ability of trigger words and label classification ability, thereby improving the accuracy of event detection.
[0059] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a schematic diagram of an event detection example in the background technology;
[0061] Figure 2 A flowchart of the steps of an event detection method integrating graph attention and graph convolutional network provided by one embodiment of the present invention;
[0062] Figure 3 A schematic diagram of a process of converting a sentence to be tested into a sentence vector to be tested provided by an embodiment of the present invention;
[0063] Figure 4 A schematic diagram of a process of performing BIO annotation on a sentence vector to be tested provided by an embodiment of the present invention;
[0064] Figure 5 A schematic diagram of a process of POS tagging a sentence vector to be tested provided by an embodiment of the present invention;
[0065] Figure 6 A schematic diagram of the structure of a dependency syntax tree provided by an embodiment of the present invention;
[0066] Figure 7 A network architecture diagram of an event detection model that integrates graph attention and graph convolutional networks provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0067] The existing GNN-based event detection method only uses a single GCN or GAT, so the text information extraction is incomplete and the accuracy of event detection is not high. The present invention uses BIO annotation and POS annotation in data preprocessing, and constructs different dependency syntactic graphs, and then combines GCN and GAT in parallel during feature extraction, which can fully extract semantic and syntactic information and improve the accuracy of trigger word recognition and classification.
[0068] See also Figure 2 , which is a flowchart of the steps of the event detection method of integrating graph attention and graph convolutional network provided in this embodiment. The event detection method includes the steps of:
[0069] S1: vectorize the sentence to be tested to obtain the sentence vector to be tested;
[0070] The method for obtaining the vector of the sentence to be tested is as follows: obtaining the sentence to be tested for event detection, and encoding each word in the sentence to be tested from text to digital by looking up a dictionary.
[0071] The dictionary used is the built-in dictionary of BERT (Bidirectional Encoder Representations from Transformers), which is a self-encoding language model that performs etymological and semantic pre-training on the test sentences. According to the input requirements of BERT, a classification identifier [CLS] is added to the beginning of the test sentence, a sentence separator [SEP] is added to the end of the test sentence, words that cannot be found in the dictionary are set to unknown identifiers [UNK], and sentences of insufficient length are filled with padding identifier [PAD] characters.
[0072] In this embodiment, based on the input convention of the information extraction system of the ACE2005 data set, the sentence to be tested is taken as the research object of event detection, and the detection result is the trigger word and its category in the sentence to be tested. Assume that the sentence to be tested is: S = (w1, w2, ..., w n ), where w i Represents a word, i∈[1,n], n is a positive integer. Then, the sentence to be tested is processed into the sentence vector to be tested: S'=([CLS],S,[SEP]).
[0073] S2: Obtain BIO vector, POS vector and dependency syntactic graph according to the sentence vector to be tested;
[0074] The BIO vector is obtained as follows: Perform BIO annotation on the sentence vector to be tested, and mark each word as BX, IX or O to obtain the BIO vector S b '=(w 1b ,w 2b ,...,w nb ). Among them, BIO annotation is a mode of sequence annotation; X represents the phrase type (such as noun phrase, prepositional phrase or verb phrase); B stands for Begin, indicating that the word is at the beginning of the segment; I stands for Intermediate, indicating that the word is in the middle of the segment; O stands for Other, indicating that it does not belong to any type and is used to mark irrelevant characters; BX means that the word belongs to type X and is at the beginning of the segment; IX means that the word belongs to type X and is in the middle of the segment.
[0075] Through BIO annotation, the type and position of each word in a sentence can be annotated, improving the ability to recognize trigger words and label classification, thereby improving the accuracy of event detection.
[0076] The POS vector is obtained as follows: Perform part-of-speech tagging (POS tagging) on the sentence vector to be tested to obtain the POS vector Sp '=(w 1p ,w 2p ,...,w np ). The dimension of each POS vector is 50.
[0077] The POS tagging mode can solve the problem that one-hot encoding cannot extract the part of speech of a word.
[0078] The dependency syntax graph is obtained as follows: The dependency syntactic tree of the sentence vector to be tested is obtained by parsing with dependency technology. The words in the dependency syntactic tree form a node set, and the dependency edge set is obtained according to the dependency arcs in the dependency syntactic tree, thereby constructing a dependency syntactic graph.
[0079] Dependency syntax aims to determine the syntactic structure of the sentence to be tested or the dependency relationship between words in the sentence to be tested. The dependency syntax tree is a form of display of dependency syntax. The words in the dependency syntax tree have a direct dependency relationship with each other, forming a dependency pair. The dependency relationship of each dependency pair is represented by a directed arc, called a dependency arc. Different dependency pairs have different dependency relationships. The dependency syntax tree of the sentence to be tested is constructed through dependency technology, and then the graph is constructed based on the dependency syntax tree.
[0080] The dependency syntax graph is defined as:
[0081] G(V,E)=V+E (1)
[0082] Where G(V,E) represents the dependency syntactic graph; V = (v1,v2,...,v n ) represents a node set, node v i Represents a word w in the sentence to be tested or in the dependency syntax tree i ; E=(K 12 ,K 13 ,...,K ij ) represents the dependency edge set, K ij According to the word w i and the word w j The dependency edges constructed by the dependency arcs between them, j∈N i , N i Represents node v i (or node i) is the collection of neighboring nodes.
[0083] Dependency edges include forward edges, reverse edges, and self-loop edges, so the dependency edge K ij is defined as:
[0084]
[0085] In the formula, K(v i ,v j) represents the positive edge, and the positive edge K(v i ,v j ) form a positive dependency edge set E f , and then construct the positive dependency syntactic graph G(V,E)=V+E f ; K(v j ,v i ) represents the reverse edge, and the reverse edge K(v j ,v i ) form a reverse dependency edge set E r , and then construct the reverse dependency syntax graph G(V,E)=V+E r ; K(v i ,v i ) represents a self-loop edge, and the self-loop edge K(v i ,v i ) form a self-circular dependency edge set E l , and then construct a self-circular dependency syntactic graph G(V,E)=V+E l , then:
[0086]
[0087] That is, the dependency edge set includes the forward dependency edge set, the reverse dependency edge set and the self-loop dependency edge set, and the constructed dependency syntax graph also includes the forward dependency syntax graph, the reverse dependency syntax graph and the self-loop dependency syntax graph. By constructing these three different edge sets to construct different dependency syntax graphs for the same sentence, the best effect of feature extraction can be achieved, and syntactic information can be extracted to the maximum extent.
[0088] S3: Encode the BIO vector to obtain the BERT vector.
[0089] Among them, the dimension of each BERT vector is 768 dimensions. In this embodiment, the BIO vector is encoded by a conventional BERT model, which can be a BERT-BASE model.
[0090] S4: Combine the BERT vector and the POS vector to obtain the word vector, and obtain the labeled sentence vector based on the word vector; the word vector is defined as:
[0091] x i =[w ib ,w ip ] (4)
[0092] In the formula, x i Represents word w i The word vector of , i∈[1,n], n is a positive integer; w ib Represents word w i The BERT vector, w ip Represents word wi POS vector of , [,] represents the concatenation operation; where the dimension of each word vector is 818.
[0093] The definition of the labeled sentence vector is:
[0094] H=(x1,x2,...,x n ) (5)
[0095] Where H represents the labeled sentence vector.
[0096] S5: Extract features from the labeled sentence vector and dependency syntax graph to obtain the GCN vector and the GAT vector, and calculate the fusion vector based on the GCN vector and the GAT vector;
[0097] The specific steps are:
[0098] S51: Calculate the dependency weight and attention coefficient of each dependency edge in the dependency syntax graph, calculate the GCN vector based on the dependency weight, and calculate the GAT vector based on the attention coefficient; introduce a gating mechanism when calculating the dependency weight to reduce the noise in the dependency syntax graph. i ,v j ) as an example to illustrate how to obtain GCN vectors and GAT vectors.
[0099] The calculation formula of dependency weight is:
[0100]
[0101] In the formula, represents the dependency weight of the dependency edge, σ() represents the sigmoid function, The word vector representing the starting node of the dependency edge, represents the weight matrix in the gating mechanism, represents the bias matrix in the gating mechanism; m represents the number of calculations, when m = 1,
[0102] The calculation formula of GCN vector is:
[0103]
[0104] In the formula, represents the GCN vector, f() represents the activation function, Indicates that the starting point is node v i The sum of the dependency weights of the dependency edges of i Represents node v j For node v i neighbor nodes.
[0105] The calculation formula of attention coefficient is:
[0106]
[0107] In the formula, Represents the attention coefficient, representing the node v j For node v i The importance of node v j For node v i Neighbor nodes; k∈N i Represents node v k For node v i One of the neighbor nodes; W represents the transformation matrix, through the transformation matrix For node v i The word vector of Dimension scaling is performed to obtain node v i The middle vector Similarly, we calculate node v j The middle vector Indicates that the node v i The middle vector and node v j The middle vector They are combined by splicing; a represents a single-layer feedforward neural network, T represents the transpose of the matrix; LeakyReLU represents the activation function for nonlinear processing; the numerator of formula (8) represents the node v j For node v i The attention coefficient of node v i All neighbor nodes of node v i The sum of the attention coefficients is finally divided by the exponential function of the natural constant e to achieve softmax normalization.
[0108] The calculation formula of GAT vector is:
[0109]
[0110] In the formula, Represents a GAT vector.
[0111] S52: Calculate a fusion vector based on the GCN vector and the GAT vector;
[0112] The calculation formula of the fusion vector is:
[0113]
[0114] In the formula, Represents the fusion vector.
[0115] S53: Determine whether the number of calculations of the fusion vector reaches a predetermined number. If so, execute step S6. If not, use the fusion vector as the labeled sentence vector and return to step S51. In this embodiment, the predetermined number is 3, then determine whether the number of calculations reaches 3, that is, whether m=3 is satisfied.
[0116] S6: Classify and identify the fused vector to obtain the trigger words and their classification of the sentence to be tested.
[0117] The classification feature vector is calculated based on the fusion vector, and then the classification probability of each word is calculated based on the classification feature vector; the first K words are output as the recognized trigger words according to the size of the classification probability, or a probability threshold is set according to the data distribution of the classification probability, and the words with classification probability greater than the probability threshold are output as trigger words; finally, the event category of the trigger word is determined.
[0118] The calculation formula for the classification feature vector is:
[0119]
[0120] In the formula, h fin represents the classification feature vector, g() represents a nonlinear activation function, W' and b represent the weight matrix and bias value respectively.
[0121] The calculation formula for classification probability is:
[0122] y i =soft max(h fin ) (12)
[0123] In the formula, y i Represents the i-th word w i The classification probability of , softmax() represents the softmax function.
[0124] The method of the present invention is described with respect to a single sentence, but the method can be similarly applied to event detection of multiple sentences or texts. The present invention is described below through a specific embodiment.
[0125] See also Figure 3 , which is a schematic diagram of the process of converting a sentence to be tested into a sentence vector to be tested provided by this embodiment. Taking the sentence "The blood of soldiers scattered between the jungles became evidence that they were fired." as an example, a classification identifier [CLS] is added to the beginning of the sentence, and a sentence separator [SEP] is added to the end of the sentence. Then, the words in the sentence are converted into digital codes through the built-in dictionary of BERT to obtain the sentence vector to be tested.
[0126] See also Figure 4 , which is a schematic diagram of the process of BIO labeling of the sentence vector to be tested provided by this embodiment. In the example sentence in the figure, the trigger word is fired, but since fired is only one word and not a phrase, there is no need to mark the phrase type X, and there is only a start mark B, no middle mark I, and the labels of other words are all O. Then the sentence after BIO labeling is "O-The O-blood O-of O-soldiers O-scattered O-between O-the O-jungles O-becameO-evidence O-that O-they O-were B-fired". For the BIO vector S b '=(w 1b ,w 2b ,...,w nb ), w 1b =O-The, ..., w 14b =B-fired.
[0127] See also Figure 5 , which is a schematic diagram of the process of POS tagging the sentence vector to be tested provided by this embodiment. Among them, DT represents a determiner, NN represents a singular or mass in a noun, IN represents a preposition or subordination conjunction, NNS represents a plural noun, VBN represents a past participle of a verb, VBD represents a past tense of a verb, and PRP$ represents a possessive pronoun. After POS tagging, the sentence is "DT, NN, IN, NNS, VBN, IN, DT, NNS, VBD, NN, IN, PRP$, VBD, VBN". For the POS vector S p '=(w 1p ,w 2p ,...,w np ), w 1p =DT, ..., w 14p =VBN.
[0128] Then the word vector x1 = [O-The,DT], ..., x 14 =[B-fired,VBN];
[0129] Label sentence vector H = (x1, x2, ..., x 14 ).
[0130] See also Figure 6 , which is a schematic diagram of the structure of the dependency syntax tree provided in this embodiment. The dependency relationship of each dependency pair is represented by a directed dependency arc. Figure 6 In the graph, the arrows are represented by arrows, the starting end of the arrow is the dependent word, and the end of the arrow is the dominant word; a unidirectional arrow represents a dependency arc, and a bidirectional arrow represents two dependency arcs. The text on the dependency arc represents different dependency relationships, and each dependency arc represents the semantic association between two words, that is, there is an edge in the dependency syntactic graph.
[0131] After constructing the dependency syntactic graph according to the dependency syntactic tree, feature extraction is performed on the labeled sentence vector and the dependency syntactic graph to obtain a fused vector, which is then classified and identified to obtain the classification probability of each word. According to the set conditions, several words with high probability are output as trigger words, and the event category of each trigger word is determined.
[0132] In the sentence "The blood of soldiers scattered between the jungles became evidence that they were fired.", the classification probability of "fired" is calculated to be the highest. If it is set to output only one trigger word (i.e. K = 1), the trigger word "fired" is output and classified as an attack event. Figure 1 In the example, a sentence can include multiple events or multiple trigger words. In this case, the value of K or the probability threshold should be appropriately adjusted during event detection to improve the accuracy and reliability of event detection.
[0133] Please refer to Table 1, which is a table of experimental results of the event detection method provided by this embodiment and the existing event detection method. Wherein, P represents the accuracy of event detection, which is defined as: R represents the recall rate of event detection, which is defined as: F1 represents the harmonic mean of precision and recall, which is defined as: It can be seen from Table 1 that the accuracy and recall rate of the event detection method provided in this embodiment are generally greater than other existing event detection technologies; the F1 value combines the results of the accuracy rate and the recall rate, and the F1 value is significantly better than the existing technology, indicating that the event detection method provided by the present invention has significant effectiveness, accuracy and reliability.
[0134] Table 1. Comparison of detection results of the event detection method provided by this embodiment and the existing event detection method
[0135]
[0136] Based on the above event detection method, the present invention also provides an event detection model that integrates graph attention and graph convolutional network. Figure 7 , which is a network architecture diagram of an event detection model that integrates graph attention and graph convolutional network provided in this embodiment. The event detection model includes a data preprocessing module, at least one fusion graph neural network module and a classification recognition module.
[0137] The data preprocessing module includes a sentence vectorization unit, a BIO tagging unit, a POS tagging unit, a dependency syntax parsing unit, a BERT embedding unit and a labeled sentence acquisition unit. The sentence vectorization unit converts the words in the sentence to be tested from text to digital codes to obtain the sentence vector to be tested; the BIO tagging unit performs BIO tagging on the sentence vector to be tested, and marks each word as BX, IX or O to obtain the BIO vector; the POS tagging unit performs POS tagging on the sentence vector to be tested to obtain the POS vector; the dependency syntax parsing unit obtains the dependency syntax tree of the sentence to be tested by using dependency technology, and the words in the dependency syntax tree form a node set, and obtains the dependency edge set according to the dependency arcs in the dependency syntax tree, thereby constructing a dependency syntax graph; the BERT embedding unit encodes the BIO vector to obtain the BERT vector; the labeled sentence acquisition unit combines the BERT vector and the POS vector to obtain the word vector, and obtains the labeled sentence vector according to the word vector.
[0138] The fusion graph neural network module extracts features from the annotated sentence vector and the dependency syntax graph to obtain a fusion vector. This module includes a GCN unit, a GAT unit, and a fusion unit that are set in parallel. The GCN unit calculates the dependency weight of each dependency edge in the dependency syntax graph, and obtains the GCN vector based on the dependency weight; the GAT unit calculates the attention coefficient of each dependency edge in the dependency syntax graph, and calculates the GAT vector based on the attention coefficient; the fusion unit calculates the fusion vector based on the GCN vector and the GAT vector.
[0139] In this embodiment, the event detection model superimposes three fusion graph neural network modules in sequence. The fusion vector output by the previous fusion graph neural network module is used as the labeled sentence vector input by the next fusion graph neural network module, and the fusion vector calculated by the last fusion graph neural network module is directly input into the classification and recognition module.
[0140] The classification recognition module classifies and recognizes the fusion vector to obtain the trigger words and their classification of the sentence to be tested. The module includes a fully connected layer and a softmax layer. The fully connected layer calculates the classification feature vector based on the fusion vector; the softmax layer calculates the classification probability of each word based on the classification feature vector, and outputs the words with high classification probability as trigger words according to the set conditions, and finally determines the event category of the trigger word.
[0141] Compared with the prior art, the event detection method provided by the present invention combines the graph convolutional neural network and the graph attention neural network, which can not only dynamically learn neighbor weights, but also assign different weights to neighbor nodes according to the importance of the nodes. Through the complementary advantages of the two, the text information can be fully extracted during event detection, and the accuracy of trigger word recognition and classification can be improved. In addition, when preprocessing text data, through BIO annotation, POS annotation and the construction of different dependency syntactic graphs, syntactic information can be extracted to the maximum extent, further improving the recognition ability of trigger words and label classification ability, thereby improving the accuracy of event detection.
[0142] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. An event detection method integrating graph attention and graph convolutional network, characterized in that: Includes steps: S1: vectorize the sentence to be tested to obtain the sentence vector to be tested; S2: Obtaining a BIO vector, a POS vector and a dependency syntactic graph according to the sentence vector to be tested; S3: Encode the BIO vector to obtain a BERT vector; S4: Combining the BERT vector and the POS vector to obtain a word vector, and obtaining a labeled sentence vector according to the word vector; S5: extracting features from the annotated sentence vector and the dependency syntax graph to obtain a GCN vector and a GAT vector, and calculating a fusion vector based on the GCN vector and the GAT vector; wherein the step S5 specifically includes the following sub-steps: S51: Calculate the dependency weight and attention coefficient of each dependency edge in the dependency syntax graph, obtain the GCN vector according to the dependency weight, and calculate the GAT vector according to the attention coefficient; S52: Calculate the fusion vector according to the GCN vector and the GAT vector; S53: Determine whether the calculation times of the fusion vector reaches a predetermined number of times, if yes, execute step S6, if no, use the fusion vector as the annotated sentence vector, and return to step S51; S6: Classify and identify the fusion vector to obtain the trigger words and their classification of the sentence to be tested.
2. The event detection method integrating graph attention and graph convolutional network according to claim 1, characterized in that: The method of obtaining the sentence vector to be tested is: encoding each word in the sentence to be tested from text to digital by looking up a dictionary to obtain the sentence vector to be tested; The BIO vector is obtained by: performing BIO annotation on the sentence vector to be tested, marking each word as BX, IX or O, thereby obtaining the BIO vector; The POS vector is obtained by: performing POS annotation on the sentence vector to be tested to obtain the POS vector; The dependency syntax graph is obtained by: parsing the sentence vector to be tested using dependency technology to obtain a dependency syntax tree, forming a node set from words in the dependency syntax tree, and obtaining a dependency edge set based on dependency arcs in the dependency syntax tree, thereby constructing the dependency syntax graph.
3. The event detection method integrating graph attention and graph convolutional network according to claim 2, characterized in that: The dependency edge set includes a forward dependency edge set, a reverse dependency edge set and a self-loop dependency edge set; The dependency syntax graph includes a forward dependency syntax graph, a reverse dependency syntax graph and a self-loop dependency syntax graph.
4. The event detection method integrating graph attention and graph convolutional network according to claim 1, characterized in that: The word vector is defined as: x i =[w ib ,w ip ] (4) In the formula, x i Represents word w i The word vector of , i∈[1,n], n is a positive integer; w ib Represents word w i The BERT vector, w ip Represents word w i POS vector, [,] represents the connection operation; The annotation sentence vector is defined as: H=(x1,x2,...,x n ) (5) Where H represents the labeled sentence vector.
5. The event detection method integrating graph attention and graph convolutional network according to claim 4, characterized in that: The calculation formula of the dependency weight is: In the formula, represents the dependency weight of the dependency edge, σ() represents the sigmoid function, The word vector representing the starting node of the dependency edge, represents the weight matrix in the gating mechanism, represents the bias matrix in the gating mechanism, m represents the number of calculations, when m = 1, The calculation formula of the GCN vector is: In the formula, represents the GCN vector, f() represents the activation function, Indicates that the starting point is node v i The sum of the dependency weights of the dependency edges of i Represents node v j For the node v i neighbor nodes.
6. The event detection method integrating graph attention and graph convolutional network according to claim 5, characterized in that: The calculation formula of the attention coefficient is: In the formula, Represents the attention coefficient, representing the node v j For the node v i The importance of the node v j For the node v i Neighbor nodes; k∈N i Represents node v k For the node v i One of the neighbor nodes of v; W represents the transformation matrix, through which the node v is transformed i The word vector of Dimension scaling is performed to obtain the node v i The middle vector Similarly, the node v is calculated j The middle vector Indicates that the node v i The middle vector and the node v j The middle vector They are combined by splicing; a represents a single-layer feedforward neural network, T represents the transpose of the matrix; LeakyReLU represents the activation function for nonlinear processing; the numerator of formula (8) represents the node v j For the node v i The attention coefficient of the node v i All neighbor nodes of the node v i The sum of the attention coefficients is finally divided by the exponential function of the natural constant e to achieve softmax normalization; The calculation formula of the GAT vector is: In the formula, Represents the GAT vector.
7. The event detection method integrating graph attention and graph convolutional network according to claim 6, characterized in that: The calculation formula of the fusion vector is: In the formula, Represents the fusion vector.
8. The event detection method integrating graph attention and graph convolutional network according to claim 1, characterized in that: Step S6 is specifically as follows: A classification feature vector is calculated based on the fusion vector, and then the classification probability of each word is calculated based on the classification feature vector; the first K words are output as trigger words according to the size of the classification probability, or a probability threshold is set according to the data distribution of the classification probability, and the words with classification probability greater than the probability threshold are output as trigger words; and the event category of the trigger word is determined.
9. The event detection method integrating graph attention and graph convolutional network according to claim 8, characterized in that: The calculation formula of the classification feature vector is: In the formula, h fin represents the classification feature vector, g() represents a nonlinear activation function, W' and b represent the weight matrix and bias value respectively; The calculation formula of the classification probability is: and i =softmax(h fin ) (12) In the formula, y i Represents the i-th word w i The classification probability of , softmax() represents the softmax function.
