Method and device for interpretability evaluation in combination with causal knowledge and attention

By combining causal knowledge and attention mechanism in the deep learning model, building a causal graph and introducing causal constraints, the problem of lack of interpretability in the decision-making process of the deep learning model is solved, and the high interpretability of the model and the improvement of user trust is achieved.

CN119886366AActive Publication Date: 2025-04-25NAT UNIV OF DEFENSE TECH

Patent Information

Application Number
CN202510051015.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-25
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

Existing deep learning models lack interpretability in the decision-making process, making it difficult to provide the basis behind the decision, affecting user trust and model understanding.

Method used

Combining causal knowledge and attention mechanism, by constructing a causal graph of event data, a causal intensity matrix is ​​obtained, and causal constraints are introduced in model training to generate a visual directed graph to evaluate the interpretability of the model.

Benefits of technology

Improves the interpretability of the model, enables users to understand the decision-making process of the model, enhances user trust, and helps developers better understand the behavior of the model and the potential causes of failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886366A_ABST
    Figure CN119886366A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interpretability evaluation method and device combining causal knowledge and attention. The method comprises the steps that a data set is divided into a training set and a test set; constructing a causal graph of the event data on the training set to obtain a causal intensity matrix between event arguments; performing model training in combination with the causal graph to obtain a trained model; inputting test data into the trained model to obtain a prediction result and an attention weight; visualizing the attention weight vector to obtain a directed graph; and comparing the similarity between the directed graph and the causal graph to determine the interpretability. Through the processing scheme disclosed by the invention, the interpretability of the model is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to an interpretability evaluation method and device combining causal knowledge and attention. Background Art

[0002] The original intention of artificial intelligence design is to make machines imitate human intelligence when making decisions, so that they can learn, think and make decisions like humans. When human intelligence handles specific tasks, it will have its own explanation for each decision. When people think, they usually focus on the key information of things. The powerful fitting ability of deep learning is due to the huge number of parameters of neural networks, but at the same time, this also makes most neural network-based models not a transparent and interpretable model for decision makers. The model can only give prediction results, but cannot give the basis behind such predictions. Interpretability will be an indispensable part of machine learning models. From the perspective of end users, interpretability will increase their trust and motivate them to adopt machine learning systems; from the perspective of machine learning system developers and researchers, interpretability can help them better understand problems, data, and reasons why models may fail, thereby improving the security of the system. Therefore, effectively explaining models, increasing the interpretability of deep learning models, and making neural networks think according to the same logic as human brains when making decisions are gradually becoming hot issues in academia and industry. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure provide an interpretability evaluation method and device that combines causal knowledge and attention, which at least partially solves the problems existing in the prior art.

[0004] This application proposes an interpretability evaluation method that combines causal knowledge and attention, including:

[0005] Divide the dataset into training and testing sets;

[0006] Construct a causal graph of event data on the training set to obtain a causal strength matrix between event arguments;

[0007] Performing model training in combination with the causal graph to obtain a trained model;

[0008] Feed the test data into the trained model to obtain predictions and attention weights.

[0009] Visualize the attention weight vectors to obtain a directed graph; and

[0010] Compare the similarities between directed graphs and causal graphs to determine interpretability.

[0011] In a specific embodiment, the model is an event detection model, and the causal relationship between the trigger words and the event types is used as a causal graph.

[0012] In a specific embodiment, the method includes determining whether the predicted part is where the trigger word is located. If it is where the trigger word is located, the sample is explainable; if it is not where the trigger word is located, the sample is not explainable, and the proportion of explainable samples to all test data is statistically calculated to evaluate the explainability of the event detection model in the prediction process.

[0013] In a specific embodiment, the model is an event argument recognition model, and the visualizing the attention weight vector to obtain a directed graph includes:

[0014] For each query sample, ask each argument role to obtain the argument role 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] Argument Role Perform self-attention matrix visualization operations separately to obtain a directed graph , these local directed graphs are integrated into a complete directed graph to form the prediction relationship graph of the prediction sample .

[0017] In a specific embodiment, comparing the similarity between the directed graph and the causal graph to determine the interpretability includes:

[0018] Get Get a sample cause-effect diagram ;as well as

[0019] Comparison chart With Figure Similarities include:

[0020] Statistical Sample Cause and Effect Diagram The number of all existing edges in is the number of edges that should be found in theory. ;

