Chinese and English event detection method based on relation vision field composition
By introducing a relational vision composition and graph attention network into event detection technology, combining the polysynonyms and word order characteristics of Chinese, the problem of low Chinese event detection accuracy in the existing technology is solved, and efficient prediction of Chinese and English event detection is achieved. in different fields and languages.
Patent Information
- Application Number
- CN202411281138.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-20
AI Technical Summary
When dealing with Chinese, existing event detection technology ignores the importance of polysynonyms and word order, resulting in the problem of inconsistent matching between the trigger words and the words in the text, resulting in low prediction accuracy, especially in cross-domain applications. insufficient.
Using a method based on relational vision composition, a graph neural network is used to construct a structural diagram of event type association, and embed this correlation information into the graph attention network. By exploring the intrinsic connections between event types, an event type encoder is designed. and mask attention mechanism, fuse entity context and event type information, and perform Chinese and English event detection.
It significantly improves the prediction accuracy of low resource event types, can effectively complete the Chinese and English event detection tasks, reduces the noise interference associated with event, and improves detection performance.
Smart Images

Figure CN119167923A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a Chinese and English event detection method based on relational visual field composition, belonging to the technical field of event detection. Background Art
[0002] Event detection technology is an important branch of natural language processing. It is dedicated to identifying specific types of events from text and classifying and understanding these events. It helps build the ability of intelligent systems to understand and generate natural language. For example, in scenarios such as news aggregation, social media monitoring, public opinion analysis, and knowledge graph construction, it can effectively extract key information, perform accurate content classification, and track topics. At the same time, event detection is also the basis of many advanced NLP tasks, such as sentiment analysis, relationship extraction, and event reasoning. Through the development of deep learning and machine learning technologies, the accuracy and efficiency of event detection have been significantly improved, giving artificial intelligence stronger language understanding and processing capabilities.
[0003] In the existing event detection technology framework, it is mainly divided into two categories: feature engineering-based methods and deep learning-based neural network strategies. The former mainly uses natural language processing tools to carefully design features through detailed lexical, syntactic and semantic analysis of the text. These methods have excellent accuracy. However, their high reliance on manual feature design makes them lack versatility and scalability in cross-domain applications. In contrast, neural network-based methods convert text into high-dimensional word embeddings (Word Embeddings) and allow neural networks to learn and extract features from massive data on their own. This method significantly reduces manual intervention and reduces errors introduced by external tools, so it occupies a dominant position in current research trends.
[0004] However, it is worth noting that most neural network-based methods focus on English processing, simplifying event detection to mapping between words, and ignoring the characteristics of the Chinese language. The importance of polysemy and word order in Chinese is not fully utilized in these methods, resulting in the fact that their effectiveness may be greatly reduced when dealing with the problem of inconsistent matching between trigger words and words in the text. Therefore, how to effectively combine the advantages of neural networks and Chinese and English natural language processing in order to improve the specificity of Chinese event detection is an important issue that needs to be solved in current research. Summary of the invention
[0005] In order to solve the problem of low prediction accuracy in the prior art, the present invention provides a Chinese and English event detection method based on relational view composition. The method uses a graph neural network to construct a structural graph of event type associations, and effectively embeds this association information into a graph attention network. This strategy aims to improve the performance of the model by exploring the intrinsic connections between event types.
[0006] To achieve the above object, the technical solution adopted by the present invention is a Chinese and English event detection method based on relational view composition, comprising the following steps: S1. Treat all candidate trigger words as candidate entities and generate entity context representation E based on the text sequence encoder; S2. Design an event type encoder to define an embedded representation T for all event types, thereby modeling the relationship between event types; S3: Deeply fuse the context representation E of the candidate entity and the representation T of the event type to obtain the fused representation of the context entity event type information. , and then use the masked attention mechanism to obtain the masked self-attention score matrix M of the candidate entity and the predicted event type, and add the masked self-attention score matrix M to the context entity representation to obtain each target entity representation Z; S4. Based on the trained model, the correlation between event types between entities is used to make accurate predictions.
[0007] Preferably, when performing step S1, the following steps are performed: a1. The event sentence character sequence to be detected Input the pre-trained model BERT encoder to generate the hidden state of the text representation conditioned on the word context , as shown in formula (1): (1) a2. In the candidate trigger words Perform the maximum pooling operation Max() on the token representation to generate each candidate entity representation , as shown in formula (2): (2).
[0008] Preferably, when performing step S2, the following steps are performed: b1, first convert each event type in the event type set into a word vector sequence, and then calculate the semantic similarity between the event types, and calculate the similarity between each event type vector and other event categories to obtain a corresponding similarity vector , the weighted cosine similarity function is used for calculation, as shown in formula (3): (3) in, represents the Hadamard product, is a learnable weight vector, are two event type vectors and Similarity at the pth semantics; similar to the multi-head learner, use m weight vectors, let each weight vector represent a semantics, use the above similarity function to calculate m independent similarity matrices, and use their average as the final similarity ; b2. Based on the similarity scores between event types, an undirected fully connected graph is constructed, and then the generated graph is pruned using the ε neighborhood to make the graph sparse. The purpose of sparseness is to shield the weak relationship between event types, so that the event type relationship reduces the performance impact on the final prediction result. Through the graph pruning operation, the cosine similarity matrix is converted into a sparse matrix. Positions below the threshold ε will be shielded and replaced with negative infinity, so that the output after Softmax is 0, and positions above or equal to the threshold retain the original value, as shown in the following formula (4): (4) b3. Use graph neural network GNN to enhance the relational embedding of types so that these type embeddings have mutual correlation. Specifically, perform GCN convolution operation on the sparse matrix A generated in the previous step, add the type embedding vector after graph convolution to the original type embedding vector to obtain the type embedding vector containing type correlation, and finally obtain the vector representation T of event category information, denoted as , as shown in formula (5): (5) in, is the vector representation of the event type corresponding to the i-th node, i.e., type embedding. Embed for type The vector representation obtained after linear transformation is: For GNN Layer graph convolution kernel function, is the hyperparameter of this layer. For Node The vector representation of the corresponding event category is integrated with other event type information. In particular, Represents an empty event type. N is the set of all nodes in the graph that have edges with the i-th node, j∈N represents the j-th node in the node set, and the ReLU function is a nonlinear activation function.
[0009] Preferably, when performing step S3, the following steps are performed: c1. In order to capture instance relevance, the context instance type information is further integrated into the instance representation. Specifically, by calculating the probability score of each instance belonging to a certain event type, the instance type probability representation is obtained, and then all type representations are aggregated to obtain the instance representation of the fused context entity type. , as shown in formula (6): (6) c2. Use the masked self-attention mechanism to capture the connection between the contextual entity type information and the predicted entity type. Two types of masked self-attention scores need to be calculated: one is the self-attention score of the entity itself, and the other is the attention score with the context entity. The two attention scores are combined into a masked self-attention score matrix. Specifically, the attention interaction score S between the entity of the full mask symbol and the entity of the non-full mask is calculated using formula (6) 1 , S 2 , (7) Here, the self-attention mechanism adopts Calculate, where W Q and W K is a learnable parameter. The superscript T in the self-attention calculation formula represents the matrix transpose operation. It is a linear fusion parameter matrix, [:] performs matrix-vector element concatenation operation.
[0010] c3. The entity's own attention score S 1 Place it on the diagonal and add the attention score S of the context entity 2 Place it on the off-diagonal line to generate the mask self-attention score matrix M, as shown in Formula 7. To facilitate the prediction calculation, the matrix elements map the attention scores to the probability distribution through the Softmax function (as shown in Formula 8), and then add the mask self-attention score matrix M to the context instance information to obtain the fusion representation Z that integrates the context entity type information and is related to the predicted entity type, as shown in Formula 9: (7) (8) (9).
[0011] Preferably, when performing step S4, the following steps are performed: The target entity event type is predicted using these fused feature representations as shown in formula (10): (10) Among them, the probability of each candidate word to the empty type is expressed as , the probability of other event types is expressed as , as shown in formula (11), (11) During the prediction process, if the score is greater than the threshold, the type is returned as the final prediction, otherwise an empty type is returned, as shown in formula (12). (12) During the training process, the following loss is minimized as much as possible. The loss function is shown in formula (13): (13).
[0012] Compared with the prior art, the present invention has the following technical effects: The present invention uses a graph neural network to construct a structural diagram of event type associations, and effectively embeds this association information into a graph attention network. This strategy aims to improve the detection performance of the model by exploring the intrinsic connections between event types. By constructing an event type relationship graph, the event type correlation associated with trigger words is fully utilized, thereby greatly improving the prediction accuracy of low-resource event types and being able to complete the task of Chinese and English event detection; by integrating the features of instance context data and event types, especially strengthening the connection between highly correlated events, the noise interference of event associations is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a schematic diagram of the structure of the present invention.
[0014] Figure 2 The schematic diagram of the module is generated by the example of the present invention.
[0015] Figure 3 This is an architectural diagram of the event type relationship construction module of the present invention.
[0016] Figure 4 This is the masked self-attention score matrix diagram of the present invention. DETAILED DESCRIPTION
[0017] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.
[0018] like Figures 1 to 4 As shown, a Chinese and English event detection method based on relational view composition includes the following steps: S1. Treat all candidate trigger words as candidate entities and generate entity context representation E based on the text sequence encoder; S2. Design an event type encoder to define an embedded representation T for all event types, thereby modeling the relationship between event types; S3: Deeply fuse the context representation E of the candidate entity and the representation T of the event type to obtain the fused representation of the context entity event type information. , and then use the masked attention mechanism to obtain the attention score matrix M of the candidate entity and the predicted event type, and add M to the context entity representation to obtain each target entity representation Z; S4. Based on the trained model, the correlation between event types between entities is used to make accurate predictions.
[0019] When performing step S1, the following steps are performed: a1. The event sentence character sequence to be detected Input the pre-trained model BERT encoder to generate the hidden state of the text representation conditioned on the word context , as shown in formula (1): (1) a2. In the candidate trigger words Perform the maximum pooling operation Max() on the token representation to generate each candidate entity representation , as shown in formula (2): (2).
[0020] When performing step S2, follow the steps below: b1. First, convert each event type in the event type set into a word vector sequence, and then calculate the semantic similarity between event types. The similarity between each event type vector and other event categories is calculated to obtain a corresponding similarity vector , the weighted cosine similarity function is used for calculation, as shown in formula (3): (3) in, represents the Hadamard product, is a learnable weight vector, are two event type vectors and Similarity at the pth semantics; similar to the multi-head learner, use m weight vectors, let each weight vector represent a semantics, use the above similarity function to calculate m independent similarity matrices, and use their average as the final similarity ; b2. Based on the similarity scores between event types, an undirected fully connected graph is constructed, and then the generated graph is pruned using the ε neighborhood to make the graph sparse. The purpose of sparseness is to shield the weak relationship between event types, so that the event type relationship reduces the performance impact on the final prediction result. Through the graph pruning operation, the cosine similarity matrix is converted into a sparse matrix. Positions below the threshold ε will be shielded and replaced with negative infinity, so that the output after Softmax is 0, and positions above or equal to the threshold retain the original value, as shown in the following formula (4): (4) b3. Use graph neural network GNN to enhance the relational embedding of types so that these type embeddings have mutual correlation. Specifically, perform GCN convolution operation on the sparse matrix A generated in the previous step, add the type embedding vector after graph convolution to the original type embedding vector to obtain the type embedding vector containing type correlation, and finally obtain the vector representation T of event category information, denoted as , as shown in formula (5): (5) in, is the vector representation of the event type corresponding to the i-th node, i.e., type embedding. Embed for type The vector representation obtained after linear transformation is: For GNN Layer graph convolution kernel function, is the hyperparameter of this layer. For Node The vector representation of the corresponding event category is integrated with other event type information. In particular, Represents an empty event type. N is the set of all nodes in the graph that have edges with the i-th node, j∈N represents the j-th node in the node set, and the ReLU function is a nonlinear activation function.
[0021] When performing step S3, follow the steps below: c1. In order to capture instance relevance, the context instance type information is further integrated into the instance representation. Specifically, by calculating the probability score of each instance belonging to a certain event type, the instance type probability representation is obtained, and then all type representations are aggregated to obtain the instance representation of the fused context entity type. , as shown in formula (6): (6) c2. Use the masked self-attention mechanism to capture the connection between the contextual entity type information and the predicted entity type. Two types of masked self-attention scores need to be calculated: one is the self-attention score of the entity itself, and the other is the attention score with the context entity. The two attention scores are combined into a masked self-attention score matrix. Specifically, the attention interaction score S between the entity of the full mask symbol and the entity of the non-full mask is calculated using formula (6) 1 , S 2 , (7) Here, the self-attention mechanism adopts Calculate, where W Q and W K is a learnable parameter. The superscript T in the self-attention calculation formula represents the matrix transpose operation. It is a linear fusion parameter matrix, [:] performs matrix-vector element concatenation operation.
[0022] Furthermore, the entity’s attention score S 1 Place it on the diagonal and add the attention score S of the context entity 2 Place it on the off-diagonal line to generate the mask self-attention matrix M, as shown in Formula 7. To facilitate the prediction calculation, the matrix elements map the attention scores to probability distributions through the Softmax function (as shown in Formula 8), and then add M to the context instance information to obtain the fused representation Z that integrates the context entity type information and is related to the predicted entity type, as shown in Formula 9.
[0023] (7) (8) (9).
[0024] When performing step S4, the following steps are performed: The target entity event type is predicted using these fused feature representations as shown in formula (10): (10) Among them, the probability of each candidate word to the empty type is expressed as , the probability of other event types is expressed as , as shown in formula (11), (11) During the prediction process, if the score is greater than the threshold, the type is returned as the final prediction, otherwise an empty type is returned, as shown in formula (12). (12) During the training process, the following loss is minimized as much as possible. The loss function is shown in formula (13): (13).
[0025] The present invention overcomes the shortcoming of existing event detection methods that most directly divide candidate trigger words into fine-grained event types and ignore the rich semantic correlation contained in the event type structure. By modeling the complex associations between multiple events in a sentence, the type representation is not only learned from the training data, but also from the event type, thereby generating a more information-rich type representation. The information fusion layer constructed by the present invention fuses the event type relationship information with the instance information, thereby achieving accurate prediction of the current event type through the event type of the context. The method can also mine the correlation of event types in instances, significantly improving the detection of low-resource event types. The method is applicable to both Chinese and English languages, as well as event detection tasks in different fields.
[0026] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims
1. A Chinese and English event detection method based on relational view composition, characterized by: The following steps are involved: S1. Treat all candidate trigger words as candidate entities and generate entity context representation E based on the text sequence encoder; S2. Design an event type encoder to define an embedded representation T for all event types, thereby modeling the relationship between event types; S3: Deeply fuse the context representation E of the candidate entity and the representation T of the event type to obtain the fused representation of the context entity event type information. , and then use the masked attention mechanism to obtain the masked self-attention score matrix M of the candidate entity and the predicted event type, and add the masked self-attention score matrix M to the context entity representation to obtain each target entity representation Z; S4. Based on the trained model, the correlation between event types between entities is used to make accurate predictions.
2. The Chinese and English event detection method based on relational view composition according to claim 1 is characterized in that: When performing step S1, follow the steps below: a1. The event sentence character sequence to be detected Input the pre-trained model BERT encoder to generate the hidden state of the text representation conditioned on the word context , as shown in formula (1): (1) a2. In the candidate trigger words Perform the maximum pooling operation Max() on the token representation to generate each candidate entity representation , as shown in formula (2): (2)。 3. The Chinese and English event detection method based on relational view composition according to claim 1 is characterized in that: When performing step S2, follow the steps below: b1. First, convert each event type in the event type set into a word vector sequence, and then calculate the semantic similarity between event types. The similarity between each event type vector and other event categories is calculated to obtain a corresponding similarity vector. , the weighted cosine similarity function is used for calculation, as shown in formula (3): (3) in, represents the Hadamard product, is a learnable weight vector, are two event type vectors and Similarity at the pth semantics; similar to the multi-head learner, use m weight vectors, let each weight vector represent a semantics, use the above similarity function to calculate m independent similarity matrices, and use their average as the final similarity ; b2. Based on the similarity scores between event types, an undirected fully connected graph is constructed. Then, the generated graph is pruned using the ε neighborhood to make it sparse. Through the graph pruning operation, the cosine similarity matrix is converted into a sparse matrix. Positions below the threshold ε will be masked and replaced with negative infinity, so that the output after Softmax is 0, and positions above or equal to the threshold retain the original value, as shown in the following formula (4): (4) b3. Use graph neural network GNN to enhance the relational embedding of types so that these type embeddings have mutual correlation. Specifically, perform GCN convolution operation on the sparse matrix A generated in the previous step, add the type embedding vector after graph convolution to the original type embedding vector to obtain the type embedding vector containing type correlation, and finally obtain the vector representation T of event category information, denoted as , as shown in formula (5): (5) in, is the vector representation of the event type corresponding to the i-th node, i.e., type embedding. Embed for type The vector representation obtained after linear transformation is: For GNN Layer graph convolution kernel function, is the hyperparameter of this layer, For Node The vector representation of the corresponding event category is integrated with other event type information. In particular, Represents an empty event type, N is the set of all nodes in the graph that have edges connected to the i-th node, j∈N represents the j-th node in the node set, and the ReLU function is a nonlinear activation function.
4. The Chinese and English event detection method based on relational view composition according to claim 1 is characterized in that: When performing step S3, follow the steps below: c1. Integrate the context instance type information into the instance representation, that is, by calculating the probability score of each instance belonging to a certain event type, obtain the instance type probability representation, and then aggregate all type representations to obtain the instance representation of the fused context entity type. , as shown in formula (6): (6) c2. Using the masked self-attention mechanism to capture the connection between the contextual entity type information and the predicted entity type, it is necessary to calculate two types of masked self-attention scores, that is, using formula (6) to calculate the attention interaction score S between the entity of the full mask symbol and the entity of the non-full mask. 1 , S 2 , (7) Among them, the self-attention mechanism adopts Calculate, W Q and W K is a learnable parameter. The superscript T in the self-attention calculation formula represents the matrix transposition operation. It is a linear fusion parameter matrix, [:] performs matrix-vector element concatenation operation; c3. The entity's own attention score S 1 Place it on the diagonal and add the attention score S of the context entity 2 Place it on the off-diagonal line to generate the mask self-attention score matrix M, as shown in Formula 7. The matrix elements map the attention scores to the probability distribution through the Softmax function as shown in Formula 8. Then, the mask self-attention score matrix M is added to the context instance information to obtain the fused representation Z related to the predicted entity type and fused with the context entity type information, as shown in Formula 9. (7) (8) (9)。 5. The Chinese and English event detection method based on relational view composition according to claim 1 is characterized in that: When performing step S4, the following steps are performed: The target entity event type is predicted using these fused feature representations as shown in formula (10): (10) Among them, the probability of each candidate word to the empty type is expressed as , the probability of other event types is expressed as , as shown in formula (11), (11) During the prediction process, if the score is greater than the threshold, the type is returned as the final prediction, otherwise an empty type is returned, as shown in formula (12). (12) During the training process, the following loss is minimized as much as possible. The loss function is shown in formula (13): (13)。
Citation Information
Cited By
Power grid operation event extraction and disposal method and system based on large language model
CN121210629A
Private data access intention recognition and abnormal behavior blocking method and system based on deep learning
CN121864496A
Privacy data access intention recognition and abnormal behavior blocking method and system based on deep learning
CN121864496B
