An event detection method and device based on a graph perturbation strategy
By combining syntactic information and graph convolutional networks, an event detection method based on graph perturbation strategy is proposed to solve the long-distance dependency problem, improve the accuracy and F1 score of event detection, and achieve more efficient event trigger word recognition and classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-03
- Publication Date
- 2026-03-17
AI Technical Summary
Existing event detection methods are inefficient when dealing with long-distance dependency problems and struggle to effectively identify and classify event trigger words.
An event detection method based on graph perturbation strategy is adopted. By generating syntactic information adjacency matrix and concatenated vector, information is propagated on the syntactic graph using graph convolutional network layers. Graph perturbation is performed by combining node density and edge sparsity to extract important node information and filter irrelevant nodes. The output information is optimized by combining attention mechanism to predict the type of context words.
It effectively solves the problem of low classification efficiency caused by excessive redundant information in long sentences, improves the accuracy of event detection and F1 score, and enhances the recognition and classification effect of trigger words.
Smart Images

Figure CN113988052B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing, and in particular to an event detection method and apparatus based on a graph perturbation strategy. Background Technology
[0002] Natural Language Processing (NLP) is a technology that uses natural language, the language humans use for communication, to interact and communicate with machines. Its task is to allow computers to accept input in the form of natural language from users, process and compute it internally using human-defined algorithms to simulate human understanding of natural language, and return the expected results to the user. NLP is an important direction in computer science and represents the ultimate goal of artificial intelligence, often hailed as the "crown jewel of AI." NLP involves various research and application technologies, such as text retrieval, machine translation, information extraction, question answering systems, and automatic summarization. Today, NLP is becoming increasingly popular in the industry, with the latest applications including online ad matching, sentiment analysis, machine translation, and chatbots. In short, with the widespread adoption of the internet and the emergence of massive amounts of information, NLP is playing an increasingly important role in people's daily lives.
[0003] Event detection is a challenging subtask in natural language processing. Its purpose is to identify and correctly classify trigger words for relevant events from unstructured natural language text such as broadcast news, tweets, and policy announcements. Event detection is a crucial component of natural language processing and forms the basis for a range of downstream tasks, contributing to the development of question-answering systems, reading comprehension, automatic summarization, and other tasks.
[0004] Early event detection tasks employed pattern matching-based methods. With the rise of neural networks, convolutional neural networks (CNNs) and recurrent neural networks (RNNs) have gained increasing attention for event detection. However, these methods are poor at handling long-range dependencies within sentences, leading to inefficient event detection. Recent research shows that combining neural networks with syntactic information can effectively alleviate long-range dependency problems and significantly improve event detection performance. For example, the paper "BGCN: Trigger Word Detection Based on BERT and Graph Convolutional Networks" introduces syntactic structures to capture long-range dependencies and incorporates BERT word vectors to enhance feature representation. This feature extraction framework based on BERT and syntactic structures enhances information flow, thereby improving the accuracy of event detection. The paper "A Trigger Word-Free Event Detection Method Incorporating Syntactic Information" captures the syntactic relationships between trigger words and entities by integrating syntactic information into the encoder and uses a multi-head attention mechanism to model hidden triggers in sentences, thus achieving event detection. Summary of the Invention
[0005] In view of the aforementioned problems, this application is proposed to provide an event detection method based on a graph perturbation strategy that overcomes or at least partially solves the aforementioned problems, comprising the following steps:
[0006] An event detection method based on a graph perturbation strategy includes the following steps:
[0007] Obtain the context words in a given sentence, and generate a syntactic information adjacency matrix and a concatenation vector corresponding to the context words;
[0008] Generate a syntactic graph based on the adjacency matrix of the syntactic information;
[0009] The context representation corresponding to the context word is determined based on the concatenated vector;
[0010] The syntactic information adjacency matrix and the context representation are used as input to an artificial neural network. Information is propagated on the syntactic graph through a graph convolutional network layer, and a new syntactic subgraph is generated through a graph perturbation layer. Important node information is extracted and irrelevant nodes are filtered out to obtain output information. Specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and convolution is performed on the first subgraph to extract important node information. The syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired and irrelevant nodes are filtered out.
[0011] The type of the context word is predicted based on the context representation and the output information.
[0012] Further, the step of obtaining context words in a given sentence and generating a syntactic information adjacency matrix and a concatenation vector corresponding to the context words includes:
[0013] The given sentence is analyzed using syntactic dependency parsing, and syntactic information corresponding to the context words is generated based on the analysis results of the given sentence.
[0014] Generate the syntactic information adjacency matrix based on the syntactic information;
[0015] The concatenated vector is generated based on the word embeddings, entity embeddings, POS-tagging embeddings, and position embeddings of the context words.
[0016] Further, the step of determining the context representation corresponding to the context word based on the concatenated vector includes:
[0017] The concatenated vector is passed through the input module BiLSTM layer to generate a context representation corresponding to the context word.
[0018] Further, the steps of using the syntactic information adjacency matrix and the context representation as input to an artificial neural network, propagating information on the syntactic graph through a graph convolutional network layer, generating a new syntactic subgraph through a graph perturbation layer, extracting important node information and filtering irrelevant nodes to obtain output information include:
[0019] The syntactic information adjacency matrix and the context representation are input into an artificial neural network for calculation, and the output information is generated based on the result of the calculation by the artificial neural network.
[0020] Further, the step of predicting the type of the context word based on the context representation and the output information includes:
[0021] The output information is optimized using an attention mechanism to generate an optimized result;
[0022] The context representation is aggregated with the optimization result to generate aggregate information;
[0023] The type of the context word is predicted based on the aggregated information.
[0024] Further, the step of predicting the type of the context word based on the aggregated information includes:
[0025] The final representation of the context words is determined based on the aggregated information;
[0026] The final representation of the context words is predicted according to a preset classification method to determine the type of the context words.
[0027] An event detection device based on a graph perturbation strategy includes:
[0028] The acquisition module is used to acquire context words in a given sentence and generate a syntactic information adjacency matrix and a concatenation vector corresponding to the context words;
[0029] The generation module is used to generate a syntactic graph based on the syntactic information adjacency matrix;
[0030] The determining module is used to determine the context representation corresponding to the context word based on the concatenated vector;
[0031] The computation module is used to take the syntactic information adjacency matrix and the context representation as input to an artificial neural network, propagate information on the syntactic graph through a graph convolutional network layer, generate a new syntactic subgraph through a graph perturbation layer, extract important node information and filter irrelevant nodes, and obtain output information. Specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes.
[0032] A classification module is used to predict the type of the context word based on the context representation and the output information.
[0033] Furthermore, the acquisition module includes:
[0034] The dependency analysis submodule is used to analyze the given sentence through syntactic dependencies and generate syntactic information corresponding to the context words based on the analysis results of the given sentence.
[0035] An adjacency matrix generation submodule is used to generate the syntactic information adjacency matrix based on the syntactic information;
[0036] The splicing submodule is used to generate the splicing vector based on the word embedding, entity embedding, POS-tagging embedding, and position embedding of the context words.
[0037] Furthermore, the computing module includes:
[0038] The artificial neural network computation submodule is used to input the syntactic information adjacency matrix and the context representation into the artificial neural network for computation, and generate the output information based on the result of the artificial neural network computation.
[0039] Furthermore, the classification module includes:
[0040] The optimization results submodule is used to optimize the output information using an attention mechanism to generate optimized results.
[0041] The aggregation information submodule is used to aggregate the context representation with the optimization result to generate aggregation information;
[0042] The prediction type submodule is used to predict the type of the context word based on the aggregated information.
[0043] This application has the following advantages:
[0044] In the embodiments of this application, by obtaining context words in a given sentence, a syntactic information adjacency matrix and a concatenation vector corresponding to the context words are generated; a syntactic graph is generated based on the syntactic information adjacency matrix; a context representation corresponding to the context words is determined based on the concatenation vector; the syntactic information adjacency matrix and the context representation are used as input to an artificial neural network, information is propagated on the syntactic graph through a graph convolutional network layer, a new syntactic subgraph is generated through a graph perturbation layer, important node information is extracted and irrelevant nodes are filtered out, and output information is obtained; specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes; the type of the context word is predicted based on the context representation and the output information. This application takes into account the diverse syntactic relationships between different words in a sentence and fully considers the importance of different words in the sentence. By introducing syntactic information and two graph perturbation strategies, redundant information in the sentence is filtered out, while important word information is retained. Graph repair operations are used to reduce the loss of syntactic information, which can effectively solve the problem of low classification efficiency caused by excessive redundant information in long sentences during event detection. At the same time, skip connections with attention gating mechanisms are used to enhance the aggregation of syntactic information of different orders, retain more original features, provide effective word representations for the recognition and classification of trigger words, and effectively improve the F1 score. Attached Figure Description
[0045] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1This is a flowchart illustrating the steps of an event detection method based on a graph perturbation strategy according to an embodiment of this application.
[0047] Figure 2 This is a schematic diagram of the structure of a dependency syntax tree provided in an embodiment of this application;
[0048] Figure 3 This is a schematic diagram of the structure of the adjacency matrix corresponding to the dependency syntax tree provided in an embodiment of this application;
[0049] Figure 4 This is a schematic diagram of a graph perturbation method for generating new subgraphs according to an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of a structure for generating a first subgraph corresponding to a contiguous matrix by perturbing a syntactic graph based on node density, according to an embodiment of this application.
[0051] Figure 6 This is a schematic diagram of a structure for generating a second subgraph corresponding to a contiguous matrix by perturbing a syntactic graph based on the sparsity of edges, according to an embodiment of this application.
[0052] Figure 7 This is a schematic flowchart of an event detection method based on a graph perturbation strategy provided in an embodiment of this application;
[0053] Figure 8 This is a structural block diagram of an event detection device based on a graph perturbation strategy provided in an embodiment of this application. Detailed Implementation
[0054] To make the objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0055] Reference Figure 1 This illustrates an event detection method based on a graph perturbation strategy provided in an embodiment of this application;
[0056] The method includes:
[0057] S110. Obtain the context words in the given sentence, and generate the syntactic information adjacency matrix and concatenation vector corresponding to the context words;
[0058] S120. Generate a syntactic graph based on the syntactic information adjacency matrix;
[0059] S130. Determine the context representation corresponding to the context word based on the concatenation vector;
[0060] S140. Using the syntactic information adjacency matrix and the context representation as input to an artificial neural network, information is propagated on the syntactic graph through a graph convolutional network layer. A new syntactic subgraph is generated through a graph perturbation layer, important node information is extracted, irrelevant nodes are filtered out, and output information is obtained. Specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information. The syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter out irrelevant nodes.
[0061] S150. Predict the type of the context word based on the context representation and the output information.
[0062] In the embodiments of this application, by obtaining context words in a given sentence, a syntactic information adjacency matrix and a concatenation vector corresponding to the context words are generated; a syntactic graph is generated based on the syntactic information adjacency matrix; a context representation corresponding to the context words is determined based on the concatenation vector; the syntactic information adjacency matrix and the context representation are used as input to an artificial neural network, information is propagated on the syntactic graph through a graph convolutional network layer, a new syntactic subgraph is generated through a graph perturbation layer, important node information is extracted and irrelevant nodes are filtered out, and output information is obtained; specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes; the type of the context word is predicted based on the context representation and the output information. This application takes into account the diverse syntactic relationships between different words in a sentence and fully considers the importance of different words in the sentence. By introducing syntactic information and two graph perturbation strategies, redundant information in the sentence is filtered out, while important word information is retained. Graph repair operations are used to reduce the loss of syntactic information, which can effectively solve the problem of low classification efficiency caused by excessive redundant information in long sentences during event detection. At the same time, skip connections with attention gating mechanisms are used to enhance the aggregation of syntactic information of different orders, retain more original features, provide effective word representations for the recognition and classification of trigger words, and effectively improve the F1 score.
[0063] The event detection method based on graph perturbation strategy in this exemplary embodiment will be further described below.
[0064] As described in step S110, the context words in the given sentence are obtained, and the syntactic information adjacency matrix and concatenation vector corresponding to the context words are generated.
[0065] In one embodiment of this application, the specific process of "obtaining context words in a given sentence and generating a syntactic information adjacency matrix and concatenation vector corresponding to the context words" in step S110 can be further explained in conjunction with the following description.
[0066] As described in the following steps, the given sentence is analyzed using syntactic dependency, and syntactic information corresponding to the context words is generated based on the analysis results of the given sentence.
[0067] It should be noted that syntactic dependency analysis reveals the syntactic structure of a sentence by analyzing the dependency relationships between its components. Syntactic dependency analysis identifies grammatical components such as subject, verb, object, and modifiers (attributes, adverbs, complements) and emphasizes analyzing the relationships between words. The core of a sentence in syntactic dependency analysis is the predicate verb; other components are then identified around the predicate, and finally, the sentence is analyzed into a dependency syntax tree, which describes the dependency relationships between individual words.
[0068] In one specific implementation, given sentence information is acquired, identified, and then syntactic dependency parsing is performed using Stanford Core NLP (StandFord Natural Language Processing). This involves analyzing each word in the given sentence to identify the dependency relationships between words, forming a dependency syntactic tree. In dependency parsing, "dependency" refers to the dominance and subordination relationship between words; the dominant component is called the dominant one, and the subordination component is called the subordinate one. While dependency grammar itself does not mandate the classification of dependency relationships, in practice, to enrich the syntactic information conveyed by dependency structures, different labels are typically added to the edges of the dependency tree.
[0069] Reference Figure 2The figure shows a schematic diagram of the dependency syntax tree structure provided in an embodiment of this application. As shown in the figure, in the constructed dependency syntax tree of the sentence "He nodded to indicate his agreement with our opinion", it can be seen that the core predicate of the sentence is "nodding", and the subject of "nodding" is "he". The dependency syntax tree can describe the dependency relationships between the context words. Each word in the sentence depends on another word. Among them, "he" depends on "nodding", and the dependency relationship is subject-predicate (SBV); "indicates" depends on "nodding", and the dependency relationship is coordinate (COO); "agree" depends on "indicates", and the dependency relationship is verb-object (VOB); "of" depends on "we", and the dependency relationship is post-attachment (RAD); "we" depends on "opinion", and the dependency relationship is attributive-head (ATT); "opinion" depends on "agree", and the dependency relationship is verb-object (VOB).
[0070] As described in the following steps, the syntactic information adjacency matrix is generated based on the syntactic information;
[0071] It should be noted that the adjacency matrix is a matrix representing the adjacency relationships between vertices. Let G = (V, E) be a graph, where V = {v1, v2, ..., v...} n Let V be a vertex and E be an edge. A one-dimensional array stores all vertex data in the graph, and a two-dimensional array stores the relationships (edges or arcs) between vertices. This two-dimensional array is called the adjacency matrix. Adjacency matrices are further divided into directed graph adjacency matrices and undirected graph adjacency matrices. The adjacency matrix of G is an n-order square matrix with the following properties: For undirected graphs, the adjacency matrix is always symmetric, and the main diagonal is always zero, while the secondary diagonal is not necessarily zero; this is not necessarily true for directed graphs. In an undirected graph, the degree of any vertex i is the number of all non-zero elements in the i-th column (or i-th row). In a directed graph, the out-degree of vertex i is the number of all non-zero elements in the i-th row, and the in-degree is the number of all non-zero elements in the i-th column. The adjacency matrix of a directed graph is used to store the syntactic dependencies between two event parameters.
[0072] It should be noted that after each sentence is processed through dependency parsing to form a dependency syntax tree, the adjacency matrix corresponding to that sentence is generated based on the dependency relationships between words in the dependency syntax tree. Each word in the dependency syntax tree corresponds to a vertex in the adjacency matrix, and the dependency relationship between two words in the syntax tree corresponds to a directed edge between vertices in the adjacency matrix. For example, in the dependency syntax tree, "he" depends on "nodding," so there is a directed edge between the vertices corresponding to "he" and "nodding" in the adjacency matrix.
[0073] In a specific implementation, refer to Figure 3This diagram illustrates the structure of the adjacency matrix corresponding to a dependency syntax tree provided in an embodiment of this application. The core predicate in the dependency syntax tree is "nodding," and "he" is the subject of "nodding." Therefore, in the corresponding adjacency matrix, the value at the intersection of the row containing "nodding" and the column containing "he" is 1. Each word is treated as a node; "he," "nodding," "represent," "agree," "we," "of," and "opinion" are seven words, resulting in a 7x7 square matrix. If a syntactic arc exists between two words, the corresponding position in the matrix is 1; otherwise, it is 0. A directed graph adjacency matrix is used to store the syntactic dependency relationships of the text. If there is a dependency relationship between words, the corresponding adjacency matrix element is 1; if there is no dependency relationship, the corresponding adjacency matrix element is 0. The adjacency matrix can represent the dependency relationships between the context words.
[0074] The concatenated vector is generated based on the word embedding, entity embedding, POS-tagging embedding, and position embedding of the context words, as described in the following steps.
[0075] It should be noted that word-level information in the sentence needs to be converted into real-valued vectors as input to the artificial neural network. Let X = {x1, x2, x3, ..., x...} n} is a sentence of length n, where x i It is the i-th word in the sentence. In natural language processing tasks, the semantic information of a word is related to its position in the sentence, and part-of-speech and entity type information can improve the recognition of trigger words and the understanding of their semantics. This application uses the concatenated vector formed by concatenating the word embeddings, entity embeddings, POS-tagging (part-of-speech) embeddings, and position embeddings of the context words as the input of the artificial neural network.
[0076] In one specific implementation, four different embedding vectors—word embedding, entity embedding, POS-tagging (part-of-speech) embedding, and position embedding—are concatenated into a concatenated vector, which can obtain semantic information between the context words.
[0077] As described in step S120, a syntactic graph is generated based on the syntactic information adjacency matrix.
[0078] It should be noted that dependency trees can be used to obtain the dependency relationships between words. Based on the relevant information in the adjacency matrix corresponding to the dependency tree, a corresponding syntactic graph is generated. An adjacency matrix represents a syntactic graph. Each word in the dependency tree corresponds to a node in the syntactic graph, and the dependency relationship between two words in the dependency tree corresponds to the directed edge between nodes in the syntactic graph.
[0079] As described in step S130, the context representation corresponding to the context word is determined based on the concatenation vector.
[0080] In one specific implementation, the concatenated vector is input into the input module Bi-LSTM neural network layer to generate context representations corresponding to context words, and the context representations are used as one of the input vectors of the artificial neural network.
[0081] It should be noted that the calculation formula for the input module is: Let the output of the BiLSTM layer be H = [h1, h2, ..., h...]. n ] T h i Let A represent the context representation of the i-th word, and n represent the number of words in the sentence. Let A be the adjacency matrix corresponding to the sentence. Then the calculation formula for the graph convolutional network is:
[0082] H′=ReLU(AHW+b)
[0083] In the formula, W is the weight matrix, b is the bias term, H is called the feature matrix, ReLU is the ReLU activation function, and H′ is the output of the graph convolutional network, which is a new feature matrix.
[0084] As described in step S140, the syntactic information adjacency matrix and the context representation are used as inputs to the artificial neural network. Information is propagated on the syntactic graph through a graph convolutional network layer, a new syntactic subgraph is generated through a graph perturbation layer, important node information is extracted and irrelevant nodes are filtered out, and output information is obtained.
[0085] It should be noted that the artificial neural network mentioned is a graph convolutional network (GCNN). In the field of event detection, syntactic graphs are the foundation of GCNN-based methods. GCNNs use convolution on the syntactic graph to transfer information from different nodes, achieving information aggregation. Therefore, the structure of the syntactic graph affects the flow and aggregation of information. Traditional GCNN-based event detection methods do not consider the excessive redundant information in long sentences, often using the original syntactic graph without perturbing its structure, resulting in low efficiency and performance in trigger word recognition and classification. However, based on the traditional GCNN-based model, two graph perturbation strategies are used to perturb the syntactic graph by affecting node density and edge sparsity, respectively. This achieves the goal of preserving important node information and enhancing sentence semantics, effectively addressing the shortcomings of traditional GCNNs.
[0086] In one embodiment of this application, the specific process of step S140, which involves "using the syntactic information adjacency matrix and the context representation as input to an artificial neural network, propagating information on the syntactic graph through a graph convolutional network layer, generating a new syntactic subgraph through a graph perturbation layer, extracting important node information and filtering irrelevant nodes, and obtaining output information; specifically, perturbing the syntactic graph based on node density to generate a first subgraph, and performing convolution on the first subgraph to extract important node information; perturbing the syntactic graph based on edge sparsity to generate a second subgraph, and repairing and filtering irrelevant nodes in the second subgraph," can be further explained in conjunction with the following description.
[0087] As described in the following steps, the syntactic information adjacency matrix and the context representation are input into an artificial neural network for calculation, and the output information is generated based on the result of the calculation by the artificial neural network.
[0088] Specifically, the syntactic information adjacency matrix and the context representation are input into a symmetric graph convolutional network (GCN). The network passes through multiple GCN layers and graph perturbation layers. Information on the syntactic graph is propagated in the GCN layers, which are shallow layers that output low-order syntactic information. A new syntactic graph is generated in the graph perturbation layer, preserving information from important nodes. The output information obtained from the last perturbation layer, based on node density or edge sparsity perturbation, is input into a fourth GCN layer (as shown in the GCN in the center of Figure 7), where node information is propagated. The output from the fourth GCN layer then passes through multiple graph repair layers and GCN layers. In the graph repair layer, the subgraph generated by the graph perturbation is replaced with the original syntactic graph. The GCN layer after the graph repair layer is a deep layer that outputs high-order syntactic information. To prevent excessive loss of syntactic information during graph repair, the original syntactic graph is used. Multiple GCNs are stacked in a symmetric graph convolutional network, utilizing both low-order and high-order syntactic information. Low-order syntactic information is obtained in shallow GCNs, while high-order syntactic information is obtained in deep GCNs.
[0089] It should be noted that the graph convolution process can be understood as follows: Extracting and transforming the feature information of nodes, each node sends its transformed feature information to its neighboring nodes; fusing the local structural information of nodes, receiving each node and aggregating the feature information of its neighboring nodes; and performing a nonlinear transformation on the aggregated information to increase the model's expressive power. Any graph convolutional layer can be written as a nonlinear function: H l+1 =f(H l A), where H 0 =X is the input of the first layer, X∈R N*DN is the number of nodes in the graph, D is the dimension of the feature vector of each node, and A is the adjacency matrix. The difference between different models lies in the different implementations of the function f.
[0090] As described in the following steps, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes.
[0091] Reference Figure 4 This illustration shows a schematic diagram of a graph perturbation method for generating a new subgraph according to an embodiment of this application. Perturbing the syntactic graph based on node density involves retaining a fixed proportion of important nodes from the original syntactic graph to generate a new syntactic graph, while the adjacent edges of discarded nodes are also deleted. Perturbing the syntactic graph based on edge sparsity involves randomly deleting a fixed proportion of edges from the original syntactic graph to generate a new syntactic graph, where nodes are not deleted. This data augmentation technique, similar to Dropout, can also increase the randomness and diversity of the input data.
[0092] It should be noted that perturbing the syntactic graph based on node density and perturbing the syntactic graph based on edge sparsity are two different graph perturbation strategies, and these two strategies are executed separately. With other parts remaining unchanged, the graph perturbation part in the symmetric graph convolutional network module either uses the strategy based entirely on node density perturbing of the syntactic graph or the strategy based entirely on edge sparsity perturbing of the syntactic graph.
[0093] In a specific implementation, refer to Figure 5 This illustration shows a schematic diagram of a structure for generating an adjacency matrix corresponding to a first subgraph by perturbing a syntactic graph based on node density, according to an embodiment of this application. Perturbing the syntactic graph based on node density involves using a graph pooling operation to select several important nodes from the original syntactic graph to generate a new syntactic graph. An adjacency matrix represents a syntactic graph; therefore, perturbing the syntactic graph structure manifests as a change in the adjacency matrix. For example, when perturbing the syntactic graph based on node density, unimportant word nodes ("representations") are discarded, and their adjacent edges are deleted, thus changing the structure of the syntactic graph and generating a first subgraph and its corresponding adjacency matrix. Convolution is then performed on the first subgraph to extract important node information.
[0094] It should be noted that the node density perturbation syntactic graph is trained by projecting a projection vector p onto y, where H′ is stored as the importance score of each node. Next, the importance scores of the nodes are sorted in descending order, and the top k nodes with the highest importance scores are selected, and their positions idx are remembered. Then, based on idx, the importance scores of k nodes are selected from y and stored. In the middle, select k nodes from H′ based on idx and store them in... It is a transitional feature matrix. Based on idx, k nodes are selected from the adjacency matrix A and stored in A′, where A′ is the new adjacency matrix. Finally, and Perform a dot product to obtain a new feature matrix H″ generated after the graph perturbation operation.
[0095] y = sigmoid(H′p / ||p||)
[0096] idx = rank(y, k)
[0097]
[0098]
[0099] A′ = select(A, idx)
[0100]
[0101] In the formula, sigmoid is the activation function, rank represents selecting k nodes from y, select represents generating a new matrix from the original matrix based on idx, and ⊙ represents dot product.
[0102] In a specific implementation, refer to Figure 6 This illustration shows a schematic diagram of a structure for generating a second subgraph's adjoining matrix by perturbing a syntactic graph based on edge sparsity, according to an embodiment of this application. Perturbing the syntactic graph based on edge sparsity involves randomly deleting a fixed proportion of edges from the syntactic graph to generate a new syntactic graph. For example, when perturbing the syntactic graph based on edge sparsity, directed edges between "nodding" and "representing," and between "we" and "of," are randomly deleted, causing a change in the structure of the syntactic graph, thereby generating a second subgraph and its corresponding adjoining matrix. Irrelevant nodes are then filtered and repaired in the second subgraph.
[0103] It should be noted that the edge-sparse perturbation syntax graph involves randomly deleting edges from the adjacency matrix A according to a deletion ratio q. The formula is as follows:
[0104] A′=delete(A,q)
[0105] In the formula, A is the original adjacency matrix of the sentence, q is the edge deletion ratio, delete represents the number of edges randomly deleted from A at a ratio of q, and A′ is the newly generated adjacency matrix. Perturbing the syntactic graph by edge sparsity does not change the feature matrix H.
[0106] As described in step S150, the type of the context word is predicted based on the context representation and the output information.
[0107] In one embodiment of this application, the specific process of "predicting the type of the context word based on the context representation and the output information" in step S150 can be further explained in conjunction with the following description.
[0108] As described in the following steps, the output information is optimized using an attention mechanism to generate an optimization result; the context representation is aggregated with the optimization result to generate aggregate information; and the type of the context word is predicted based on the aggregate information.
[0109] In one specific implementation, node information in the graph is propagated within each layer of the graph convolutional network. A skip-connection module with attention gating is used to aggregate low-order and high-order syntactic information. The context representation is skipped through each layer of the graph convolutional network via the skip-connection module and then aggregated with the optimized output information. The skip-connection module with attention gating prevents excessive propagation of short-distance syntactic information, enhances the aggregation of syntactic information of different orders, retains more original syntactic information, and provides effective word representations for trigger word recognition and classification, avoiding poor final trigger word classification results.
[0110] Specifically, the low-order and high-order syntactic information output from the graph convolutional network module are passed through two linear layers via an attention gating mechanism. The results of the linear layers are summed, and the sum is passed through a ReLU activation function, another linear layer, and a sigmoid activation function to obtain attention coefficients. These attention coefficients are then multiplied by the low-order syntactic information to obtain the output information of the attention gating mechanism, which is also the optimized low-order syntactic information. The output information of the attention gating mechanism is then added to the high-order syntactic information, thereby aggregating the low-order and high-order syntactic information. To prevent the loss of word context information in the symmetric graph convolutional network, the context representation is skipped through each layer of the graph convolutional network via a skip connection module and aggregated with the optimized output information obtained through the attention gating mechanism to obtain the final representation of the context word.
[0111] The attention coefficient is normalized using softmax, and the calculation formula is as follows:
[0112]
[0113] In the formula, || denotes vector concatenation, e ij and α ij They are all called the "attention coefficient", α ij It is in e ij Based on the normalized version.
[0114] After normalizing the attention coefficients of all nodes, the features of adjacent nodes are weighted and summed to obtain the output information of the attention gating mechanism. The calculation formula is as follows:
[0115]
[0116] In the formula, W is the weight matrix multiplied with the features, σ is the nonlinear activation function, and j∈N i In the traversal, j represents all nodes adjacent to i.
[0117] In one embodiment of this application, the specific process of "predicting the type of the context word based on the aggregated information" described in the following description can be further explained.
[0118] As described in the following steps, the final representation of the context word is determined based on the aggregated information; the final representation of the context word is predicted according to a preset classification method to obtain the type of the context word.
[0119] In one specific implementation, the final representation of the context words is determined based on the aggregated information; the final representation of the context words is predicted according to a preset classification method to obtain the type of the context words; and the type of each word in a given sentence is determined based on the label with the highest probability in the representation of each context word. The word types are different categories defined in advance.
[0120] Specifically, the classification module's preset condition is to aggregate information from different modules. The aggregated information passes through a fully connected layer and then through a softmax function (the softmax function maps the outputs of multiple neurons to the (0,1) interval, which can be understood as probability, thus enabling multi-classification) to obtain the final representation of the context word. The category with the highest probability among the categories corresponding to each context word is selected as the label for the current representation prediction of each context word.
[0121] Example 1
[0122] A specific embodiment of this application provides an event detection method based on a graph perturbation strategy:
[0123] Experimental environment: PyTorch-1.8.0 (open-source Python machine learning library), Nvidia GeForce RTX2080 (graphics card chip), Ubuntu 16.04 (computer Linux operating system), 8GB RAM, 512GB hard drive.
[0124] The experimental results comparing the event detection method based on the graph perturbation strategy with other methods are shown in Table 1:
[0125]
[0126] Table 1
[0127] Experimental Results: The experiment used precision (P), recall (R), and F1 score as observed variables. The definitions of P, R, and F1 are shown below:
[0128]
[0129]
[0130]
[0131] Among them, Cross Event, Cross Entity, and Max Entropy are three feature-based methods; DMCNN, JRNN, and dbRNN are three sequence-based methods; and GCN-ED, JMEE, MOGANED, and EE-GCN are four graph neural network-based methods. This method (node density) indicates that this method perturbs the syntactic graph based on node density, and this method (edge sparsity) indicates that this method perturbs the syntactic graph based on edge sparsity.
[0132] To ensure the accuracy of the experiment, the dataset partitioning in this experiment is consistent with that of other event detection methods. The experimental results demonstrate that the event detection method proposed in this embodiment achieves the highest F1-score compared to other event detection methods. Compared to sequence-based methods, the event detection method based on node density perturbation syntactic graphs proposed in this embodiment improves the F1-score by 6%. Compared to graph neural network-based methods, the event detection method based on node density perturbation syntactic graphs proposed in this embodiment achieves the highest F1-score.
[0133] Reference Figure 7A flowchart illustrating an event detection method based on a graph perturbation strategy is shown.
[0134] In one specific implementation, after obtaining given sentence information, the event text information is analyzed using syntactic analysis techniques to generate a syntactic dependency tree. Then, an adjacency matrix corresponding to the context words is generated based on the syntactic dependency tree. A corresponding syntactic graph is generated based on the relevant information in the adjacency matrix corresponding to the dependency syntactic tree. Word embeddings, entity embeddings, POS-tagging embeddings, and position embeddings of the context words are used to generate concatenated vectors. These concatenated vectors are input into a Bi-LSTM neural network layer to generate a context representation corresponding to the context words. The adjacency matrix and the context representation are input into an artificial neural network. Information is propagated on the syntactic graph through a graph convolutional network layer. A new syntactic subgraph is generated through a graph perturbation layer. Important node information is extracted and irrelevant nodes are filtered to generate output information for aggregation operations on syntactic information of different depths. The context representation is then aggregated by skipping multiple layers of graph convolutional networks using a skip connection module. The optimized output information is aggregated with the context representation. A classification module predicts the type of the context words to determine the type of the given sentence.
[0135] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0136] Reference Figure 8 This illustrates an event detection device based on a graph perturbation strategy provided in an embodiment of this application;
[0137] Specifically, it includes:
[0138] The acquisition module 810 is used to acquire context words in a given sentence and generate a syntactic information adjacency matrix and a concatenation vector corresponding to the context words.
[0139] Generation module 820 is used to generate a syntactic graph based on the syntactic information adjacency matrix;
[0140] The determining module 830 is used to determine the context representation corresponding to the context word based on the concatenation vector;
[0141] The computation module 840 is used to take the syntactic information adjacency matrix and the context representation as input to an artificial neural network, propagate information on the syntactic graph through a graph convolutional network layer, generate a new syntactic subgraph through a graph perturbation layer, extract important node information and filter irrelevant nodes, and obtain output information. Specifically, the syntactic graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntactic graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes.
[0142] The classification module 850 is used to predict the type of the context word based on the context representation and the output information.
[0143] In one embodiment of this application, the acquisition module 810 includes:
[0144] The dependency analysis submodule is used to analyze the given sentence through syntactic dependencies and generate syntactic information corresponding to the context words based on the analysis results of the given sentence.
[0145] An adjacency matrix generation submodule is used to generate the syntactic information adjacency matrix based on the syntactic information;
[0146] The splicing submodule is used to generate the splicing vector based on the word embedding, entity embedding, POS-tagging embedding, and position embedding of the context words.
[0147] In one embodiment of this application, the determining module 830 includes:
[0148] A context representation generation submodule is used to generate a context representation corresponding to the context word by passing the concatenated vector through the input module BiLSTM layer.
[0149] In one embodiment of this application, the computing module 840 includes:
[0150] The artificial neural network computation submodule is used to input the syntactic information adjacency matrix and the context representation into the artificial neural network for computation, and generate the output information based on the result of the artificial neural network computation.
[0151] In one embodiment of this application, the classification module 850 includes:
[0152] The optimization results submodule is used to optimize the output information using an attention mechanism to generate optimized results.
[0153] The aggregation information submodule is used to aggregate the context representation with the optimization result to generate aggregation information;
[0154] The prediction type submodule is used to predict the type of the context word based on the aggregated information.
[0155] In one embodiment of this application, the prediction type submodule includes:
[0156] The final representation determination submodule is used to determine the final representation of the context words based on the aggregation information;
[0157] The context word type prediction submodule is used to predict the final representation of the context word according to a preset classification method, and to determine the type of the context word.
[0158] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0159] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0160] The above provides a detailed description of the event detection method and apparatus based on graph perturbation strategy provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An event detection method based on a graph perturbation strategy, characterized in that, The method comprises the steps of: obtaining context words in a given sentence, generating a syntactic information adjacency matrix and a concatenation vector corresponding to the context words; specifically, analyzing the given sentence through syntactic dependency, and generating syntactic information corresponding to the context words according to the analysis result of the given sentence; generating the syntactic information adjacency matrix according to the syntactic information; generating the concatenation vector according to the word embedding, entity embedding, POS-tagging embedding and position embedding of the context words; generating a syntactic graph according to the syntactic information adjacency matrix; determining a context representation corresponding to the context words according to the concatenation vector; taking the syntactic information adjacency matrix and the context representation as inputs of an artificial neural network, propagating information on the syntactic graph through a graph convolution network layer, generating a new syntactic subgraph through a graph perturbation layer, extracting important node information and filtering irrelevant nodes, and obtaining output information; specifically, generating a first subgraph by perturbing the syntactic graph based on node density, and extracting important node information by convolving the first subgraph; generating a second subgraph by perturbing the syntactic graph based on the sparsity of edges, and filtering irrelevant nodes by repairing the second subgraph; predicting the type of the context words according to the context representation and the output information.
2. The method of claim 1, wherein, The step of determining a context representation corresponding to the context words according to the concatenation vector comprises: generating a context representation corresponding to the context words through an input module BiLSTM layer from the concatenation vector.
3. The method of claim 1, wherein, The step of taking the syntactic information adjacency matrix and the context representation as inputs of an artificial neural network, propagating information on the syntactic graph through a graph convolution network layer, generating a new syntactic subgraph through a graph perturbation layer, extracting important node information and filtering irrelevant nodes, and obtaining output information comprises: inputting the syntactic information adjacency matrix and the context representation into an artificial neural network for calculation, and generating the output information according to the calculation result of the artificial neural network.
4. The method of claim 1, wherein, The step of predicting the type of the context words according to the context representation and the output information comprises: optimizing the output information using an attention mechanism to generate an optimization result; aggregating the context representation and the optimization result to generate aggregated information; predicting the type of the context words according to the aggregated information.
5. The method of claim 4, wherein, The step of predicting the type of the context words according to the aggregated information comprises: determining a final representation of the context words according to the aggregated information; predicting the final representation of the context words according to a preset classification mode to obtain the type of the context words.
6. An event detection apparatus based on a graph perturbation strategy, characterized by, The method comprises: an obtaining module, configured to obtain context words in a given sentence, and generate a syntactic information adjacency matrix and a concatenation vector corresponding to the context words; specifically, comprising a dependency analysis submodule, configured to analyze the given sentence through syntactic dependency, and generate syntactic information corresponding to the context words according to the analysis result of the given sentence; an adjacency matrix generating submodule, configured to generate the syntactic information adjacency matrix according to the syntactic information; a concatenation submodule configured to generate the concatenation vector according to a word embedding, an entity embedding, a POS-tagging embedding, and a position embedding of the context word; a generation submodule configured to generate a syntax graph according to the syntax information adjacency matrix; a determination submodule configured to determine a context representation corresponding to the context word according to the concatenation vector; a calculation submodule configured to take the syntax information adjacency matrix and the context representation as inputs of an artificial neural network, propagate information on the syntax graph through a graph convolution network layer, generate a new syntax subgraph through a graph perturbation layer, extract important node information and filter irrelevant nodes, and obtain output information; specifically, the syntax graph is perturbed based on node density to generate a first subgraph, and the first subgraph is convolved to extract important node information; the syntax graph is perturbed based on edge sparsity to generate a second subgraph, and the second subgraph is repaired to filter irrelevant nodes; a classification submodule configured to predict a type of the context word according to the context representation and the output information.
7. The event detection apparatus based on graph perturbation strategy according to claim 6, characterized in that, The calculation submodule comprises: an artificial neural network calculation submodule configured to input the syntax information adjacency matrix and the context representation into an artificial neural network for calculation, and generate the output information according to a result of the calculation of the artificial neural network.
8. The event detection apparatus based on graph perturbation strategy according to claim 6, characterized in that, The classification submodule comprises: an optimization result submodule configured to optimize the output information using an attention mechanism to generate an optimization result; an aggregated information submodule configured to aggregate the context representation and the optimization result to generate aggregated information; a predicted type submodule configured to predict a type of the context word according to the aggregated information.
Citation Information
Patent Citations
Social network representation method based on bidirectional distance network embedding
CN109992725A
Graph convolutional network relationship extraction method based on multi-dependency relationship representation mechanism
CN113239186A