[0021] statistics The edges in the graph exist The number of correctly discovered edges ;as well as

[0022] The degree of interpretability is determined by the following formula: .

[0023] In a specific embodiment, a causal graph of event data is constructed on a 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] Calculating the covariance matrix S of the feature matrix X to express the correlation between different feature data; and

[0026] Minimize the loss function to obtain the causal graph of the event text, where the loss function is the difference between the covariance matrix S and the predicted covariance matrix under a given causal graph structure, expressed as follows:

[0027]

[0028] where Θ is the causal strength matrix of the causal graph, is the predicted covariance matrix under a given graph structure Θ, is the Frobenius norm, Represents the loss function of the causal graph.

[0029] In a specific embodiment, the method further includes obtaining an optimized causal strength matrix by the following formula: :

[0030]

[0031] in, is the L1 regularization term to ensure the sparsity of the graph, λ is the regularization parameter, which is a hyperparameter learned by the model during training. is the L1 norm of the adjacency matrix.

[0032] In a specific embodiment, the method further includes using the following method to optimize the causal strength matrix Perform thresholding:

[0033] Set a threshold value and transform the causal strength matrix The elements whose absolute values ​​are less than the threshold are set to 0, and the elements whose absolute values ​​are greater than or equal to the threshold are retained.

[0034] In a specific embodiment, comparing the similarity between the directed graph and the causal graph to determine the interpretability includes using one of the following methods to determine the similarity between the directed graph and the causal graph: a structural similarity measurement method, a path consistency analysis method, or a conditional independence test method.

[0035] This application also provides an interpretability evaluation device combining causal knowledge and attention, including:

[0036] A data partitioning device, used for partitioning a data set 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] A model building device, which performs model training in combination with the causal graph to obtain a trained model, and inputs test data into the trained model to obtain a prediction result and an attention weight;

[0039] A directed graph acquisition device visualizes the attention weight vector to obtain a directed graph; and

[0040] The comparison device compares the similarity between the directed graph and the causal graph to determine the interpretability.

[0041] In the embodiment of the present disclosure, a method and device for evaluating interpretability combining causal knowledge and attention are provided, including: dividing a data set 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; performing model training in combination with 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 vector 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 the present disclosure, the interpretability of the model is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A flowchart of an interpretability evaluation method combining causal knowledge and attention provided in an embodiment of the present disclosure;

[0044] Figure 2 A schematic diagram of a process for constructing a cause-effect diagram provided in an embodiment of the present disclosure;

[0045] Figure 3 A schematic diagram for visually analyzing the attention weight vector generated by the attention layer provided in an embodiment of the present disclosure;

[0046] Figure 4 A flowchart of an explanatory evaluation method for an event argument recognition model provided by an embodiment of the present disclosure;

[0047] Figure 5A flowchart of obtaining a prediction relationship diagram for an event argument recognition model provided in an embodiment of the present disclosure;

[0048] Figure 6 A schematic diagram of the structure of an interpretability evaluation device combining causal knowledge and attention provided in an embodiment of the present disclosure; Figure 7 A schematic diagram of the structure of the interpretability evaluation device that combines causal knowledge and attention in this application. DETAILED DESCRIPTION

[0049] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0050] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0051] 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 may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0052] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0053] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0054] First, refer to Figure 1 , describing the interpretability evaluation method of this application that combines causal knowledge and attention.

[0055] S101: Divide the dataset into training and test sets; In machine learning, the dataset is divided into training and test sets to evaluate the performance of the model on unseen data. Usually, the dataset is randomly divided into two parts, one for training the model and the other for testing the model. For example, for the MNEE dataset, 80% of the dataset can be randomly assigned to the training set for training the machine learning model, while the remaining 20% ​​is used as the test set to evaluate the generalization ability of the model. In practice, this process can be easily implemented using the train_test_split function in the scikit-learn library in Python.

[0056] S102: Construct a causal graph of event data on the training set to obtain a causal strength matrix between event arguments, where event arguments include trigger words, argument roles, event types, etc. The causal strength matrix can quantify the strength of the causal relationship. This not only analyzes the interaction between features, but also further quantifies the size of the interaction, thereby achieving data interpretability.

