An interpretability evaluation method and device combining causal knowledge and attention
By constructing causal graphs and visualizing attention weights, the interpretability of deep learning models is evaluated, solving the problem of uninterpretability of deep learning models and improving user trust and model transparency.
Patent Information
- Application Number
- CN202510051015.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-01-13
AI Technical Summary
The lack of interpretability of deep learning models leads to low user trust, makes it difficult for developers to understand the internal mechanisms of the models, and makes it difficult for existing technologies to effectively evaluate the interpretability of the models.
By constructing a causal graph of event data, obtaining the causal strength matrix, and combining the causal graph with model training, the trained model is obtained. The attention weight vector is visualized, and the similarity between the directed graph and the causal graph is compared to evaluate the interpretability of the model.
It improves the interpretability of deep learning models, enhances user trust, helps developers understand the internal logic of the models, and improves the transparency and reliability of the models.
Smart Images

Figure CN119886366B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and more specifically to an interpretability evaluation method and apparatus that combines causal knowledge and attention. Background Technology
[0002] The initial design goal of artificial intelligence was to enable machines to mimic human intelligence in decision-making, allowing them to learn, think, and make decisions like humans. Human intelligence, when handling specific tasks, provides its own explanation for each decision, and people typically focus on key information when thinking. Deep learning's powerful fitting ability stems from the massive number of parameters in neural networks, but this also means that most neural network-based models are not transparent and interpretable to decision-makers; the model can only provide predictions without explaining the underlying rationale. Interpretability will be an indispensable part of machine learning models. From the end-user's perspective, interpretability increases their trust and motivates them to adopt machine learning systems; from the perspective of machine learning system developers and researchers, interpretability helps them better understand problems, data, and the reasons why models might fail, thereby improving system security. Therefore, effectively interpreting models and increasing the interpretability of deep learning models, enabling neural networks to think like the human brain when making decisions, is gradually becoming a hot topic in academia and industry. Summary of the Invention
[0003] In view of this, the present disclosure provides a method and apparatus for interpretability assessment that combines causal knowledge and attention, which at least partially solves the problems existing in the prior art.
[0004] This application provides a method for interpretability assessment that combines causal knowledge and attention, comprising:
[0005] The dataset is divided into a training set and a test set;
[0006] Construct a causal graph of event data on the training set to obtain the causal strength matrix between event arguments;
[0007] The model is trained by combining the causal graph to obtain the trained model;
[0008] The test data is input into the trained model to obtain the prediction results and attention weights;
[0009] Visualize the attention weight vectors to obtain a directed graph; and
[0010] Compare the similarity between directed graphs and causal graphs to determine interpretability.
[0011] In one specific embodiment, the model is an event detection model, and the causal relationship between trigger words and event types is used as a causal graph.
[0012] In one specific embodiment, the method includes determining whether the predicted part is the location of the trigger word. If it is the location of the trigger word, the sample is interpretable; if it is not the location of the trigger word, the sample is uninterpretable. The method also includes calculating the proportion of interpretable samples to all test data to evaluate the interpretability of the event detection model in the prediction process.
[0013] In one specific embodiment, the model is an event argument recognition model, and the visualization of the attention weight vector to obtain a directed graph includes:
[0014] For each query sample, ask a question for each argument role to obtain the argument roles. The answer;
[0015] For each query sample, the self-attention matrix generated by the self-attention layer is restored to a directed graph. ;as well as
[0016] Parallel Role Perform self-attention matrix visualization operations to obtain directed graphs. These local directed graphs are integrated into a complete directed graph, forming the prediction relationship graph for the predicted samples. .
[0017] In one specific embodiment, comparing the similarity between a directed graph and a causal graph to determine interpretability includes:
[0018] Get the sample cause-effect graph ;as well as
[0019] Comparison Chart With Figure Similarity includes:
[0020] Statistical Sample Cause-Effect Diagram The number of all existing edges in the array is taken as the theoretical number of edges that should be discovered. ;
[0021] statistics The edges in the graph exist The number of edges in the correct discovery ;as well as
[0022] The degree of interpretability is determined by the following formula: .
[0023] In one specific embodiment, a causal graph of event data is constructed on the training set to obtain a causal strength matrix between event arguments, including:
[0024] Extract feature data from the training set to form a feature matrix X;
[0025] Calculate the covariance matrix S of the feature matrix X to represent the correlation between different feature data; and
[0026] Minimize the loss function to obtain the causal graph of the event text, wherein the loss function is the difference between the covariance matrix S and the predicted covariance matrix under the given causal graph structure, expressed as follows:
[0027]
[0028] Where Θ is the causality strength matrix of the causal graph. It is the prediction covariance matrix given the graph structure Θ. It is the Frobenius norm. The loss function represents the cause-effect graph.
[0029] In one specific embodiment, the method further includes obtaining the optimized causal strength matrix by the following formula. :
[0030]
[0031] in, The L1 regularization term ensures the sparsity of the graph, and λ is the regularization parameter, a hyperparameter learned by the model during training. It is the L1 norm of the adjacency matrix.
[0032] In one specific embodiment, the method further includes using the following method to optimize the causal strength matrix. Perform thresholding:
[0033] Set a threshold for the causal strength matrix Elements whose absolute value is less than the threshold are set to 0, and elements that are greater than or equal to the threshold are retained.
[0034] In one specific embodiment, comparing the similarity between a directed graph and a causal graph to determine interpretability includes using one of the following methods to determine the similarity between the directed graph and the causal graph: structural similarity measurement method, path consistency analysis method, or conditional independence test method.
[0035] This application also provides an interpretability assessment device that combines causal knowledge and attention, comprising:
[0036] A data partitioning device is used to divide a dataset into a training set and a test set;
[0037] A causal graph construction device constructs a causal graph of event data on a training set to obtain a causal strength matrix between event arguments;
[0038] The model building device combines the causal graph to train the model to obtain the trained model, and inputs the test data into the trained model to obtain the prediction results and attention weights.
[0039] A directed graph acquisition device that visualizes attention weight vectors to obtain a directed graph; and
[0040] A comparison device compares the similarity between a directed graph and a causal graph to determine interpretability.
[0041] This disclosure provides a method and apparatus for interpretability evaluation that combines causal knowledge and attention. The method includes: dividing a dataset into a training set and a test set; constructing a causal graph of event data on the training set to obtain a causal strength matrix between event arguments; training a model using the causal graph to obtain a trained model; inputting test data into the trained model to obtain prediction results and attention weights; visualizing the attention weight vectors to obtain a directed graph; and comparing the similarity between the directed graph and the causal graph to determine interpretability. Through the processing scheme of this disclosure, the interpretability of the model is achieved. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A schematic flowchart illustrating the interpretability assessment method combining causal knowledge and attention provided in embodiments of this disclosure;
[0044] Figure 2 A schematic diagram of the process for constructing a cause-effect graph provided in an embodiment of this disclosure;
[0045] Figure 3 A schematic diagram illustrating the visualization analysis of the attention weight vector generated by the attention layer provided in this embodiment of the disclosure;
[0046] Figure 4 A flowchart illustrating the interpretative evaluation method for an event argument recognition model provided in this embodiment of the disclosure;
[0047] Figure 5This is a flowchart of an embodiment of the present disclosure for obtaining a predicted relation graph using an event argument recognition model;
[0048] Figure 6 A schematic diagram of the structure of an interpretability assessment device combining causal knowledge and attention provided in an embodiment of this disclosure;
[0049] Figure 7 This is a schematic diagram of the interpretability assessment device that combines causal knowledge and attention, as described in this application. Detailed Implementation
[0050] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0051] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0052] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0053] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0054] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0055] First, refer to Figure 1 This paper describes the interpretability assessment method that combines causal knowledge and attention in this application.
[0056] S101: Splitting the dataset into training and test sets; In machine learning, splitting a dataset into training and test sets is used to evaluate the model's performance on unseen data. Typically, the dataset is randomly divided into two parts, one for training the model and the other for testing it. For example, with the MNEE dataset, 80% of the dataset could be randomly allocated to the training set for training the machine learning model, while the remaining 20% could be used as the test set to evaluate the model's generalization ability. In practice, this process can be easily achieved using functions such as the `train_test_split` function from Python's scikit-learn library.
[0057] S102: Construct a causal graph of event data on the training set to obtain a causal strength matrix between event arguments. Event arguments include trigger words, argument roles, event types, etc. The causal strength matrix can quantify the strength of causal relationships. This not only analyzes the interaction between features, but also further quantifies the magnitude of the interaction, thereby achieving data interpretability.
[0058] In this application, the NO-TEARS (No TEquilibrium Assumptions Required) algorithm is used to construct causal graphs. It is primarily used to learn causal structure graphs from observed data, where nodes represent variables and edges represent causal relationships. Unlike traditional methods, NO-TEARS does not rely on equilibrium assumptions or structural equation modeling assumptions. However, it should be understood that other methods for constructing causal graphs can also be used, such as expert knowledge-based methods, statistical algorithms, structural learning algorithms (e.g., LiNGAM), and hybrid methods (e.g., combining the Fuzzy Delphi Method and Fuzzy DEMATEL techniques), as long as the method can construct a causal graph. Figure 2 As shown, the process of constructing the causal graph in this application specifically includes:
[0059] S201: Extract feature data from the event text to form a feature matrix X. First, extract relevant feature data, such as argument roles, trigger words, and event types, from the training set of multiple event texts based on the labeled corpus. Second, preprocess the data to convert it into binary numerical features, marking 0 for the presence of trigger words and 1 for the absence of trigger words, and so on. Finally, form the feature matrix from the processed text data. , where n is the number of samples and p is the feature dimension.
[0060] S202: Calculate the covariance matrix S of the feature matrix X to represent the correlation between different feature data; define the covariance matrix, and calculate the covariance matrix S of the feature matrix to represent the correlation between different features (or events), the calculation formula is as follows:
[0061]
[0062] Where n is the number of samples and X is the feature matrix.
[0063] S203: Minimize the loss function to obtain the causal graph of the event text; the loss function of the NO-TEARS algorithm is based on the covariance matrix. Specifically, the loss function is typically defined as the difference between the covariance matrix of the data and the predicted covariance matrix of the model. The form of the loss function is:
[0064]
[0065] Where Θ is the causality strength matrix (adjacency matrix) of the causal graph, that is, the edge weight matrix of the causal graph. It is the prediction covariance matrix given the graph structure Θ. It is the Frobenius norm. Let Θ represent the loss function.
[0066] S204: Since the NO-TEARS algorithm finds a graph structure Θ that minimizes a loss function to make the predicted covariance matrix as close as possible to the actual covariance matrix, the optimization problem is to obtain the optimized causal strength matrix. :
[0067]
[0068] in, The L1 regularization term ensures the sparsity of the graph, and λ is the regularization parameter, a hyperparameter learned by the model during training. It is the L1 norm of the adjacency matrix.
[0069] The optimized result is an adjacency matrix. The elements of this matrix represent the direct influence relationships between nodes, i.e., the causal strength matrix. The value of each element indicates the strength of the influence relationship. To obtain a clear causal graph, it is usually necessary to... Thresholding is performed, which involves setting a threshold value, setting elements whose absolute value is less than the threshold to 0, and keeping elements whose absolute value is greater than or equal to the threshold:
[0070]
[0071] The thresholded adjacency matrix (causality strength matrix) Convert to a directed graph (directed edges represent causal relationships), and the non-zero elements in the matrix. This represents the causal relationship from node i to node j. Furthermore, graph visualization tools (such as Graphviz) can be used to convert the adjacency matrix into a graphical causal graph, clarifying the causal relationships between argument roles, trigger words, and event types, and analyzing the influence chain between elements in an event.
[0072] The above has been referenced. Figure 2 The steps for constructing a causal graph in this application have been described. However, it is understood that other methods can also be used to construct a causal graph, as long as the causal graph can reflect the causal relationship between event arguments.
[0073] S103: The model is trained using the causal graph to obtain the trained model. Since the concept of the strength of causal relationship is similar to the attention weight in the attention mechanism in deep learning, and the attention weight reflects the correlation between the input data and the specific task, it can explain the most critical features for prediction. Therefore, external causal knowledge (in this application, a causal graph) can be introduced by designing attention networks, self-attention networks, etc.
[0074] Specifically, by incorporating specific causal constraints into the model's training process, the attention mechanism can focus more intently on words or phrases with causal relationships within a sentence. For instance, when constructing a self-attention layer, a causal graph can be predefined. This graph, based on domain knowledge or the results automatically identified by the pre-trained model, identifies potential causal relationships in the text. When the model calculates attention weights, it references this causal graph, assigning higher weights to causally related words, thus enabling the model to better capture the causal logic between events when understanding the text. Taking the medical field as an example, suppose there is a sentence: "Due to the patient's long-term smoking, lung cancer eventually developed." In this example, there is a clear causal relationship between "long-term smoking" and "causing lung cancer." Through a designed attention network or self-attention network, the model can more accurately identify and extract these two key events and their causal relationship, thereby improving the performance of the event extraction task. This method not only helps improve the model's interpretability but also plays an important role in applications such as disease diagnosis and risk assessment.
[0075] In another embodiment, in an event extraction task, suppose we have a news text dataset and the goal is to identify specific types of events from the text, such as "natural disasters" or "company acquisitions." First, the text can be encoded using a pre-trained language model (such as BERT) to obtain a vector representation of each word. Then, a self-attention layer is built on top of these word vectors. This layer allows each word vector to not only focus on itself but also adjust its representation based on other word vectors in the context. This mechanism helps the model understand the relationships between words. Next, to introduce causal relationships, a causal graph module can be added after the self-attention layer. This module utilizes known domain knowledge or causal relationships learned from data to guide the allocation of attention weights. For example, in an event, trigger words, argument roles, and event types are interconnected and not independent. Therefore, causal knowledge between argument roles and event types, argument roles and argument roles, and trigger words and argument roles can be used as prior causal knowledge for the event argument recognition model. By introducing a self-attention network layer into the model and using prior causal knowledge to guide the attention network learning process, the transparency of the model's reasoning process can be improved, thereby enhancing the model's interpretability. In this way, the designed attention network and self-attention network can effectively combine causal reasoning, enhancing the model's understanding and prediction capabilities in complex scenarios.
[0076] The above describes several methods for combining causal graphs. However, it is understandable that other methods can also be used, simply by incorporating the prior knowledge of the causal graph into the training model.
[0077] S104: Input test data into the trained model to obtain prediction results and attention weights. In the event extraction task, when we input test data into the trained model, the model not only outputs prediction results for each candidate event type but also generates corresponding attention weights. These weights reflect the degree of attention the model pays to different parts of the input sequence when making predictions. For example, suppose we are processing financial news text with the goal of extracting the specific event "corporate merger." After receiving a news report containing multiple sentences, the model calculates the relevance score of each word in the text to the target event through an internal mechanism and assigns attention weights accordingly. Finally, the model determines the key information in the text most likely representing the "corporate merger" event based on these weights and pre-trained parameters, and provides prediction results, such as confirming the existence of such an event and detailed information about the entities involved. Furthermore, by analyzing the attention weight distribution, we can further understand the model's decision-making process, optimize model performance, or adjust input features to improve the accuracy and reliability of event extraction.
[0078] S105: Visualize the attention weight vector to obtain a directed graph. During the model prediction process, the attention weights generated by the attention layer and the causal intensity matrix have different dimensions and cannot be directly compared. Therefore, in this application, the attention weight vector is visualized (using a graphics library such as Matplotlib or Seaborn), and the prediction results are combined to analyze how the model processes different parts of the input to reason and obtain the final answer. The resulting explanation is a relationship graph between trigger words, argument roles, and event types. This explanation is presented in the form of a directed graph, thereby achieving the interpretability of the model.
[0079] S106: Compare the similarity between the directed graph and the causal graph to determine interpretability. Specifically, in one embodiment, a structural similarity metric can be used to determine the similarity, focusing primarily on the connections between nodes in the two graphs. By comparing the direction and presence of edges in the directed and causal graphs, algorithms such as the Jaccard index, edit distance, or graph isomorphism can be used to quantify the structural similarity between the two graphs. For example, if the direct causal relationships between most nodes in the two graphs are aligned, they are considered to have high structural similarity.
[0080] In another embodiment, path consistency analysis can be used to determine the similarity level. This method focuses on the consistency of all possible paths from one node to another in the graph. In a causal graph, paths represent possible causal links between variables. By comparing the existence of paths from the same start point to the same end point in two graphs and whether their directions are consistent, the level of consistency of these graphs in expressing causal relationships can be assessed. If two graphs reveal the same causal paths, they are considered highly consistent in expressing causal logic.
[0081] In another embodiment, a conditional independence test can be used, which employs statistical methods to examine the degree of matching between the conditional independence represented by different graphs. For a given set of variables, certain combinations of variables may exhibit different properties of conditional independence under different graph structures. By performing tests such as the chi-square test, mutual information test, or other correlation analyses, it can be determined whether two graphs are similar in their ability to predict dependencies between variables on the same dataset. If both graphs accurately reflect the conditional independence between variables in the data, they are considered to be similar in their ability to capture causal relationships.
[0082] It should be understood that other methods can also be used to compare the similarity between directed graphs and causal graphs to determine interpretability.
[0083] This method applies the results of data interpretability to model design, and the correctness of the model interpretability results is judged by the results obtained from data interpretability. This achieves mutual verification between model interpretability and data interpretability, and finally constructs an interpretability evaluation method for a complete event extraction model processing flow from data to model and back to data.
[0084] Next, the interpretability evaluation method of this application will be described using the event detection model and the event argument recognition model as examples.
[0085] For event detection models, a complete event causal graph is constructed on the training set of the event dataset using causal discovery methods. Considering the characteristics of the event detection task, the causal relationship between trigger words and event types is extracted as the causal graph, serving as prior knowledge for the task. Trigger words are those words that indicate or suggest the occurrence of a specific event, often associated with specific event types, helping to categorize events into different classes. Therefore, the causal relationship between trigger words and event types (trigger word - event type) can be used as prior causal knowledge for the event detection model. By introducing an attention network layer into the event detection model, this prior causal knowledge guides the attention network's learning process, improving the model's interpretability.
[0086] For each sample in the test set, the model outputs the predicted trigger word's location and event type information, outputs the attention weights generated by the attention layer, and combines the prediction results (only performing interpretability analysis on samples where the trigger word is correctly identified) to determine whether the part of the input most relevant to the prediction is the location of the trigger word. If it is the location of the trigger word, it matches prior knowledge, and the model reasoned according to the logic of prior knowledge during the prediction process for this sample, making the sample interpretable. If it does not match prior knowledge, it means that the model did not pay attention to the trigger word most relevant to the event type according to the logic of prior knowledge when predicting this sample, making the sample uninterpretable.
[0087] The number of interpretable and non-interpretable samples is counted, and the proportion of interpretable samples to all test data is calculated. This proportion is defined as IED (Interpretable Event Detection) to evaluate whether the event detection model is interpretable during the prediction process.
[0088] For example, consider the following events in ACE2005:
[0089]
[0090] The actual event type of this event is "Movement.Transport", and the trigger word is "arrived". Visual analysis of the attention weight vector output generated by the attention layer during the prediction of this sample reveals that the parts of the sentence input with significant attention weight values are where the trigger word is located. Specific results are as follows: Figure 3 As shown.
[0091] Ultimately, statistical analysis revealed an IED value of 76.3% on the MNEE dataset and 66.3% on the ACE dataset. This demonstrates that the event detection method proposed in this application, which integrates causal knowledge and attention mechanisms, not only pursues high event detection performance but also effectively guides the model to reason according to the intended logic by introducing causal knowledge as prior knowledge into the model and combining it with the attention mechanism. The prediction process exhibits good interpretability.
[0092] Next, refer to Figure 4 and Figure 5 This describes an interpretive evaluation method for event argument recognition models.
[0093] S401: Obtain the sample causal graph and extract the causal knowledge of trigger word-argument roles and argument roles-argument roles from the complete event causal graph as prior knowledge for the argument role recognition model. For the samples in the test set... The sample causal graph of this sample can be extracted. .
[0094] S402: Obtain the prediction relationship graph In an event, trigger words, argument roles, and event types are interconnected and do not exist independently. Therefore, causal knowledge between argument roles and event types, argument roles and argument roles, and trigger words and argument roles can be used as prior causal knowledge for the event argument recognition model. By introducing a self-attention network layer into the model, prior causal knowledge can be used to guide the learning process of the attention network, thereby improving the interpretability of the model.
[0095] Specifically, refer to Figure 5 For the event argument recognition model, obtaining the predicted relationship graph includes:
[0096] S501: For each query sample, ask a question for each argument role to obtain the argument roles. The answer; because the main idea of the causal-self-attention argument role recognition model is to ask questions to each argument role based on a template defined by the event type, and obtain the argument role's answer, therefore, for the samples in the test set... When input into the model, the model will generate m query samples based on the number m of argument roles defined for the event type, with each sample corresponding to one argument role. .
[0097] S502: For each query sample, restore the self-attention matrix generated by the self-attention layer to a directed graph. For each query sample, the model generates a predicted answer span. This application combines the output of the self-attention matrix generated by the self-attention layer with the predicted answer (considering only samples where the trigger word is correctly predicted) to reconstruct the self-attention weight matrix into a directed graph. This indicates that in predicting argument roles The study also focused on which parts of the sentence input, and how these parts relate to... How do they interact?
[0098] S503: On Argument Roles Perform self-attention matrix visualization operations to obtain directed graphs. These local directed graphs are integrated into a complete directed graph to form the prediction samples. Predictive Relationship Diagram This refers to the interpretation result given by the model when performing argument recognition on the sample.
[0099] S403: Comparison Image With Figure The similarity of the graphs is used to analyze the correctness of the interpretation results. Because the graphs are relatively sparse, complex metrics such as Hamming distance are not used; only the sample causal graphs are statistically analyzed. The number of all existing edges in the array is taken as the theoretical number of edges that should be discovered. , If the edges in the graph exist In this case, it is considered that an edge has been correctly discovered, that is, a correctly discovered edge. For all test set samples, the number of correctly discovered edges and the number of edges that should have been discovered are counted. An index, IEE (Interpretable Event Extraction), is defined to evaluate the correctness of the reasoning logic relied upon by the proposed event extraction model during the prediction process, i.e., the degree of interpretability. The formula is as follows:
[0100]
[0101] Let's take the following event from ACE2005 as an example:
[0102]
[0103] For the actual annotation results of this instance event, the event type is "Movement.Transport", the trigger word is "arrived", and according to the ACE2005 definition of an event, the included argument roles are: Artifact ("Kelly"), Destination ("Seoul"), and Original ("Beijing"). Based on the trigger word, argument roles, and other information appearing in this instance, this paper can obtain a sample causal graph, as shown below. Figure 6 As shown.
[0104] For this example's prediction results, there is a corresponding argument role question template for each argument role. Along with the model's output of the predicted argument results, an attention weight matrix is also output. By visualizing and analyzing each matrix, a relationship graph about the predicted argument roles can be obtained. The following are the detailed steps on how to obtain the prediction relationship graph based on the prediction results:
[0105] For the predicted argument Artifact, the attention weight matrix related to the prediction process is output and visualized. It is found that the attention weight values between "arrived" (corresponding to the trigger word) and "Kelly" (corresponding to the argument Artifact) are significant, and a local relationship graph can be obtained, pointing to the relationship that Artifact points to the trigger word.
[0106] For predicting the argument role Destination, the attention weight matrix related to the prediction process is output and visualized. It is found that the attention weight values between "arrived" (corresponding to the trigger word) and "Seoul" (corresponding to the argument role Destination) are significant, and a local relationship graph can be obtained, pointing to the relationship that Destination points to the trigger word.
[0107] For the predicted argument role Origin, we output the attention weight matrix related to the prediction process and visualize it. We find that the attention weight values between "arrived" (corresponding to the trigger word) and "Beijing" (corresponding to the argument role Origin) are significant, and we can obtain a local relationship graph with the relationship that Origin points to the trigger word.
[0108] The local relation graphs obtained by reconstructing the attention weight matrices generated during the prediction process based on different argument roles are integrated and finally reconstructed to form the prediction relation graph. The final prediction relation graph of this sample is then compared with the sample causality. Figure 1 Therefore, it can be assumed that the model's argument identification process for this sample conforms to prior causal knowledge, its interpretable results are correct, and the model's reasoning process is an interpretable process.
[0109] Ultimately, statistical analysis revealed an IEE of 80.1% on the MNEE dataset and 86.44% on the ACE dataset. This demonstrates that the event argument recognition model proposed in this application, which integrates causal knowledge and self-attention mechanisms, not only pursues high argument extraction performance but also effectively guides the model to make predictions based on what it considers to be correct logic during the argument extraction process by guiding the self-attention mechanism to learn how argument roles and trigger words interact through causal knowledge.
[0110] The interpretability assessment method combining causal knowledge and attention of this application has been described above with reference to the accompanying drawings. Next, in conjunction with... Figure 7 This application describes an interpretability assessment device that combines causal knowledge and attention, the device comprising:
[0111] A data partitioning device is used to divide a dataset into a training set and a test set; such as Figure 7 As shown, the original data was divided into training data and test data, and the training data was used to obtain the causal graph (see [link]). Figure 7 (The left side of the middle section), while the test data is used as input to the prediction model for prediction (see the left side of the middle section). Figure 7 upper middle part).
[0112] The causal graph construction device constructs a causal graph of event data on a training set to obtain a causal strength matrix between event arguments; specifically, the data on the training set is used to construct the causal graph, and the specific construction method has been referenced. Figure 2 The description has already been provided, so I will not repeat it here.
[0113] The model building device trains the model using the causal graph to obtain a trained model, and inputs test data into the trained model to obtain prediction results and attention weights; this part can refer to the self-attention mechanism to obtain the trained model (corresponding to...). Figure 7 The part corresponding to the solid line box.
[0114] A directed graph acquisition device visualizes attention weight vectors to obtain a directed graph (corresponding to...). Figure 7 (the part within the dashed box on the right); and
[0115] The comparison device compares the similarity between the directed graph and the causal graph to determine interpretability (correspondence). Figure 7 (the lowest part).
[0116] Since the functions of the various parts of the interpretability assessment device that combines causal knowledge and attention have been described above with reference to the accompanying drawings, they will not be repeated here.
[0117] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A method for assessing interpretability that combines causal knowledge and attention, characterized in that, include: The dataset is divided into a training set and a test set; Construct a causal graph of event data on the training set to obtain the causal strength matrix between event arguments; The model is trained by combining the causal graph to obtain the trained model; The test data is input into the trained model to obtain the prediction results and attention weights; Visualize the attention weight vectors to obtain a directed graph; as well as Compare the similarity between directed graphs and causal graphs to determine interpretability; in The model is an event argument recognition model, and the visualization of the attention weight vector to obtain a directed graph includes: For each query sample, ask a question for each argument role to obtain the argument roles. The answer; For each query sample, the self-attention matrix generated by the self-attention layer is restored to a directed graph. ; as well as Parallel Role Perform self-attention matrix visualization operations to obtain directed graphs. These local directed graphs are integrated into a complete directed graph, forming the prediction relationship graph for the predicted samples. .
2. The interpretability assessment method according to claim 1, characterized in that, Comparing the similarity between directed graphs and causal graphs to determine interpretability includes: Get the sample cause-effect graph ;as well as Comparison Chart With Figure Similarity includes: Statistical Sample Cause-Effect Diagram The number of all existing edges in the array is taken as the theoretical number of edges that should be discovered. ; statistics The edges in the graph exist The number of edges in the correct discovery ;as well as The degree of interpretability is determined by the following formula: .
3. The interpretability assessment method according to any one of claims 1-2, characterized in that, Construct a causal graph of the event data on the training set to obtain the causal strength matrix between event arguments, including: Extract feature data from the training set to form a feature matrix X; Calculate the covariance matrix S of the feature matrix X to represent the correlation between different feature data; and Minimize the loss function to obtain the causal graph of the event text, wherein the loss function is the difference between the covariance matrix S and the predicted covariance matrix under the given causal graph structure, expressed as follows: ; Where Θ is the causality strength matrix of the causal graph. It is the prediction covariance matrix given the graph structure Θ. It is the Frobenius norm. The loss function represents the cause-effect graph.
4. The interpretability assessment method according to claim 3, characterized in that, The method also includes obtaining the optimized causality strength matrix using the following formula. : ; in, The L1 regularization term ensures the sparsity of the graph, and λ is the regularization parameter, a hyperparameter learned by the model during training. It is the L1 norm of the adjacency matrix.
5. The interpretability assessment method according to claim 4, characterized in that, The method also includes using the following method to optimize the causality strength matrix. Perform thresholding: Set a threshold for the causal strength matrix Elements whose absolute value is less than the threshold are set to 0, and elements that are greater than or equal to the threshold are retained.
6. The interpretability assessment method according to claim 1, characterized in that, Comparing the similarity between directed graphs and causal graphs to determine interpretability includes using one of the following methods to determine the similarity between directed graphs and causal graphs: structural similarity measurement methods, path consistency analysis methods, or conditional independence tests.
7. An interpretability assessment device combining causal knowledge and attention, characterized in that, include: A data partitioning device is used to divide a dataset into a training set and a test set; A causal graph construction device constructs a causal graph of event data on a training set to obtain a causal strength matrix between event arguments; The model building device combines the causal graph to train the model to obtain the trained model, and inputs the test data into the trained model to obtain the prediction results and attention weights. A directed graph acquisition device that visualizes attention weight vectors to obtain a directed graph; as well as A comparison device compares the similarity between a directed graph and a causal graph to determine interpretability; in The model is an event argument recognition model, and the visualization of the attention weight vector to obtain a directed graph includes: For each query sample, ask a question for each argument role to obtain the argument roles. The answer; For each query sample, the self-attention matrix generated by the self-attention layer is restored to a directed graph. ; as well as Parallel Role Perform self-attention matrix visualization operations to obtain directed graphs. These local directed graphs are integrated into a complete directed graph, forming the prediction relationship graph for the predicted samples. .
Citation Information
Patent Citations
Knowledge graph relation prediction method and device, electronic equipment and storage medium
CN116579421A
Dam emergency event causal relationship identification method and system based on feature fusion
CN116738366A