Event causal identification method and device based on dynamic relation graph convolution
By using a dynamic relational graph convolutional network and a multi-granularity causal matching mechanism, the learning of interaction features of event pairs is optimized, which solves the problem of low accuracy in causal identification in traditional methods and achieves higher identification accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for identifying causal relationships in events suffer from limited coverage, reliance on manual feature engineering, inability of fixed convolutional kernels to adapt to semantic differences in context, and insufficient knowledge granularity, resulting in low recognition accuracy.
We adopt a dynamic relation graph convolutional approach, which constructs a dynamic relation graph convolutional network, uses BERT and BiLSTM to extract event features, combines a lightweight attention network and COMET model to dynamically update convolutional kernel parameters, and designs a multi-granularity implicit causal matching mechanism to optimize the learning of event pair interaction features.
It improves the accuracy of event causality identification, solves the problems of insufficient static adjustment of causal association confidence and insufficient knowledge granularity differentiation in traditional methods, and achieves higher identification accuracy.
Smart Images

Figure CN121660115A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to a method, apparatus, device, and medium for event causality identification based on dynamic relation graph convolution. Background Technology
[0002] Event causality identification, as an important task of natural language processing, refers to the process of automatically detecting and determining the causal relationship between two or more events from natural language text. Identifying event causal relationships can help provide key support for fields such as intelligence analysis, decision support, and situational assessment.
[0003] Depending on the technical approach, methods for identifying causal relationships in events can be categorized as follows: (1) Rule-based and template-based methods: These methods match causal relationships in text by manually defining causal trigger words, syntactic patterns, or logical rules. While highly interpretable, these methods have limited coverage and struggle to handle implicit causal relationships without obvious trigger words.
[0004] (2) Traditional machine learning-based methods: These methods mainly extract text features (such as bag-of-words features, syntactic features, trigger word distances, etc.) through manual feature engineering, and then use classification models to train classifiers. These methods can utilize statistical regularities to handle some implicit causality, but they rely on manual feature engineering, and the quality of feature design directly affects performance.
[0005] (3) Deep learning-based methods: Utilizing neural networks to automatically learn deep semantic features of text, such as graph convolutional networks (GCNNs), which are generally used to model the interaction relationships between multiple event pairs to capture the causal transitivity of events. However, traditional GCNNs use fixed edge weights and cannot dynamically adjust the attention priority based on the causal confidence of the event pair itself. Convolutional neural networks extract local features through convolutional layers using fixed convolutional kernel parameters, but convolutional kernels pre-trained on general corpora cannot adapt to the semantic differences of causal indicator words in different contexts.
[0006] (4) Knowledge-based methods: These methods introduce external knowledge (such as causal commonsense bases, domain ontology, and knowledge bases) to assist in identification and compensate for the lack of semantic information in the text. However, traditional methods treat causal knowledge at different levels equally without distinguishing the granularity of knowledge. As a result, the model cannot flexibly call knowledge of different granularities according to task requirements, thus limiting the effectiveness of knowledge enhancement.
[0007] In view of this, there is an urgent need to provide an event causality identification method that can improve the accuracy of event causality identification and effectively solve the above problems. Summary of the Invention
[0008] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, device and medium for event causality identification based on dynamic relation graph convolution, so as to solve the technical problems in related technologies.
[0009] This specification provides one or more embodiments of an event causality identification method based on dynamic relation graph convolution, including the following steps: 1) Obtain the raw text data, which contains multiple events and event pairs with potential causal relationships. Label the events, including labeling the start and end positions of each event, to obtain the event text data; 2) Construct an encoder containing a BERT model and a BiLSTM to obtain the overall representation features of each event in the event text; 3) The overall representation features of each event in the event pair are spliced together to obtain spliced features, and the preliminary causal probability values of the event pair are obtained through the preliminary causal probability prediction module. 4) Based on the constructed dynamic relational graph convolutional network, event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as the initial node features. Different causal relationships exist between nodes, and different types of edges are set accordingly. In this way, an undirected event pair graph is constructed, and the initial causal probability values of each event pair are used as the dynamic weights of each edge of the undirected event pair graph to obtain the dynamic weight matrix. Through the multi-type relational graph convolutional calculation module, the weight matrices of different edge types are learned and combined with the interaction of activation functions and neighbor node features to obtain the event pair interaction features. 5) Based on the causal indicator vocabulary filtered by FrameNet, an initial weight is assigned to each causal indicator to form an initial indicator weight matrix; then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator; multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain the enhanced overall event representation features; then, local and global features are extracted through max pooling layers, and the local and global features are concatenated to obtain the explicit causal features of the event; 6) The COMET model is used to generate direct causal common sense and indirect causal common sense of the event. The BERT model is used to obtain direct causal context-aware embedding features and indirect causal context-aware embedding features. The similarity is calculated with the overall representation features of the event. The similarity scores are obtained by fusing them based on the preset attention weights. Finally, the similarity scores are mapped to the embedding space and the scaling factor is used to transform the similarity scores into learnable features, thereby obtaining the implicit causal features of the event. 7) Input the event pair interaction features, explicit causal features, and implicit causal features into a fully connected network to achieve event causal recognition and obtain the causal relationship and causal probability value of each event pair in the event text.
[0010] This specification provides one or more embodiments of an event causality recognition device based on dynamic relation graph convolution, including: The data preprocessing module is used to process the acquired raw text data, which contains multiple events and event pairs with potential causal relationships. The events are labeled, including the start and end positions of each event, to obtain event data. The overall feature extraction module is used to obtain the overall representation features of each event in the event text based on the constructed encoder that includes a BERT model and BiLSTM. The preliminary causal probability acquisition module is used to concatenate the overall representation features of each event in an event pair to obtain concatenated features, and obtain the preliminary causal probability value of the event pair through the preliminary causal probability prediction module. The event pair interaction feature extraction module is used to construct an undirected event pair graph based on a constructed dynamic relation graph convolutional network. Event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as initial node features. Different causal relationships exist between nodes, corresponding to different types of edges. The initial causal probability values of each event pair are used as dynamic weights for each edge of the undirected event pair graph, resulting in a dynamic weight matrix. A multi-type relation graph convolutional computation module learns the weight matrices of different edge types, combines them with activation functions and neighbor node features, and outputs the embedded features of each node, thus obtaining the event pair interaction features. The explicit causal feature extraction module is used to assign initial weights to each causal indicator vocabulary filtered by FrameNet, forming an initial indicator weight matrix. Then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator. Multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain the enhanced overall event representation features. Then, local and global features are extracted through max pooling layers, and the local and global features are concatenated to obtain the explicit causal features of the event. The implicit causal feature extraction module is used to generate direct and indirect causal common sense for a given event using the COMET model. After passing through the BERT model, the direct and indirect causal context-aware embedding features of the event text are obtained, and similarity is calculated with the overall representation features of the event. The similarity scores are obtained by fusing them based on preset attention weights. Finally, the similarity scores are mapped to the embedding space, and a scaling factor is used to transform the similarity scores into learnable features, thereby obtaining the implicit causal features of the event. The causal relationship identification module is used to input the event pair interaction features, explicit causal features, and implicit causal features into a fully connected network to realize event causal identification and obtain the causal relationship and causal probability value of each event pair in the event text.
[0011] This specification provides one or more embodiments of a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement event causal identification based on dynamic relational graph convolution as described above.
[0012] This specification provides one or more embodiments of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the event causality identification method based on dynamic graph convolution as described above.
[0013] This disclosure provides a method, apparatus, device, and medium for event causality recognition based on dynamic relational graph convolution. Its advantages lie in proposing a dynamic relational graph convolutional network to optimize the learning of event pair interaction features. The preliminary causal probability of event pairs output by the preliminary causal probability prediction module is used as the dynamic weight of edges in the graph, replacing fixed weights. This allows the model to prioritize high-confidence causal relationship event pairs and filter out irrelevant interference, overcoming the shortcomings of static edge weights in traditional graph convolutional networks. Furthermore, based on a causal indicator vocabulary selected from FrameNet and combined with the overall event representation features, an attention network calculates the dynamic weight of each indicator, replacing fixed initial weights. This allows the convolutional kernel to prioritize indicators with high matching degree to the current context, addressing the problem of convolutional neural networks ignoring the contextual adaptability of indicators. Finally, a multi-granularity implicit causal matching mechanism is designed. Based on the COMET model, two types of fine-grained common sense are generated for events according to direct and indirect causal relationships, replacing the full knowledge of the common sense knowledge base. This improves the knowledge enhancement effect and solves the problem of traditional knowledge enhancement methods directly using the knowledge base, ignoring differences in knowledge granularity, resulting in the model's inability to flexibly call knowledge of different granularities according to task requirements, thus limiting the knowledge enhancement effect. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating an event causal identification method based on dynamic relation graph convolution, provided for one or more embodiments of this specification; Figure 2 A flowchart illustrating the event causality identification method provided in one or more embodiments of this specification. Figure 3 A schematic diagram of the causal probability preliminary prediction module structure provided in one or more embodiments of this specification; Figure 4 A schematic diagram of a dynamic relational graph convolutional network provided for one or more embodiments of this specification; Figure 5 A schematic diagram of an undirected event pair graph constructed for one or more embodiments of this specification; Figure 6 A schematic diagram of the structure of an explicit causal mining network module provided in one or more embodiments of this specification; Figure 7 A flowchart illustrating a multi-granularity implicit causal matching mechanism provided for one or more embodiments of this specification; Figure 8 A block diagram of an event causal identification device based on dynamic relation graph convolution provided for one or more embodiments of this specification; Figure 9 This is a schematic diagram of the structure of a computer device provided for one or more embodiments of this specification. Detailed Implementation
[0016] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this invention.
[0017] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings.
[0018] Method Implementation Examples According to embodiments of the present invention, an event causality identification method based on dynamic relation graph convolution is provided, such as... Figure 1 The diagram shown is a flowchart of the event causality identification method based on dynamic relational graph convolution according to this embodiment. The event causality identification method based on dynamic relational graph convolution according to this embodiment includes: Step S1: Text data preprocessing: Obtain raw text data, which contains multiple events and event pairs that may have causal relationships. Label the events, including labeling the start and end positions of each event, to obtain event text data.
[0019] In this embodiment, an event pair refers to two events that may have a causal relationship.
[0020] Step S2, Feature Extraction: Construct an encoder containing a BERT model and a BiLSTM to obtain the overall representation features of each event in the event text.
[0021] Step S3: Obtain preliminary causal probability values: Concatenate the overall representation features of each event pair to obtain concatenated features, and obtain the preliminary causal probability values of the event pair through the preliminary causal probability prediction module.
[0022] Step S4, Event Pair Interaction Feature Extraction: Based on the constructed dynamic relation graph convolutional network, event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as the initial node features. Different causal relationships exist between nodes, and different types of edges are set accordingly. In this way, an undirected event pair graph is constructed, and the preliminary causal probability values of each event pair are used as the dynamic weights of each edge of the undirected event pair graph to obtain the dynamic weight matrix. Through the multi-type relation graph convolutional calculation module, the weight matrices of different edge types are learned and combined with the activation function and the interaction of neighbor node features to output the embedded features of each node, that is, the event pair interaction features are obtained.
[0023] Step S5, Explicit Causal Feature Extraction: Based on the causal indicator vocabulary selected by FrameNet, an initial weight is assigned to each causal indicator to form an initial indicator weight matrix; then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator; multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain the enhanced overall event representation features; then, local and global features are extracted through max pooling layers respectively, and the local and global features are concatenated to obtain the explicit causal features of the event.
[0024] Step S6, Implicit Causal Feature Extraction: The COMET model is used to generate direct causal common sense and indirect causal common sense for a given event. The BERT model is used to obtain the direct causal context-aware embedding features and indirect causal context-aware embedding features of the event text. The similarity is calculated with the overall representation features of the event, and the similarity score is obtained by fusing them based on the preset attention weights. Finally, the similarity score is mapped to the embedding space, and the scaling factor is used to transform the similarity score into a learnable feature, thereby obtaining the implicit causal features of the event.
[0025] In this embodiment, a direct causal relationship refers to an event and its result being directly triggered without any intermediate events; an indirect causal relationship refers to an event that requires one or more intermediate events to trigger its result.
[0026] Step S7, Causal Relationship Identification: Input the event pair interaction features, explicit causal features, and implicit causal features into the fully connected network to realize event causal identification and obtain the causal relationship and causal probability value of each event pair in the event text.
[0027] This embodiment presents an event causal recognition method based on dynamic relational graph convolution. It proposes a dynamic relational graph convolutional network to optimize the learning of event pair interaction features. The preliminary causal probability of event pairs output by the preliminary causal probability prediction module is used as the dynamic weight of edges in the graph, replacing fixed weights. This allows the model to prioritize high-confidence causal relationship event pairs and filter out irrelevant interference, overcoming the shortcomings of static edge weights in traditional graph convolutional networks. Furthermore, based on a causal indicator vocabulary selected from FrameNet and combined with the overall event representation features, an attention network calculates the dynamic weight of each indicator, replacing fixed initial weights. This allows the convolutional kernel to prioritize indicators with high matching degree to the current context, addressing the problem of convolutional neural networks ignoring the contextual adaptability of indicators. Finally, a multi-granularity implicit causal matching mechanism is designed. Based on the COMET model, two types of fine-grained common sense are generated for events according to direct and indirect causal relationships, replacing the full knowledge of the common sense knowledge base (ConceptNet). This improves the knowledge augmentation effect and solves the problem of traditional knowledge augmentation methods directly using the knowledge base, ignoring differences in knowledge granularity, which prevents the model from flexibly calling knowledge of different granularities according to task requirements, thus limiting the knowledge augmentation effect.
[0028] In this embodiment, step S1 includes the following steps: Step S11: Obtain the raw text data. The raw text data contains multiple events and event pairs that may have causal relationships. Then, clean the text, remove special symbols and typos, and standardize the punctuation format. After that, annotate the events. Step S12: Mark the start and end positions of each event in the original text (i.e., mark the beginning and end of each event with [start] and [end] respectively, mark the start of the event with [start] and the end of the event with [end], in order to determine the event boundaries).
[0029] The above processing yields event text data, which serves as the basis for subsequent causal relationship analysis.
[0030] In one embodiment, reference Figure 2 The diagram shown is a flowchart of the event causal identification method provided in this embodiment. Step S2 includes extracting the context-aware embedding features of each token in the event text using the BERT model; then using BiLSTM to capture the long-distance dependencies in the context-aware embedding features to obtain the enhanced embedding features of each token and aggregating them to obtain the overall representation features of the event; for each event in the event text, finding its start position marker and end position marker in the sentence, calculating the attention weights of the enhanced embedding features of all tokens between the two markers using an activation function, and performing a weighted summation to obtain the overall representation features of each event.
[0031] Specifically, the steps include the following: Step S21: To adapt to the input format of the BERT model, insert “[CLS]” and “[SEP]” markers at the beginning and end of sentences containing event pairs in the event text, respectively, to obtain a token sequence that the BERT model can recognize.
[0032] By inputting the token sequence into the BERT model, the context-aware embedding feature of the t-th token in the event text data is obtained. ;in, The dimension output by BERT.
[0033] To further optimize context-aware embedding features, this embodiment utilizes BiLSTM to capture long-distance dependencies in sequences, and therefore performs the following steps.
[0034] Step S22, embed the context-aware features The input is encoded by a BiLSTM, and the output is the first... Enhanced embedding features of individual tokens This feature integrates the contextual information from BERT (hereinafter referred to as the perceptual embedding feature) and the sequence dependency information from BiLSTM. The BiLSTM network formula is as follows: ; in, This represents the historical state of the forward LSTM (capturing the context from left to right). This represents the future state of the backward LSTM (capturing the context from right to left).
[0035] Step S23: To facilitate subsequent modeling of the relationship between events, enhanced embedding features of multiple tokens in the event text are used. Aggregate the data to obtain the overall representation features of each event.
[0036] In one embodiment, step S23 is implemented as follows: Step S231, for the events in the event text Find the start and end tokens in the event text, and calculate the enhanced embedding features of each token between the two tokens using the softmax function. The attention weights are calculated using the following formula: ; in, and For the event The sequence of embedded features of all tokens between the start and end tokens. For learnable attention weights, Let be the attention weight of the t-th token.
[0037] Step S232: Perform weighted summation and output the event. Overall representation features The calculation is as follows: ; in, For the event The overall representational characteristics.
[0038] In one embodiment, step S3, the preliminary causal probability prediction module is used to predict the preliminary causal probability of any event pair. For any event pair... and events After step S2, the events are obtained respectively. Overall representation features of the output ,event Overall representation features of the output The inputs are fed into the preliminary causal probability prediction module, which outputs preliminary causal probability values. The preliminary causal probability prediction module consists of an input layer, a two-layer MLP network, and a sigmoid output layer. (Refer to...) Figure 3 The diagram shown is a schematic of the preliminary causal probability prediction module provided in this embodiment. The specific processing procedure is as follows: Input layer for event pairs Overall representation features , The event pairs are concatenated to simultaneously capture both the overall and differential features. The concatenated features are then input into two MLP layers, passed through a sigmoid function, and output as preliminary causal probability values for the event pairs. The calculation formulas for the MLP network and the sigmoid output layer are as follows: ; in, It is the sigmoid function, which ensures that the output value is between 0 and 1; events and events The overall representational features, This indicates the semantic differences between the two. This represents a splicing operation.
[0039] In one embodiment, the dynamic relational graph convolutional network includes a graph initialization layer, a dynamic weight calculation layer, and a multi-type relational graph convolutional calculation layer, referencing... Figure 4 The diagram shown is a schematic of the dynamic relationship graph convolutional network provided in this embodiment. The processing procedures for each layer are as follows: The graph initialization layer, for events in any event pair. and events After step S2, the overall representation features are obtained. and overall representation features The splicing is performed to obtain spliced features, thus obtaining the initial node features. Using event pairs as nodes, and different causal relationships between nodes as corresponding edge types, an undirected event pair graph is constructed. (See reference...) Figure 5 As shown in the example diagram, the initial causal probability values of each event pair are used as the dynamic weights of each edge in the undirected event pair graph.
[0040] In one example, an undirected event pair graph G={N,E} is constructed for the events, where N is the set of nodes and E is the set of edges. Two nodes are connected only if they share at least one event. Each node in N represents an event pair, such as < >. For events in an event pair and events After step S2, the overall representation features are obtained. and overall representation features Then, the two are concatenated to obtain the concatenated features, which are used as the node features of the initial layer of the graph. , .
[0041] In one embodiment, the type of edge is determined based on the relationship between event pairs and is defined as edge type ( Specifically, it includes: Type 1 ( This represents two adjacent event pairs with the same cause event; for example, an event pair < >and its adjacent event pairs< >, If both nodes are the cause events in the two event pairs, then the type of the edge between the two nodes is set to 1.
[0042] Type 2 ( ), represents a pair of events in which a certain event is in a different position from two adjacent event pairs; for example, event pair < > and adjacent event pairs< >, In the original event pair < If the two nodes have different positions in the adjacent event pair, the type of the edge between them is set to 2. Type 3 ( This represents two event pairs with the same result event; for example, event pair < >and neighboring event pairs< >, If both events are the result events in two event pairs, then the type of the edge between the two nodes is set to 3.
[0043] The dynamic weight generation layer takes the initial causal probability values output from step S3 as input. First, it transforms these values into final edge weights using a normalization formula, ensuring that the sum of the weights of all edges around the target node is 1. This prevents a single edge from having an excessively high initial probability, thus masking important information from other edges. Finally, it generates dynamic weights for each edge of the graph that are adapted to the undirected event pair. The normalized calculation is as follows: ; in, Indicates an event Regarding the event The initial causal probability value, Indicates an event All neighboring nodes The sum of preliminary causal probability values. A multi-type relational graph convolutional computation layer, based on the edge type and dynamic weights of the undirected event pair graph, updates node embedding features layer by layer to capture causal transitivity.
[0044] For the graph convolutional network, the first l Layer, input the embedded features of the i-th node of this layer. Embedding features of neighboring node k By enhancing the model's ability to fit complex causal interactions through activation functions, the next layer of node embedding features is output. This feature integrates the event pair's own features and neighbor interaction features, and can reflect the causal transitivity of the event pair. The calculation formula for this layer is as follows: ; in, To activate in Layer node embedding features It is for type The edge, the first The weight matrix of the layer, It is the type of edge between adjacent event pairs.
[0045] In this embodiment, the preliminary causal probability of events output by the preliminary causal probability prediction module is used as the dynamic weight of the edges in the graph of undirected event pairs, replacing the fixed weights. This allows the model to prioritize high-confidence causal event pairs and filter out irrelevant interference, thus solving the problem of static edge weights in traditional graph convolutional networks.
[0046] In this embodiment, since causal relationship indicator words are the most obvious features indicating causal relationships, the explicit causal mining module is used to identify causal relationships for an event pair. >, if and The textual content of the events between them contains causal clues, and the two events are likely to be identified as having a causal relationship by the convolutional neural network. Therefore, the explicit causal relationship between the event pair is achieved through the following steps.
[0047] In one embodiment, the execution step S5 is implemented based on the set explicit causal mining network module, referring to... Figure 6 The diagram shown is a structural schematic of the explicit causal mining network module provided in this embodiment. The explicit causal mining network module includes causal indicator filtering, a lightweight attention network, multi-scale convolutional layers, residual layers, and max pooling layers. The specific processing procedure is as follows: Step S51: Causal indicator words (such as "cause," "because," "trigger," etc.) are filtered from FrameNet and compiled into a causal indicator word vocabulary. The number of indicator words is denoted as [missing information]. Assign initial weights to each causal indicator to form an initial indicator weight matrix. ,in, k For the number of indicator words, d For the embedded dimension.
[0048] Step S52, using a lightweight attention network based on the overall event representation features Combined with the initial indicator word weight matrix, we obtain the dynamic weights of each causal indicator word and feed them back to update the convolutional kernel parameters of the lightweight attention network.
[0049] By dynamically updating the convolutional kernel parameters using a lightweight attention network, the kernels can prioritize causal indicator words that have a high degree of matching with the current context. The calculation formula is as follows: ; in, For inner product operations, This represents the initial indicator weight matrix. The scaling factor is used to scale the final feature to ensure alignment with other features. The final parameters of each convolutional kernel are The calculation formula is as follows: .
[0050] Step S53: Extract features at different scales through multi-scale convolutional layers. Then, it is combined with the first layer through the residual layer. Enhanced embedding features at the center position of the input of the group convolution kernel Adding them together yields the enhanced overall representation of the event. .
[0051] Based on the length distribution pattern of causal clues in natural language, a convolution kernel size is set. The four sets of convolutional kernels, each with the same number of kernels as the number of causal indicator words, ensure coverage of cues of different lengths (assuming there are 8 causal indicator words, four sets of convolutional kernels). =1 / 2 / 3 / 4) Each group has 8 kernels, for a total of 32 convolutional kernels. The details are as follows: The kernel size is =1 convolutional kernel group: The convolutional kernel covers only 1 token, used to capture short clues, such as a single causal indicator word "cause"; The kernel size is =2 convolutional kernel group: The convolutional kernel covers 2 consecutive tokens to capture two-word clues, such as "due to"; The kernel size is =3 convolutional kernel group: The convolutional kernel covers 3 consecutive tokens to capture three-word clues, such as "given this"; The kernel size is =4 convolutional kernel group: The convolutional kernel covers 4 consecutive tokens, capturing longer clues, such as "caused by this".
[0052] Sliding convolution with different kernel sizes, the first... Group convolution kernel at position (Position refers to the index of the token in the sequence, which determines the specific range of tokens covered as the convolutional kernel slides.) The output features at different scales. The calculation is as follows: ; in, For position arrive The enhanced embedding features, while " arrive "This refers to the range of consecutive tokens covered by the convolution kernel. By sliding the kernel at different positions, it can comprehensively capture causal clues of varying lengths within the event text." is the bias, and ReLU is the activation function.
[0053] The residual layer is used to mitigate feature decay in deep convolutions of multi-scale convolutional layers, allowing features of different scales to be stored in the original data. Add the enhanced embedding features at the center location of the convolution input. The enhanced overall event representation features are obtained. The calculation formula is as follows: ; in, To enhance the overall representation features of the event, Enhanced embedding features are applied to the center position of the convolution input to ensure that the original contextual information is not lost.
[0054] Step S54: Using max pooling, perform local max pooling and global max pooling operations on the text between event pairs to achieve hierarchical feature extraction, preserving both local and global features. First, perform local max pooling: Assuming there are r text token sequences between event pairs, divide the text between event pairs into the first half based on punctuation marks (the token range is r). ) and the second half (Token range is Max pooling is performed on each feature to obtain local features. ; then the text between the event pairs (i.e., the events) The end marker [end] and events Perform global max pooling on all token sequences between the starting marker [start] to extract overall causal clues and obtain global features. Finally, the local and global features are concatenated to obtain explicit causal features. It retains key local clues while covering the overall causal pattern.
[0055] In this preferred embodiment, the pooling features output by the max pooling layer are filtered using an attention mechanism to highlight causal clues with high confidence: ; in, , These are learnable attention weights used to measure the importance of each pooling feature. The scaling factor is used to scale the final features to ensure they are consistent with the feature scale output by the preliminary causal probability prediction module and the dynamic relation graph convolutional network. Finally, the explicit causal features of the event pairs are output. This feature integrates information from dynamic weight adjustment, multi-scale cues, and hierarchical pooling.
[0056] In this embodiment, to utilize common-sense knowledge, i.e., implicit causal knowledge, a multi-granularity causal matching mechanism is designed. Instructions are set for events according to two granularities: "direct causal relationship" and "indirect causal relationship." Based on the COMET model, two types of fine-grained common-sense knowledge are generated to replace the full knowledge in the Common-Sense Knowledge Base (ConceptNet), improving the knowledge enhancement effect. This solves the problem of traditional knowledge enhancement methods directly using the knowledge base, ignoring differences in knowledge granularity, which prevents the model from flexibly calling knowledge of different granularities according to task requirements, thus limiting the knowledge enhancement effect. Therefore, referring to... Figure 7 The diagram shown is a flowchart of the multi-granularity implicit causal matching mechanism provided in this embodiment. The specific execution steps of step S6 are as follows: Step S61, for the event Instructions are set for events according to two granularities: "direct causal relationship" and "indirect causal relationship." These instructions are then input into the COMET model to define the events. Generate common-sense knowledge of direct causal relationships (denoted as " ) and common sense knowledge of indirect causality (denoted as " This involves inputting two types of common-sense knowledge into the BERT model to generate context-aware embedding features that represent direct causal relationships. and indirect causal context-aware embedded features .
[0057] The COMET (Commonsense Transformers) used in this embodiment is a GPT language model that can integrate common sense knowledge. This model has strong reasoning ability and can infer the possible causes and effects of events even if the event does not exist in the original knowledge graph.
[0058] Step S62: Embed the obtained direct causal relationship context-aware features. and indirect causal context-aware embedded features Compare with the overall representation features of the events obtained in step S2. Cosine similarity is calculated, and then the two types of similarity are fused using attention weights to obtain a similarity score. The formula is as follows: ; ; ; in, It is generated in step S2 The overall representation characteristics of the event, direct common sense weight Set the indirect common sense weight to 0.6, and set it to 1- This improves the model's efficiency in utilizing implicit knowledge at different granularities.
[0059] In step S63, the similarity scores are finally mapped to the embedding space, and a scaling factor is used to transform the similarity scores into learnable features, thereby obtaining implicit causal features.
[0060] To map similarity scores to the embedding space, a scaling factor is used to transform the similarity scores into learnable features, outputting implicit causal features. To facilitate fusion with the event pair interaction features obtained in step S4 and the explicit causal features obtained in step S5, the calculation is as follows: ; in, As a scaling factor, set to 100. It is an embedded lookup table.
[0061] In this embodiment, the feature processing procedure for the fully connected layer in step S7 is as follows: The event pair interaction features output in step S4 The output of step S5 shows the causal characteristics. Implicit causal features output in step S6 Both are input into a fully connected network for causal identification. The output is the causal probability value of the event pair and a binary label, i.e., yes / no causal pair. The loss function of the fully connected network is binary cross-entropy loss, which is calculated as follows: ; ; in, It is a binary prediction of the event pair, a probability value ranging from 0 to 1, indicating whether the event pair is causal. is the label of the event pair, and m is the number of training samples. For tag categories Category weights.
[0062] Device Examples According to embodiments of the present invention, an event causality recognition device based on dynamic relation graph convolution is provided, such as... Figure 8 The diagram shown is a block diagram of an event causality identification device based on dynamic graph convolution provided in this embodiment. According to an embodiment of the present invention, the event causality identification device based on dynamic graph convolution includes: The data preprocessing module 10 is used to process the acquired raw text data, which contains multiple events and event pairs with potential causal relationships. The events are labeled, including the start and end positions of each event, to obtain event data.
[0063] The overall feature extraction module 20 is used to obtain the overall representation features of each event based on the constructed encoder containing the BERT model and BiLSTM.
[0064] The preliminary causal probability acquisition module 30 is used to concatenate the overall representation features of each event in the event pair to obtain concatenated features, and obtain the preliminary causal probability value of the event pair through the preliminary causal probability prediction module.
[0065] The event pair interaction feature extraction module 40 is used to construct an undirected event pair graph based on the constructed dynamic relation graph convolutional network. Event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as the initial node features. Different causal relationships exist between nodes, and different types of edges are set accordingly. The initial causal probability values of each event pair are used as the dynamic weights of each edge of the undirected event pair graph to obtain the dynamic weight matrix. The weight matrix of different edge types is learned by the multi-type relation graph convolutional calculation module. Combined with the activation function and the interaction of neighbor node features, the embedded features of each node are output, that is, the event pair interaction features are obtained.
[0066] The explicit causal feature extraction module 50 is used to assign initial weights to each causal indicator vocabulary filtered by FrameNet, forming an initial indicator weight matrix. Then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator. Multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain enhanced overall event representation features. Then, local features and global features are extracted through max pooling layers, and the local features and global features are concatenated to obtain the explicit causal features of the event.
[0067] The implicit causal feature extraction module 60 is used to generate direct and indirect causal common sense for a given event using the COMET model. After passing through the BERT model, the direct and indirect causal context-aware embedding features of the event text are obtained, and similarity is calculated with the overall representation features of the event. The similarity scores are obtained by fusing them based on preset attention weights. Finally, the similarity scores are mapped to the embedding space, and a scaling factor is used to transform the similarity scores into learnable features, thereby obtaining the implicit causal features of the event.
[0068] The causal relationship identification module 70 is used to input the event pair interaction features, explicit causal features, and implicit causal features into a fully connected network to realize event causal identification and obtain the causal relationship and causal probability value of each event pair in the event text.
[0069] The event causal recognition device based on dynamic relational graph convolution provided in this embodiment proposes a dynamic relational graph convolutional network to optimize the learning of event pair interaction features. The event pair interaction feature acquisition module 40 uses the preliminary causal probability of the event pair output by the preliminary causal probability prediction module as the dynamic weight of the edges in the graph, replacing the fixed weights. This allows the model to prioritize high-confidence causal relationship event pairs and filter out irrelevant interference, thus solving the defect of static edge weights in traditional graph convolutional networks. Then, the explicit causal feature acquisition module 50 calculates the dynamic weight of each indicator word based on the causal indicator word vocabulary filtered by FrameNet and combined with the overall event representation features through an attention network. Instead of fixed initial weights, the convolutional kernel prioritizes indicator words with high matching degree with the current context, solving the problem of convolutional neural networks ignoring the context adaptability of indicator words. Finally, the implicit causal feature acquisition module 60 designs a multi-granularity implicit causal matching mechanism, which generates two types of fine-grained common sense for events based on the COMET model according to direct causal relationship and indirect causal relationship, replacing the full knowledge of the common sense knowledge base (ConceptNet), improving the effect of knowledge enhancement, and solving the problem that traditional knowledge enhancement methods directly use the knowledge base, ignore the difference in knowledge granularity, and cause the model to be unable to flexibly call knowledge of different granularities according to task requirements, thus limiting the effect of knowledge enhancement.
[0070] In this embodiment, the overall feature extraction module 20 is specifically configured to extract the context-aware embedding features of each token in the event text using the BERT model; then use BiLSTM to capture the long-distance dependencies in the context-aware embedding features to obtain the enhanced embedding features of each token and aggregate them to obtain the overall representation features of the event; for each event in the event text, find its start position marker and end position marker in the sentence, calculate the attention weights of the enhanced embedding features of all tokens between the two markers using the activation function, and perform weighted summation to obtain the overall representation features of each event.
[0071] The embodiments of the present invention are device embodiments corresponding to the above method embodiments. The specific operations of each module processing step can be understood with reference to the description of the method embodiments, and will not be repeated here.
[0072] like Figure 9 As shown, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the event causal identification method based on dynamic relational graph convolution in the above embodiments.
[0073] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the event causality recognition method based on dynamic relational graph convolution in the above embodiments.
[0074] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0075] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatus or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The apparatus and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and the contents not described in detail in the specification of the present invention are well known to those skilled in the art.
Claims
1. An event causal identification method based on dynamic relation graph convolution, characterized in that, Includes the following steps: 1) Obtain the raw text data, which contains multiple events and event pairs with potential causal relationships. Label the events, including labeling the start and end positions of each event, to obtain the event text data; 2) Construct an encoder containing a BERT model and a BiLSTM to obtain the overall representation features of each event in the event text; 3) The overall representation features of each event in the event pair are spliced together to obtain spliced features, and the preliminary causal probability values of the event pair are obtained through the preliminary causal probability prediction module. 4) Based on the constructed dynamic relational graph convolutional network, event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as the initial node features. Different causal relationships exist between nodes, and different types of edges are set accordingly. In this way, an undirected event pair graph is constructed, and the initial causal probability values of each event pair are used as the dynamic weights of each edge of the undirected event pair graph to obtain the dynamic weight matrix. Through the multi-type relational graph convolutional calculation module, the weight matrices of different edge types are learned and combined with the interaction of activation functions and neighbor node features to obtain the event pair interaction features. 5) Based on the causal indicator vocabulary filtered by FrameNet, an initial weight is assigned to each causal indicator to form an initial indicator weight matrix; then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator; multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain the enhanced overall event representation features; then, local and global features are extracted through max pooling layers, and the local and global features are concatenated to obtain the explicit causal features of the event; 6) The COMET model is used to generate direct causal common sense and indirect causal common sense of the event. The BERT model is used to obtain direct causal context-aware embedding features and indirect causal context-aware embedding features. The similarity is calculated with the overall representation features of the event. The similarity scores are obtained by fusing them based on the preset attention weights. Finally, the similarity scores are mapped to the embedding space and the scaling factor is used to transform the similarity scores into learnable features, thereby obtaining the implicit causal features of the event. 7) Input the event pair interaction features, explicit causal features, and implicit causal features into a fully connected network to achieve event causal recognition and obtain the causal relationship and causal probability value of each event pair in the event text.
2. The event causal identification method based on dynamic relation graph convolution as described in claim 1, characterized in that, Step 2) includes the following steps: Context-aware embedding features of each token in the event text are extracted using the BERT model; BiLSTM is then used to capture long-distance dependencies in context-aware embedding features, obtain the enhanced embedding features of each token, and aggregate them to obtain the overall representation features of the event. For each event in the event text, its start position marker and end position marker in the sentence are found. The attention weights of the enhanced embedding features of all tokens between the two markers are calculated by the activation function and then weighted and summed to obtain the overall representation features of each event.
3. The event causal identification method based on dynamic relation graph convolution as described in claim 1, characterized in that, The preliminary causal probability prediction module includes an input layer, a two-layer MLP network, and a sigmoid output layer. The input layer concatenates the overall representation features of the input event pairs, and the concatenated features are then input into two MLP layers. After passing through the sigmoid function, the preliminary causal probability values of the event pairs are output.
4. The event causal identification method based on dynamic relation graph convolution as described in claim 1, characterized in that, The dynamic relational graph convolutional network includes a graph initialization layer, a dynamic weight calculation layer, and a multi-type relational graph convolutional calculation layer; The graph initialization layer concatenates the overall representation features of each event in any event pair to obtain concatenated features, thus obtaining initial node features. Each event pair is used as a node, and different causal relationships between nodes are set as edges of corresponding different types. In this way, an undirected event pair graph is constructed, and the initial causal probability value of each event pair is used as the dynamic weight of each edge of the undirected event pair graph. The dynamic weight calculation layer calculates the initial causal probability value of the event pair, calculates the final weight of the edge through a normalization formula, and uses it as the dynamic weight of each edge in the undirected event pair graph. The multi-type relational graph convolutional computation layer updates node embedding features hierarchically based on the edge type and dynamic weights of the graph for undirected event pairs.
5. The event causal identification method based on dynamic relation graph convolution as described in claim 4, characterized in that, The type of the edge is determined based on the information cross-relationship between event pairs and is defined as edge type ( Specifically: Type 1 ( This represents two adjacent event pairs with the same causal event. Type 2 ( ), represents a pair of events in which a certain event is in a different position from two adjacent pairs of events; Type 3 ( ), which represents two event pairs with the same result event.
6. The event causal identification method based on dynamic relation graph convolution as described in claim 1, characterized in that, Based on the explicit causal mining network module, which includes causal indicator filtering, lightweight attention network, multi-scale convolutional layers, residual layers, and max pooling layers, step 5) specifically includes the following steps: Step S51: Filter causal indicator words through FrameNet and summarize them to form a causal indicator word vocabulary. Assign initial weights to each causal indicator word in the event text to form an initial indicator word weight matrix. Step S52: Based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to obtain the dynamic weight of each causal indicator and feed back to update the convolution kernel parameters of the lightweight attention network. Step S53: Extract features at different scales through multi-scale convolutional layers. Then, it is combined with the first layer through the residual layer. Enhanced embedding features at the center position of the input of the group convolution kernel Adding them together yields the enhanced overall representation of the event. ; Step S54: Using max pooling, perform local max pooling and global max pooling operations on the text between event pairs to obtain local features and global features, and then concatenate the local features and global features to obtain explicit causal features.
7. The event causal identification method based on dynamic relation graph convolution as described in claim 1, characterized in that, Step 6) is performed as follows: Step S61: For a given event, set instructions for the event according to two granularities: direct causal relationship and indirect causal relationship. Input the instructions into the COMET model to generate common sense knowledge of direct causal relationship and common sense knowledge of indirect causal relationship for the event. Input the two types of common sense knowledge into the BERT model to generate context-aware embedding features of direct causal relationship and context-aware embedding features of indirect causal relationship. Step S62: The obtained direct causal relationship context-aware embedding features and indirect causal relationship context-aware embedding features are respectively compared with the obtained overall representation features of the event. The two types of similarity are then fused through attention weights to obtain a similarity score. Step S63: Map the similarity scores to the embedding space, and use a scaling factor to transform the similarity scores into learnable features, thereby obtaining implicit causal features.
8. An event causal identification device based on dynamic relation graph convolution, characterized in that, include: The data preprocessing module is used to process the acquired raw text data, which contains multiple events and event pairs with potential causal relationships. The events are labeled, including the start and end positions of each event, to obtain event data. The overall feature extraction module is used to obtain the overall representation features of each event in the event text based on the constructed encoder that includes a BERT model and BiLSTM. The preliminary causal probability acquisition module is used to concatenate the overall representation features of each event in an event pair to obtain concatenated features, and obtain the preliminary causal probability value of the event pair through the preliminary causal probability prediction module. The event pair interaction feature extraction module is used to construct an undirected event pair graph based on a constructed dynamic relation graph convolutional network. Event pairs are used as nodes, and the concatenated features corresponding to the event pairs are used as initial node features. Different causal relationships exist between nodes, corresponding to different types of edges. The initial causal probability values of each event pair are used as dynamic weights for each edge of the undirected event pair graph, resulting in a dynamic weight matrix. A multi-type relation graph convolutional computation module learns the weight matrices of different edge types, combines them with activation functions and neighbor node features, and outputs the embedded features of each node, thus obtaining the event pair interaction features. The explicit causal feature extraction module is used to assign initial weights to each causal indicator vocabulary filtered by FrameNet, forming an initial indicator weight matrix. Then, based on the overall event representation features and the initial indicator weight matrix, a lightweight attention network is used to update the convolutional kernel parameters through dynamic weights to obtain the dynamic weights of each causal indicator. Multi-scale features are extracted through multi-scale convolutional layers, and the multi-scale features are passed through residual layers to obtain the enhanced overall event representation features. Then, local and global features are extracted through max pooling layers, and the local and global features are concatenated to obtain the explicit causal features of the event. The implicit causal feature extraction module is used to generate direct and indirect causal common sense for a given event using the COMET model. After passing through the BERT model, the direct and indirect causal context-aware embedding features of the event text are obtained, and similarity is calculated with the overall representation features of the event. The similarity scores are obtained by fusing them based on preset attention weights. Finally, the similarity scores are mapped to the embedding space, and a scaling factor is used to transform the similarity scores into learnable features, thereby obtaining the implicit causal features of the event. The causal relationship identification module is used to input the event pair interaction features, explicit causal features, and implicit causal features into a fully connected network to realize event causal identification and obtain the causal relationship and causal probability value of each event pair in the event text.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the event causal identification based on dynamic relational graph convolution as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the event causality recognition method based on dynamic relational graph convolution as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Causal relationship identification method and device based on graph convolutional network and comparative learning
CN115309862A
System and methods for assessing risk using hybrid causal logic
US20070011113A1