[0057] In this application, the NO-TEARS (No TEquilibrium Assumptions Required) algorithm is used to construct a causal graph, which is mainly 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 model assumptions. However, it should be understood that other causal graph construction methods can also be used, such as expert knowledge-based construction methods, statistical algorithms, structural learning algorithms (such as LiNGAM), hybrid methods (such as combining fuzzy Delphi Method and fuzzy DEMATEL technology), etc., as long as the method can construct a causal graph. Figure 2 As shown, the process of constructing a causal graph in this application specifically includes:

[0058] S201: Extract feature data from event text to form feature matrix X. First, extract relevant feature data from the training set of multiple event texts based on the annotated corpus, such as argument roles, trigger words, event types, etc.; second, preprocess them and convert them into binary numerical features, where the presence of trigger words is recorded as 0, otherwise it is recorded as 1, and the same applies to the others. Finally, the processed text data forms a feature matrix , where n is the number of samples and p is the feature dimension.

[0059] S202: Calculate the covariance matrix S of the feature matrix X to express the correlation between different feature data; define the covariance matrix, calculate the covariance matrix S of the feature matrix to express the correlation between different features (or events), and the calculation formula is as follows:

[0060]

[0061] Where n is the number of samples and X is the feature matrix.

[0062] 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 usually 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:

[0063]

[0064] Among them, Θ is the causal strength matrix (adjacency matrix) of the causal graph, that is, the weight matrix of the edges of the causal graph, is the predicted covariance matrix under a given graph structure Θ, is the Frobenius norm, Denotes the loss function of Θ.

[0065] S204: Since the NO-TEARS algorithm finds a graph structure Θ by minimizing a loss function so that the predicted covariance matrix is ​​closest to the actual covariance matrix, the optimization problem is to obtain the optimized causal strength matrix :

[0066]

[0067] in, is the L1 regularization term to ensure the sparsity of the graph, λ is the regularization parameter, which is a hyperparameter learned by the model during training. is the L1 norm of the adjacency matrix.

[0068] The result of optimization is an adjacency matrix , the elements of this matrix represent the direct influence relationship between nodes, that is, the causal strength matrix, and the value of the element represents the strength of the influence relationship. In order to obtain a clear causal diagram, it is usually necessary to Perform thresholding, that is, set a threshold, set elements with absolute values ​​less than the threshold to 0, and retain elements greater than or equal to the threshold:

[0069]

[0070] The thresholded adjacency matrix (causal strength matrix) Converted to a directed graph (directed edges represent causal relationships), the non-zero elements in the matrix Indicates the causal relationship from node i to node j. And using graph visualization tools (such as Graphviz), the adjacency matrix can be converted into a graphical causal graph to clarify the causal relationship between argument roles, trigger words, and event types, and analyze the influence chain between elements in the event.

[0071] The above has been referenced Figure 2 The steps of constructing a causal graph of the present application are described, but it can be understood that the present application can also use other methods to construct a causal graph, as long as the causal graph can reflect the causal relationship between event arguments.

[0072] S103: Perform model training in combination with the causal graph to obtain a trained model. Since the concept of the strength of causality is similar to the attention weight in the attention mechanism in deep learning, the attention weight reflects the correlation between the input data and the specific task and can explain the most critical features for prediction, external causal knowledge (in this application, the causal graph) can be introduced by designing an attention network, a self-attention network, etc.

[0073] Specifically, by adding specific causal constraints during the model training process, the attention mechanism can focus more on words or phrases with causal relationships in the sentence. For example, when building the self-attention layer, a causal graph can be pre-defined, which identifies the potential causal relationships in the text based on domain knowledge or the results of automatic recognition by the pre-trained model. When the model calculates the attention weight, it will refer to this causal graph and give higher weights to causally related words, so that the model can 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, it eventually led to the occurrence of lung cancer". In this example, there is a clear causal relationship between "long-term smoking" and "causing lung cancer". Through the designed attention network or self-attention network, the model can more accurately identify and extract these two key events and their causal relationships, thereby improving the performance of the event extraction task. This method not only helps to improve the interpretability of the model, but also plays an important role in application scenarios such as disease diagnosis and risk assessment.

[0074] In another example, in the 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", "company acquisitions", etc. First, the text can be encoded through a pre-trained language model (such as BERT) to obtain the vector representation of each word. Then, a self-attention layer is built on the basis of these word vectors, which allows each word vector to not only focus on itself, but also adjust its own representation according to other word vectors in the context. This mechanism helps the model understand the relationship between words. Next, in order to introduce causal relationships, a causal graph module can be added after the self-attention layer. This module uses known domain knowledge or causal relationships learned from data to guide the allocation of attention weights. For example, in an event, the trigger word, argument role, and event type affect each other, and the three do not exist independently. Therefore, the causal knowledge of argument role-event type, argument role-argument role, and trigger word-argument role can be used as the prior causal knowledge of the event argument recognition model. By introducing the self-attention network layer in the model and using prior causal knowledge to guide the attention network learning process, the transparency of the model reasoning process can be improved, thereby improving the interpretability of the model. --In this way, the designed attention network and self-attention network can effectively combine causal reasoning and enhance the model's understanding and prediction capabilities in complex scenarios.

[0075] Several methods of combining causal graphs are described above, but it is understandable that other methods of combining causal graphs may also be used, and it is only necessary to combine the prior knowledge of the causal graph into the training model.

[0076] S104: Input the test data into the trained model to obtain the prediction results and attention weights; in the event extraction task, when we input the test data into the trained model, the model will not only output the prediction results for each candidate event type, but also generate corresponding attention weights, which reflect the degree of attention paid by the model to different parts of the input sequence when making predictions. For example, assuming that the financial news text is being processed, the purpose is to extract the specific event of "corporate mergers and acquisitions" from it. After receiving a news report containing multiple sentences, the model will calculate the relevance score of each word in the text with the target event through an internal mechanism, and assign attention weights accordingly. Ultimately, the model will determine the key information in the text that is most likely to represent the "corporate mergers and acquisitions" event based on these weights and pre-trained parameters, and give prediction results, such as confirming the existence of such events and the subject of their occurrence. At the same time, by analyzing the distribution of attention weights, we can further understand the model decision-making process, optimize model performance or adjust input features to improve the accuracy and reliability of event extraction.

[0077] S105: Visualize the attention weight vector to obtain a directed graph. During the model prediction process, the attention weights generated by the attention layer are different from the causal strength matrix in dimension and cannot be directly compared. Therefore, in this application, the attention weight vector is visualized (using a graphics library such as Matplotlib and Seaborn), and the prediction results are combined to analyze how the model processes different parts of the input to perform reasoning to obtain the final answer. The explanation result is a relationship diagram between trigger words, argument roles, and event types, which is explained in the form of a directed graph to achieve model interpretability.

[0078] S106: Compare the similarity between the directed graph and the causal graph to determine the interpretability. Specifically, in one embodiment, a structural similarity measurement method can be used to determine the similarity, which mainly focuses on the connection method between the nodes in the two graphs. By comparing the direction and existence of the edges in the directed graph and the causal graph, algorithms such as the Jaccard index, edit distance, or graph isomorphism can be used to quantify the structural similarity of the two graphs. For example, if the direct causal relationship between most nodes in the two graphs is in the same direction, they are considered to have a high structural similarity.

[0079] In another embodiment, path consistency analysis can be used to determine the similarity, which focuses on the consistency of all possible paths from one node to another in the graph. In a causal graph, a path represents a causal link that may exist between variables. By comparing whether there is a path from the same starting point to the end point in the two graphs and whether the direction is consistent, the consistency level of these graphs in expressing causal relationships can be evaluated. If two graphs can reveal the same causal path, it means that they are highly consistent in expressing causal logic.

[0080] In another embodiment, a conditional independence test method can be used, which uses statistical methods to test the matching degree of conditional independence between variables represented by different graphs. For a given set of variables, certain variable combinations may show different conditional independence properties under different graph structures. By performing chi-square tests, mutual information tests or other correlation analyses, it can be determined whether the two graphs have similar abilities to predict the dependency between variables for the same data set. If both graphs can accurately reflect the conditional independence between variables in the data, it indicates that they are similar in nature in capturing causal relationships.

[0081] It should be understood that other methods can also be used to compare the similarities between the directed graph and the causal graph to determine the interpretability.

[0082] This method applies the results of data interpretability to model design. At the same time, the correctness of the model interpretability results is judged based on the results obtained by data interpretability, achieving mutual verification of model interpretability and data interpretability. Finally, a complete interpretability evaluation method for the event extraction model processing flow from data to model and then to data is constructed.

[0083] Next, the interpretability evaluation method of this application is described by taking the event detection model and the event argument recognition model as examples.

[0084] For the event detection model, a complete event causal graph is constructed on the training set of the event data set through the causal discovery method. According to the characteristics of the event detection task, the causal relationship between the trigger words and the event type is extracted as the causal graph, which is used as the prior knowledge of the event detection task. Trigger words refer to those words that can indicate or imply the occurrence of a specific event. They are often associated with specific event types and help to classify events into different categories. Therefore, the causal relationship between the trigger words and the event type (trigger word-event type) can be used as the prior causal knowledge of the event detection model. By introducing the attention network layer in the event detection model, the prior causal knowledge is used to guide the attention network learning process and improve the interpretability of the model.

[0085] For each sample in the test set, the model will output the predicted trigger word position and event type information, output the attention weight generated by the attention layer, and combine it with the prediction results (only perform interpretability analysis on samples with correct trigger word recognition) to determine whether the part of the input that is most relevant to the prediction is the location of the trigger word. If it is the location of the trigger word, it is consistent with prior knowledge. During the prediction process of this sample, the model reasoned according to the logic of prior knowledge, and this sample is interpretable. If it is inconsistent with prior knowledge, it means that when predicting this sample, the model did not follow the logic of prior knowledge to pay attention to the trigger word most relevant to the event type, and this sample is uninterpretable.

[0086] The number of explainable and unexplainable samples is counted, and the proportion of explainable samples to all test data is calculated. It is defined as IED (Interpretable Event Detection) to evaluate whether the event detection model is explainable in the prediction process.

[0087] Take the following event in ACE2005 as an example:

[0088]

[0089] The actual event type of this event is "Movement.Transport", and the trigger word is "arrived". The attention weight vector output generated by the attention layer during the prediction of this sample is visualized and analyzed. It is found that the part with significant attention weight values ​​in the sentence input is the location of the trigger word. The specific results are as follows: Figure 3 shown.

[0090] Finally, through statistics, it was found that the IED value on the MNEE dataset was 76.3%, and the IED value on the ACE dataset was 66.3%, which proves that the event detection method proposed in this application that integrates causal knowledge and attention mechanism, while pursuing event detection performance, introduces causal knowledge as prior knowledge into the model and combines it with the attention mechanism, effectively guiding the model to reason according to the envisioned reasoning logic, and the prediction process has good interpretability.

[0091] Next, refer to Figure 4 and Figure 5 , describing an interpretable evaluation method for event argument recognition models.

[0092] S401: Obtain a sample causal graph, extract the trigger word-argument role, argument role-argument role causal knowledge in the complete event causal graph as the prior knowledge of the argument role recognition model. , the sample causal graph of the sample can be extracted .

[0093] S402: Obtaining a prediction relationship diagram In an event, the trigger word, argument role and event type influence each other, and the three do not exist independently. Therefore, the causal knowledge of argument role-event type, argument role-argument role and trigger word-argument role can be used as the prior causal knowledge of the event argument recognition model. By introducing the self-attention network layer in the model, the prior causal knowledge is used to guide the attention network learning process and improve the interpretability of the model.

[0094] Specifically, refer to Figure 5 , for the event argument recognition model, obtaining the prediction relationship graph includes:

[0095] S501: For each query sample, ask questions about each argument role to obtain the argument role The answer; Since the main idea of ​​the causal-self-attention argument role recognition model is to ask questions to each argument role according to the template defined by the event type through the question-answering method, and obtain the answer to the argument role, so for the samples in the test set When input into the model, the model will generate m query samples according to the number of argument roles m defined by its event type, and each sample corresponds to an argument role .

[0096] S502: For each query sample, restore the self-attention matrix generated by the self-attention layer into a directed graph ; For each query sample, the model generates a span of predicted answers. This application combines the self-attention matrix output generated by the self-attention layer with the predicted answer (only considering samples with correct trigger word predictions) to restore the self-attention weight matrix into a directed graph , indicating that in predicting the role of the argument We also pay attention to which parts of the sentence input and how these parts are related to How do they interact with each other?

[0097] S503: Argument roles Perform self-attention matrix visualization operations separately to obtain a directed graph , these local directed graphs are integrated into a complete directed graph to form a prediction sample Prediction diagram of , that is, the explanation result given by the model when performing argument recognition on this sample.

[0098] S403: Comparison chart With Figure The similarity of the two graphs is used to analyze the correctness of the interpretation results. Since the graph is relatively sparse, complex indicators such as Hamming distance are not used. Only the sample causal graph is counted. The number of all existing edges in is the number of edges that should be found in theory. , If the edge in the graph exists , then it is considered that an edge is correctly discovered, that is, the correctly discovered edge For all test set samples, the number of correctly discovered edges and edges that should be discovered is counted, and the indicator IEE (Interpretable Event Extraction) is defined to evaluate the correctness of the reasoning logic relied on by the event extraction model proposed in this paper during the prediction process, that is, the degree of interpretability. The definition formula is as follows:

[0099]

[0100] Still take the following event in ACE2005 as an example:

[0101]

[0102] For the actual annotation results of this instance event, the event type of the event is "Movement.Transport", the trigger word is "arrived", and according to the definition of events in ACE2005, the argument roles included are: Artifact ("Kelly"), Destination ("Seoul"), Origin ("Beijing"). Based on the trigger words, argument roles and other information that appear in this instance, this paper can obtain a sample causal graph, and the results are as follows: Figure 6 shown.

[0103] For the prediction results of this example, there is a corresponding argument role question template for each argument role. When the model outputs the predicted argument results, it also outputs an attention weight matrix. By visually analyzing each matrix, a relationship diagram between predicted argument roles can be obtained. The following are detailed steps on how to obtain the prediction relationship diagram based on the prediction results:

[0104] For the prediction of the argument role Artifact, the attention weight matrix related to the prediction process is output and visualized. It is found that the attention weight value between "arrived" (corresponding to the trigger word) and "Kelly" (corresponding to the argument role Artifact) is significant, and a local relationship graph can be obtained, with the pointing relationship being Artifact pointing to the trigger word.

[0105] 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 value between "arrived" (corresponding to the trigger word) and "Seoul" (corresponding to the argument role Destination) is significant. A local relationship graph can be obtained, and the pointing relationship is Destination pointing to the trigger word.

[0106] For predicting the argument role Origin, we output the attention weight matrix related to the prediction process and perform visualization operations. 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 get a local relationship graph, with the pointing relationship being Origin pointing to the trigger word.

[0107] The local relationship graph restored based on the attention weight matrix generated in the process of predicting different argument roles is integrated to reconstruct the prediction relationship graph. The prediction relationship graph of the sample obtained in the end is consistent with the sample causal relationship graph. Figure 1 It can be considered that the model's argument identification process for this sample is consistent with prior causal knowledge, its interpretable results are correct, and the model's reasoning process is an interpretable process.

[0108] Finally, through statistics, it was found that the IEE value on the MNEE dataset was 80.1%, and the IEE value on the ACE dataset was 86.44%, proving that the event argument recognition model that integrates causal knowledge and self-attention mechanism proposed in this application, while pursuing argument extraction performance, can effectively guide the model to make predictions according to the considered correct logic in the process of extracting argument roles by guiding the self-attention mechanism with causal knowledge to learn how argument roles and trigger words interact with each other.

[0109] The interpretability evaluation method of the present application combining causal knowledge and attention has been described above with reference to the accompanying drawings. Next, Figure 7 , describing the interpretability evaluation device combining causal knowledge and attention of the present application, the device comprising:

[0110] The data partitioning device is used to partition the data set into a training set and a test set; Figure 7 As shown, the original data is divided into training data and test data, and the training data is used to obtain the causal graph (see Figure 7 The left part of the figure), while the test data is used as input to the prediction model to make predictions (see Figure 7 upper middle part).

[0111] The causal graph construction device constructs a causal graph of event data on the 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. The specific construction method has been referred to Figure 2 The description has been given and will not be repeated here.

[0112] The model building device performs model training in combination with the causal graph to obtain a trained model, and inputs the test data into the trained model to obtain a prediction result and an attention weight; this part can refer to the self-attention mechanism to obtain a trained model (corresponding to Figure 7 The corresponding part in the solid line box).

[0113] Directed graph acquisition device, which visualizes the attention weight vector to obtain a directed graph (corresponding to Figure 7 the portion in the dotted box on the right side of the figure); and

[0114] Comparison device, compares the similarity between the directed graph and the causal graph to determine the interpretability (corresponding to Figure 7 the lowermost part of the image).

[0115] Since the functions of the various parts of the interpretability assessment device combining causal knowledge and attention have been described above with reference to the accompanying drawings, they will not be repeated here.

[0116] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. An interpretability evaluation method combining causal knowledge and attention, characterized in that: include: Divide the dataset into training and testing sets; Construct a causal graph of event data on the training set to obtain a causal strength matrix between event arguments; Performing model training in combination with the causal graph to obtain a trained model; Feed the test data into the trained model to obtain predictions and attention weights. Visualize the attention weight vector to obtain a directed graph; as well as Compare the similarities between directed graphs and causal graphs to determine interpretability.

2. The interpretability evaluation method according to claim 1, characterized in that: The model is an event detection model, and the causal relationship between trigger words and event types is used as a causal graph.

3. The interpretability evaluation method according to claim 2, characterized in that: The method includes determining whether the predicted part is where the trigger word is located. If it is where the trigger word is located, the sample is explainable; if it is not where the trigger word is located, the sample is not explainable. The proportion of explainable samples to all test data is statistically analyzed to evaluate the explainability of the event detection model in the prediction process.

4. The interpretability evaluation method according to claim 1, characterized in that: The model is an event argument recognition model, and the visualizing the attention weight vector to obtain a directed graph includes: For each query sample, ask each argument role to obtain the argument role 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 Argument Role Perform self-attention matrix visualization operations separately to obtain a directed graph , these local directed graphs are integrated into a complete directed graph to form the prediction relationship graph of the prediction sample .

5. The interpretability evaluation method according to claim 4, characterized in that: Compare the similarities between the directed graph and the causal graph to determine the interpretability, including: Get Get a sample cause-effect diagram ;as well as Comparison chart With Figure Similarities include: Statistical Sample Cause and Effect Diagram The number of all existing edges in is the number of edges that should be found in theory. ; statistics The edges in the graph exist The number of correctly discovered edges ;as well as The degree of interpretability is determined by the following formula: .

6. The interpretability evaluation method according to any one of claims 1 to 5, characterized in that: Construct a causal graph of 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; Calculating the covariance matrix S of the feature matrix X to express the correlation between different feature data; and Minimize the loss function to obtain the causal graph of the event text, where the loss function is the difference between the covariance matrix S and the predicted covariance matrix under a given causal graph structure, expressed as follows: ; where Θ is the causal strength matrix of the causal graph, is the predicted covariance matrix under a given graph structure Θ, is the Frobenius norm, Represents the loss function of the causal graph.

7. The interpretability evaluation method according to claim 6, characterized in that: The method also includes obtaining an optimized causal strength matrix by the following formula : ; in, is the L1 regularization term to ensure the sparsity of the graph, λ is the regularization parameter, which is a hyperparameter learned by the model during training. is the L1 norm of the adjacency matrix.

8. The interpretability evaluation method according to claim 7, characterized in that: The method also includes the following method to optimize the causal strength matrix Perform thresholding: Set a threshold value and transform the causal strength matrix The elements whose absolute values ​​are less than the threshold are set to 0, and the elements whose absolute values ​​are greater than or equal to the threshold are retained.

9. The interpretability evaluation method according to claim 1, characterized in that: Comparing the similarity between the directed graph and the causal graph to determine the interpretability includes using one of the following methods to determine the similarity between the directed graph and the causal graph: a structural similarity measurement method, a path consistency analysis method, or a conditional independence test method.

10. An interpretability evaluation device combining causal knowledge and attention, characterized in that: include: A data partitioning device, used for partitioning a data set 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; A model building device, which performs model training in combination with the causal graph to obtain a trained model, and inputs test data into the trained model to obtain a prediction result and an attention weight; A directed graph acquisition device visualizes the attention weight vector to obtain a directed graph; as well as The comparison device compares the similarity between the directed graph and the causal graph to determine the interpretability.

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

  • Large-scale customized quality prediction method based on heterogeneous causal graph attention network

    CN119090351A

Cited By

  • High-temperature furnace intelligent control system and method based on machine learning

    CN121386413A

  • Chemical process flow analog simulation method and system based on big data

    CN121683240A

  • A chemical process flow simulation method and system based on big data

    CN121683240B

  • Artificial intelligence diagnosis auxiliary method and device based on medical image, equipment and medium

    CN121747903A