Event detection model explanation method and device, electronic equipment and storage medium
By modeling the relevance, sparsity, and support of the hidden layer representation of the event detection model, the hidden layer representation is optimized, which solves the problem of ignoring event structure information in existing methods and realizes the efficient interpretability and understanding of the decision-making process of the event detection model.
Patent Information
- Application Number
- CN202310705109.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-06-14
AI Technical Summary
Existing event detection model interpretation methods ignore the structural information of the event itself, resulting in low interpretability.
By extracting the hidden layer representation of the statement to be detected, relevance modeling, sparsity modeling, and support modeling are performed to optimize the hidden layer representation and obtain the event trigger words or event arguments that are most relevant to the event structure information.
It enhances the interpretability of the event detection model, helping to understand the model's decision-making process.
Smart Images

Figure CN116862002B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, and in particular to an event detection model explanation method and device, electronic equipment and storage medium. BACKGROUND
[0002] Event detection refers to extracting events with a specific event type from pure text, and is a key research problem in the field of information extraction.
[0003] In recent years, with the emergence of more and more event detection datasets, deep learning-based methods have achieved very significant performance on the event detection task. However, due to the non-transparent internal working mechanism of neural network models, it seriously hinders their application in specific scenarios. Therefore, the explainability research based on neural networks has attracted more and more attention.
[0004] Explainability methods can be divided into ante-hoc and post-hoc. Ante-hoc refers to making the model itself interpretable by designing the model architecture. Post-hoc refers to explaining the behavior and decision-making process of a trained model.
[0005] Compared with ante-hoc methods, post-hoc methods have two independent processes of prediction and explanation, so they will not reduce the model prediction performance. Post-hoc can be divided into global interpretability and local interpretability. Among them, global interpretability refers to understanding the overall decision logic of the model by explaining each unit of the model.
[0006] At present, the prior art proposes some model explanation methods to explain models for different natural language processing (NLP) tasks, such as text classification, machine reading comprehension, and machine translation, etc. However, these methods have the following problems:
[0007] Firstly, the existing model explanation methods pay less attention to the explainability of event detection task models.
[0008] Secondly, the existing model explanation methods mainly identify and calculate the importance of words or phrases in the text to the model prediction as the basis for explainability. On the one hand, this approach ignores the structural information of the event itself; on the other hand, for the event detection task, it is still difficult to reflect the model decision-making process by identifying only the words or phrases in the text.
[0009] Therefore, how to solve the problem that the existing event detection model explanation method ignores the structural information of the event itself, resulting in low explainability of the event detection model, is an important topic in the field of machine learning technology that needs to be solved. SUMMARY
[0010] The application provides an event detection model explanation method, device, electronic equipment and storage medium, which overcomes the defect that the existing event detection model explanation method ignores the structural information of the event itself, resulting in low explainability of the event detection model, and effectively improves the explainability of the event detection model.
[0011] In one aspect, the application provides an event detection model explanation method, comprising: extracting a hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model; optimizing the hidden layer representation to be explained to obtain an optimized hidden layer representation; and obtaining target event structure information according to the optimized hidden layer representation and a given set of event structure information, wherein the target event structure information is an event trigger word or an event argument most relevant to the optimized hidden layer representation.
[0012] Further, the optimization of the hidden layer representation to be explained to obtain the optimized hidden layer representation comprises: correlation modeling of the hidden layer representation to obtain a first optimized hidden layer representation; sparsity modeling of the first optimized hidden layer representation to obtain a second optimized hidden layer representation; and support modeling of the second optimized hidden layer representation to obtain the optimized hidden layer representation.
[0013] Further, the correlation modeling of the hidden layer representation to obtain the first optimized hidden layer representation comprises: clustering processing of hidden layer neurons corresponding to the hidden layer representation to obtain a plurality of hidden layer neuron groups; calculating a contribution value of each hidden layer neuron in each hidden layer neuron group to the hidden layer neuron group by using an intersection over union function; calculating a corresponding correlation loss based on the hidden layer neuron group and the contribution value; and optimizing the hidden layer representation according to the correlation loss to obtain the first optimized hidden layer representation.
[0014] Further, the sparsity modeling of the first optimized hidden layer representation to obtain the second optimized hidden layer representation comprises: calculating a sparsity loss corresponding to the first optimized hidden layer representation; and optimizing the first optimized hidden layer representation according to the sparsity loss to obtain the second optimized hidden layer representation.
[0015] Further, the support modeling of the second optimized hidden layer representation to obtain the optimized hidden layer representation comprises: calculating a support loss corresponding to the second optimized hidden layer representation; and optimizing the second optimized hidden layer representation according to the support loss to obtain the optimized hidden layer representation.
[0016] Further, the calculation formula of the correlation loss is as follows:
[0017]
[0018]
[0019] wherein, is the correlation loss, L is the number of groups of hidden layer neurons, l is the number of the current group of hidden layer neurons, G l is the lth group of hidden layer neurons, is the contribution value of the i th hidden layer neuron in the l th group of hidden layer neurons to the group of hidden layer neurons, and E is the set of event structure information.
[0020] Further, the calculation formula of the support loss is as follows:
[0021]
[0022] s.t.KL(g(h(s)),g(h'(ε)))
[0023] wherein, is the support loss, is the loss function, y is the true label, θ is the learnable parameter, KL(·) is the KL divergence, h'(ε) is the second optimized hidden layer representation, g(·) and h(·) are the intermediate process functions of the event detection model.
[0024] In a second aspect, the present application further provides an event detection model explanation device, comprising: a hidden layer representation extraction module, configured to extract a hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model; a hidden layer representation optimization module, configured to optimize the hidden layer representation to be explained to obtain an optimized hidden layer representation; and a target event structure information acquisition module, configured to acquire target event structure information according to the optimized hidden layer representation and a given set of event structure information, wherein the target event structure information is an event trigger or an event argument that is most relevant to the optimized hidden layer representation.
[0025] In a third aspect, the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the event detection model explanation method according to any one of the above aspects when executing the program.
[0026] In a fourth aspect, the present application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the event detection model explanation method according to any one of the above aspects.
[0027] The application provides an event detection model explanation method, which extracts hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model, optimizes the hidden layer representation to be explained, obtains optimized hidden layer representation, and then acquires target event structure information according to the optimized hidden layer representation and a given event structure information set, the target event structure information being an event trigger word or an event argument most relevant to the optimized hidden layer representation. The method integrates event structure information into the explanation process of the event detection model naturally, overcomes the defect that the existing event detection model explanation method has low explainability of the event detection model due to the ignorance of the structure information of the event itself, effectively improves the explainability of the event detection model, and helps to understand the decision-making process of the event detection model. BRIEF DESCRIPTION OF DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0029] Figure 1 The flowchart of the event detection model explanation method provided by the application is shown in the figure.
[0030] Figure 2 The overall flowchart of the event detection model explanation method provided by the application is shown in the figure.
[0031] Figure 3 The structural diagram of the event detection model explanation device provided by the application is shown in the figure.
[0032] Figure 4 The structural diagram of the electronic device provided by the application is shown in the figure. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the application clearer, the technical solutions in the application will be described clearly and completely in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0034] It should be noted that the prior art proposes some model explanation methods to explain models for different natural language processing (NLP) tasks, such as text classification, machine reading comprehension and machine translation.
[0035] However, these methods have some problems, first, the existing model explanation method pays less attention to the explainability of the event detection task model.
[0036] Secondly, the existing model explanation method mainly identifies and calculates the importance of words or phrases in the text to the model prediction as the basis for explainability. On the one hand, this way ignores the structural information of the event itself; on the other hand, for the event detection task, it is still difficult to reflect the model decision process by identifying only the words or phrases in the text.
[0037] In view of this, the present application provides an event detection model explanation method, specifically, Figure 1 The flowchart of the event detection model explanation method provided by the present application is shown.
[0038] As Figure 1 shown, the method comprises:
[0039] S110, extracting the hidden layer representation to be explained based on the to-be-detected sentence and the pre-trained event detection model.
[0040] The to-be-detected sentence is a pure text sentence, and the to-be-detected sentence corresponds to an event trigger word, an event argument and an event type.
[0041] Event detection refers to extracting an event with a specific event type from a pure text, and the event has perfect structural information. An event is usually composed of an event trigger word and multiple event arguments.
[0042] For example, in the sentence "the train driver was hit in the head by the gangster", "hit" is the event trigger word, and "train driver", "gangster" and "head" are the event arguments. The event detection model needs to identify "hit" as the trigger word of the "physical injury" event.
[0043] The event detection model based on neural network takes the to-be-detected sentence as the model input and the event type corresponding to the to-be-detected sentence as the model output.
[0044] It can be understood that the to-be-detected sentence is input into the pre-trained event detection model, and the event detection model extracts features from the to-be-detected sentence to obtain the corresponding event type.
[0045] In one embodiment, f=g(h(s)) is an event detection model based on neural network that has been trained, and the to-be-detected sentence s is input into the pre-trained event detection model f to obtain the corresponding event type.
[0046] Wherein, g(·) and h(·) are two intermediate process functions of f. It is assumed that the event detection model f=g(h(s)) can be decomposed into two stages:
[0047] 1) using h(·) to map the input sentence to be detected s into a hidden layer representation h(s) = {h1(s), h2(s), …, h k (s), …, h |s| (s)}, each hidden state of the hidden layer can be regarded as a neuron representation, h k (s) is the kth neuron representation of the layer;
[0048] 2) using g(·) to map the hidden layer representation h(s) to the output probability g(h(s)), each dimension of g(h(s)) represents the probability of predicting the sentence to be detected s as the corresponding event type.
[0049] The event detection model includes an input layer, an output layer, and a plurality of intermediate hidden layers. In the process of processing the sentence to be detected by the event detection model, each intermediate hidden layer has a hidden layer representation corresponding to the sentence to be detected. Any hidden layer representation (a feature vector) corresponding to an intermediate hidden layer is extracted to detect the decision-making process of the event detection model and explain the overall decision-making logic of the event detection model.
[0050] It should be noted that in this embodiment, the hidden layer representation to be explained is extracted, which can be a hidden layer representation corresponding to any intermediate hidden layer in the event detection model.
[0051] Generally, a neural network model learns a large amount of words, syntax, position, and semantic information, and stores these information in model parameters. The bottom layer of the model usually encodes some shallow information such as words, syntax, and position, and the high layer of the model learns some semantic and abstract information related to the target task decision.
[0052] Therefore, preferably, in a specific embodiment, for a sentence to be detected and a neural network-based event detection model that has been trained, the hidden layer h(s) closest to the output layer is extracted to detect the decision-making process of the event detection model.
[0053] It should be further noted that in this embodiment, the event detection model includes an input layer, an output layer, and an intermediate hidden layer, and the network layer type and the number of network layers of the model can be set according to actual conditions, which are not specifically limited here.
[0054] In S120, the hidden layer representation to be explained is optimized to obtain an optimized hidden layer representation.
[0055] It can be understood that based on the extraction of the hidden layer representation to be explained in step S110 based on the sentence to be detected and the pre-trained event detection model, the hidden layer representation to be explained is further optimized to obtain a corresponding optimized hidden layer representation.
[0056] The hidden layer representation to be explained can be optimized, specifically, the correlation modeling and sparsity modeling can be designed to optimize the hidden layer representation, and further, the support modeling is utilized to ensure the explainability detection without sacrificing the performance of the event detection model, and finally, the optimized hidden layer representation is obtained, i.e., the optimized hidden layer representation.
[0057] It should be noted that the hidden layer representation to be explained can contain a large amount of redundant information and irrelevant features, which do not affect the decision-making process of the model, and thus the hidden layer representation to be explained needs to be optimized, for example, the neuron features irrelevant to the model decision can be automatically filtered out through the correlation modeling and sparsity modeling, so that the model can focus on important hidden layer features, and effectively capture the target event structure information, so that the hidden layer representation can be better mapped to the event structure information, and thus the explainability of the event detection model is improved.
[0058] In S130, the target event structure information is obtained according to the optimized hidden layer representation and the given set of event structure information.
[0059] It can be understood that, on the basis of optimizing the hidden layer representation to be explained in step S120 to obtain the optimized hidden layer representation, further, according to the optimized hidden layer representation and the pre-given set of event structure information, the event trigger word or event argument most relevant to the optimized hidden layer representation, i.e., the target event structure information, can be obtained.
[0060] Specifically, each intermediate hidden layer corresponds to a plurality of hidden layer neurons, and the correlation between each hidden layer neuron in the intermediate hidden layer and the set of event structure information is calculated according to the optimized hidden layer representation and the pre-given set of event structure information, and then the event trigger word or event argument with the highest correlation score can be obtained, so that the target event structure information playing an important role in the decision-making process of the event detection model is obtained, so as to achieve the purpose of understanding the decision-making process of the event detection model.
[0061] The set of event structure information includes event trigger words and event arguments corresponding to different sentences to be detected.
[0062] In detail, an event detection data set D, s={w1,w2,…,w |s|} is pre-given, where s is a sentence in D, and the sentence s is usually labeled with all event trigger words, event types, and sets of event arguments corresponding to each event. Wherein, w is a word in the sentence s, and |s| represents the number of words in the sentence s.
[0063] The set of event structure information E={e1,e2,…,e |E|} is a set of all event triggers and event arguments in the sentence s, e2 is the second event trigger or event argument, and |E| is the number of all event triggers and event arguments in the sentence s.
[0064] In the embodiment, the hidden layer representation to be explained is extracted based on the sentence to be detected and the pre-trained event detection model, and the hidden layer representation to be explained is optimized to obtain an optimized hidden layer representation. Then, the target event structure information is obtained according to the optimized hidden layer representation and the given set of event structure information. The target event structure information is the event trigger or event argument most relevant to the optimized hidden layer representation. The method overcomes the defect that the existing event detection model explanation method has low explainability of the event detection model due to the ignorance of the structural information possessed by the event itself, by naturally integrating the event structure information into the explanation process of the event detection model, effectively improves the explainability of the event detection model, and helps to understand the decision-making process of the event detection model.
[0065] On the basis of the above embodiment, further, the hidden layer representation to be explained is optimized to obtain an optimized hidden layer representation, including: performing relevance modeling on the hidden layer representation to obtain a first optimized hidden layer representation; performing sparsity modeling on the first optimized hidden layer representation to obtain a second optimized hidden layer representation; and performing support modeling on the second optimized hidden layer representation to obtain the optimized hidden layer representation.
[0066] It can be understood that after the hidden layer representation to be explained is extracted based on the sentence to be detected and the pre-trained event detection model, the hidden layer representation to be explained is optimized to obtain an optimized hidden layer representation.
[0067] In the embodiment, the optimization of the hidden layer representation to be explained mainly includes three stages of optimization, that is, the hidden layer representation to be explained is optimized by three learning strategies of relevance modeling, sparsity modeling and support modeling.
[0068] It should be noted that there is no strict logical relationship between the relevance modeling and the sparsity modeling, that is, the relevance modeling can be performed first and then the sparsity modeling, or the sparsity modeling can be performed first and then the relevance modeling, or the sparsity modeling and the relevance modeling can be performed simultaneously, which is not limited here.
[0069] In a specific embodiment, the extracted hidden layer representation is modeled for relevance to obtain a first optimized hidden layer representation. Specifically, the hidden layer neurons corresponding to the hidden layer representation are clustered to obtain a plurality of hidden layer neuron groups. The contribution value of each hidden layer neuron in each hidden layer neuron group to the hidden layer neuron group is calculated by using an intersection over union function. The corresponding relevance loss is calculated based on the hidden layer neuron group and the contribution value. The hidden layer representation is optimized according to the relevance loss to obtain the first optimized hidden layer representation.
[0070] Understandably, after extracting the hidden layer representation h(s) to be interpreted from the event detection model, h(s) needs to be optimized. Specifically, this embodiment designs a correlation objective function, which models the event structure information by aggregating related neurons.
[0071] First, the hidden layer neurons corresponding to the hidden layer representation are clustered to obtain multiple hidden layer neuron groups, each of which represents a related event structure information.
[0072] It should be noted that existing technologies attempt to aggregate neighboring features to enhance target features, such as giving better scores to overlapping parts of an image or enhancing the current word with neighboring words. However, since event arguments may be distributed in different and non-adjacent positions in the input text, this method is not suitable for event detection tasks.
[0073] In this specific embodiment, the K-means algorithm is used to cluster the hidden layer neurons corresponding to the hidden layer representation. The clustering process is as follows:
[0074] G = K - means({h k (s)})
[0075] Where G∈{G1,G2,…,G l ,…,G L} represents the set of hidden layer neurons obtained by clustering, G l It is the l-th hidden layer neuron group, and L is the number of hidden layer neuron groups.
[0076] Secondly, after obtaining multiple hidden layer neuron groups, for a single hidden layer neuron group G... l The Intersection over Union (IoU) function is used to calculate the value of each hidden neuron in each hidden layer neuron group. The contribution value of this group is calculated using the following formula:
[0077]
[0078] in, Let E be the contribution of the i-th hidden neuron in the l-th hidden neuron group to that hidden neuron group, and let E be the set of event structure information. It is the i-th hidden neuron in the l-th hidden neuron group.
[0079] Next, based on the pre-defined groups of hidden neurons and the calculated contribution values, the corresponding correlation loss is calculated by minimizing the distance between each hidden neuron in each hidden neuron group and the event structure information set.
[0080] The calculation formula of the correlation loss is as follows:
[0081]
[0082] wherein, is the correlation loss, L is the number of groups of hidden layer neurons, l is the number of the current group of hidden layer neurons, G l is the lth group of hidden layer neurons, is the contribution value of the i th hidden layer neuron in the l th group of hidden layer neurons to the group of hidden layer neurons.
[0083] According to the above correlation loss, the hidden layer representation can be preliminarily optimized to obtain a first optimized hidden layer representation.
[0084] Based on the above, considering that not all hidden layer neurons play a role in the process of predicting the event type by the event detection model, therefore, the embodiment designs a sparsity modeling module to measure the importance of the hidden layer neurons.
[0085] In another specific embodiment, the first optimized hidden layer representation is subjected to sparsity modeling to obtain a second optimized hidden layer representation. Specifically, a sparsity loss corresponding to the first optimized hidden layer representation is calculated; and the first optimized hidden layer representation is optimized according to the sparsity loss to obtain the second optimized hidden layer representation.
[0086] It can be understood that the useless hidden layer neuron features are filtered out by using the differentiable mask mechanism, and for each hidden layer neuron, a classifier with an activation function is used to determine whether the hidden layer neuron should be shielded. In detail, the sparsity loss corresponding to the first optimized hidden layer representation is calculated, and the calculation formula of the sparsity loss is as follows:
[0087]
[0088] wherein, is the sparsity loss, is the classifier of the hidden layer neuron, h k (s) is the k th hidden layer neuron.
[0089] According to the above sparsity loss, the first optimized hidden layer representation can be optimized to obtain the second optimized hidden layer representation.
[0090] It should be noted that for the interpretable event detection model, the result of the model detection directly depends on the selected hidden layer features. The embodiment extracts the hidden layer representation closest to the output layer to explain the decision-making process of the event detection model, the aforementioned correlation modeling aims to learn the correlation between the hidden layer neurons and the event structure information, and the aforementioned sparsity modeling aims to select the important hidden layer neuron features. By performing correlation modeling and sparsity modeling on the hidden layer representation to be explained, a second optimized hidden layer representation ε can be obtained.
[0091] Considering that the correlation modeling and sparsity modeling processes can reduce the model performance of the event detection model, the embodiment further designs a support modeling module to ensure that the correlation modeling and sparsity modeling do not reduce the prediction performance of the event detection model.
[0092] In yet another specific embodiment, support modeling is performed on the second optimized hidden layer representation to obtain an optimized hidden layer representation. Specifically, a support loss corresponding to the second optimized hidden layer representation is calculated; and the second optimized hidden layer representation is optimized according to the support loss to obtain the optimized hidden layer representation.
[0093] It can be understood that for the hidden layer representation after correlation modeling and sparsity modeling, i.e., the second optimized hidden layer representation, the second optimized hidden layer representation ε is mapped to a new hidden state h'(ε) by using an intermediate process function h'(·), and the new hidden state h'(ε) is converted into a new model output g(h'(ε)) by using an intermediate process function g(·).
[0094] In detail, the support modeling can be performed by calculating a support loss corresponding to the second optimized hidden layer representation.
[0095] The calculation formula of the support loss is as follows:
[0096]
[0097] s.t.KL(g(h(s)),g(h'(ε)))
[0098] wherein, is the support loss, is a loss function, y is a true label, θ is a learnable parameter, KL(·) is a KL divergence, h'(ε) is the second optimized hidden layer representation, g(·) and h(·) are intermediate process functions of the event detection model.
[0099] According to the above support loss, the second optimized hidden layer representation can be optimized to obtain an optimized hidden layer representation.
[0100] It should be noted that h'(·) can be any network architecture, for example, can be LSTM (Long Short Term Memory), Transformer and PLM (Pretrained Language Model), which is not limited here.
[0101] It should also be noted that the above correlation modeling, sparsity modeling and support modeling reconstruct the prediction process of the event detection model using simple linear mapping and multilayer perceptron, use correlation modeling to aggregate relevant hidden layer neurons to model event structure information, use sparsity screening to filter out invalid hidden layer neurons, and use support modeling to study interpretability without sacrificing model performance, which can improve computational efficiency.
[0102] In detail, there are two benefits of using simple linear mapping and multilayer perceptron to reconstruct the prediction process of the event detection model: on the one hand, the computational efficiency is higher because the entire event detection model does not need to be optimized; on the other hand, simple networks can guarantee interpretability. In this way, the event detection model mainly focuses on learning the behavior of hidden layer neurons, rather than sacrificing the performance of the event detection model to study interpretability.
[0103] Based on the above-described correlation modeling, sparsity modeling and support modeling, the overall loss can be obtained, as follows:
[0104]
[0105] wherein, is the overall loss, λ g , λ s and λ sd are hyperparameters, is the correlation loss, is the sparsity loss, is the support loss.
[0106] In this embodiment, a first optimized hidden layer representation is obtained by performing relevance modeling on the hidden layer representation to be explained. Then, a second optimized hidden layer representation is obtained by performing sparsity modeling on the first optimized hidden layer representation. Finally, a second optimized hidden layer representation is obtained by performing supportive modeling on the second optimized hidden layer representation. Based on the optimized hidden layer representation and a given set of event structure information, target event structure information is obtained. The target event structure information consists of the event trigger words or event arguments most relevant to the optimized hidden layer representation. This method uses relevance modeling to aggregate relevant hidden layer neurons to model event structure information, uses sparsity to filter hidden layer neurons that play an important role in model decision-making while filtering out invalid hidden layer neurons, and uses supportive modeling to conduct interpretability research without sacrificing model performance, thus improving computational efficiency.
[0107] Based on the above embodiments, further, target event structure information is obtained according to the optimized hidden layer representation and the given event structure information set.
[0108] Understandably, based on the statement to be detected and a pre-trained event detection model f = g(h(s)), the hidden layer representation h(s) closest to the output layer is extracted to explain the decision-making process of the event detection model. Correlation and sparsity modeling are designed to optimize the hidden layer representation, and further support modeling is used to ensure interpretability research without sacrificing model performance. Finally, the optimized hidden layer representation h′(ε) can be obtained.
[0109] Based on this, the h of each hidden neuron in the intermediate hidden layer is calculated according to the optimized hidden layer representation h′(ε) and the event structure information set E. k The correlation between (s) and E is analyzed, and the event trigger word or event argument with the highest score is obtained. Finally, the structural information of the target event that plays an important role in the model decision-making process is obtained, so as to understand the decision-making process of the event detection model.
[0110] Calculate h for each hidden neuron in the intermediate hidden layer. k The formula for the correlation between (s) and E is expressed as follows:
[0111] Neu(h k (s))=arg maxρ(h′ k (ε),E)
[0112] Among them, Neu(h k (s) is related to the hidden layer neuron h k (s) The most relevant event trigger word or event argument, h′ k (ε) is the optimized neuron representation h k (s), ρ(·) is the intersection-union ratio function, and E is the event structure information set.
[0113] In the embodiment, by calculating the correlation between each hidden layer neuron in the intermediate hidden layer and the event structure information set according to the optimized hidden layer representation and the event structure information set, and obtaining the event trigger word or event argument with the highest score, the target event structure information playing an important role in the model decision process is finally obtained. The method overcomes the defect that the existing event detection model explanation method has low explainability of the event detection model due to the neglect of the structural information possessed by the event itself, effectively improves the explainability of the event detection model, and is also helpful to understand the decision process of the event detection model.
[0114] In addition, Figure 2 The overall flowchart of the event detection model explanation method provided by the application is shown.
[0115] As Figure 2 shown, first, based on the to-be-detected sentence and the pre-trained event detection model, the hidden layer representation to be explained is extracted, which is a feature vector. Then, the hidden layer representation to be explained is modeled for correlation, sparsity and support, and the overall loss obtained from the three is iterated to optimize the hidden layer representation to be explained. When the training round is reached, the optimized hidden layer representation is obtained, and further, the event structure information is integrated. According to the optimized hidden layer representation and the given event structure information set, the hidden layer neuron mapping result, i.e. the target event information, the event trigger word or event argument most relevant to the optimized hidden layer representation, is output.
[0116] At the same time, a large number of experiments are carried out on the public data sets MAVEN and ACE 2005 respectively by using the event detection model explanation method provided by the application, and the experimental results show that the event detection model explanation method proposed by the application not only can improve the performance of the standard evaluation index, but also is helpful to understand the decision process of the model.
[0117] Figure 3 The structure diagram of the event detection model explanation device provided by the application is shown. As Figure 3 shown, the device comprises: a hidden layer representation extraction module 310 configured to extract a hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model; a hidden layer representation optimization module 320 configured to optimize the hidden layer representation to be explained to obtain an optimized hidden layer representation; and a target event structure information acquisition module 330 configured to acquire target event structure information according to the optimized hidden layer representation and a given event structure information set, wherein the target event structure information is an event trigger word or event argument most relevant to the optimized hidden layer representation.
[0118] In the embodiment, the hidden layer representation extraction module 310 extracts the hidden layer representation to be explained based on the sentence to be detected and the pre-trained event detection model, the hidden layer representation optimization module 320 optimizes the hidden layer representation to be explained to obtain an optimized hidden layer representation, and then the target event structure information acquisition module 330 acquires target event structure information according to the optimized hidden layer representation and a given event structure information set, the target event structure information being an event trigger word or an event argument most relevant to the optimized hidden layer representation. The device integrates the event structure information into the explanation process of the event detection model naturally, overcomes the defect that the existing event detection model explanation method ignores the structure information possessed by the event itself, resulting in low explainability of the event detection model, effectively improves the explainability of the event detection model, and helps to understand the decision-making process of the event detection model.
[0119] It should be noted that the event detection model explanation device provided in the embodiment can be correspondingly referred to the event detection model explanation method described above, which will not be described here.
[0120] Figure 4 An example of an entity structure diagram of an electronic device is shown in FIG. 4. Figure 4 As shown in FIG. 4, the electronic device can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 can communicate with each other through the communications bus 440. The processor 410 can invoke a logical instruction in the memory 430 to execute an event detection model explanation method, which includes: extracting a hidden layer representation to be explained based on a sentence to be detected and a pre-trained event detection model; optimizing the hidden layer representation to be explained to obtain an optimized hidden layer representation; and acquiring target event structure information according to the optimized hidden layer representation and a given event structure information set, wherein the target event structure information is an event trigger word or an event argument most relevant to the optimized hidden layer representation.
[0121] In addition, the logic instructions in the memory 430 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0122] In another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements an explanation method of an event detection model provided by the above-mentioned method, the method comprising: extracting a hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model; optimizing the hidden layer representation to be explained to obtain an optimized hidden layer representation; and obtaining target event structure information according to the optimized hidden layer representation and a given set of event structure information; wherein the target event structure information is an event trigger or an event argument that is most relevant to the optimized hidden layer representation.
[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0124] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions essentially or the parts that contribute to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.
[0125] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features therein can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An explanation method of an event detection model, characterized by, The method comprises the following steps: Based on the to-be-detected sentence and the pre-trained event detection model, the hidden layer representation to be explained is extracted; The hidden layer representation to be explained is optimized to obtain an optimized hidden layer representation; According to the optimized hidden layer representation and a given set of event structure information, target event structure information is obtained; The target event structure information is the event trigger word or event argument that is most relevant to the optimized hidden layer representation; The optimization of the hidden layer representation to be explained to obtain an optimized hidden layer representation comprises: Correlation modeling is performed on the hidden layer representation to obtain a first optimized hidden layer representation; Sparse modeling is performed on the first optimized hidden layer representation to obtain a second optimized hidden layer representation; Support modeling is performed on the second optimized hidden layer representation to obtain the optimized hidden layer representation; The correlation modeling performed on the hidden layer representation to obtain a first optimized hidden layer representation comprises: The hidden layer neurons corresponding to the hidden layer representation are clustered to obtain a plurality of hidden layer neuron groups; The contribution value of each hidden layer neuron in each hidden layer neuron group to the hidden layer neuron group is calculated by using an intersection-over-union function; Based on the hidden layer neuron group and the contribution value, a corresponding correlation loss is calculated; According to the correlation loss, the hidden layer representation is optimized to obtain the first optimized hidden layer representation; The sparse modeling performed on the first optimized hidden layer representation to obtain a second optimized hidden layer representation comprises: A sparse loss corresponding to the first optimized hidden layer representation is calculated; According to the sparse loss, the first optimized hidden layer representation is optimized to obtain the second optimized hidden layer representation; The support modeling performed on the second optimized hidden layer representation to obtain the optimized hidden layer representation comprises: A support loss corresponding to the second optimized hidden layer representation is calculated; According to the support loss, the second optimized hidden layer representation is optimized to obtain the optimized hidden layer representation.
2. The method of claim 1, wherein, The calculation formula of the correlation loss is as follows: wherein, is the correlation loss, L is the number of groups of hidden layer neurons, l is the number of the current group of hidden layer neurons, G l is the lth group of hidden layer neurons, is the contribution value of the ith hidden layer neuron in the lth group of hidden layer neurons to the group of hidden layer neurons, and E is the set of event structure information. 3.The method of claim 1, wherein, The calculation formula of the support loss is as follows: where, is the support loss, is the loss function, y is the true label, θ is the learnable parameters, KL(·) is the KL divergence, h ′ (ε) is the second optimized hidden layer representation, g(·) and h(·) are the intermediate process functions of the event detection model.
4. An event detection model explanation apparatus characterized by comprising: The method comprises the following steps: A hidden layer representation extraction module is configured to extract a hidden layer representation to be explained based on a to-be-detected sentence and a pre-trained event detection model; A hidden layer representation optimization module is configured to optimize the hidden layer representation to be explained to obtain an optimized hidden layer representation; A target event structure information acquisition module is configured to obtain target event structure information according to the optimized hidden layer representation and a given set of event structure information; The target event structure information is the event trigger word or event argument that is most relevant to the optimized hidden layer representation; The optimization of the hidden layer representation to be explained to obtain an optimized hidden layer representation comprises: Correlation modeling is performed on the hidden layer representation to obtain a first optimized hidden layer representation; Sparse modeling is performed on the first optimized hidden layer representation to obtain a second optimized hidden layer representation; Support modeling is performed on the second optimized hidden layer representation to obtain the optimized hidden layer representation; The correlation modeling performed on the hidden layer representation to obtain a first optimized hidden layer representation comprises: The hidden layer neurons corresponding to the hidden layer representation are clustered to obtain a plurality of hidden layer neuron groups; The contribution value of each hidden layer neuron in each hidden layer neuron group to the hidden layer neuron group is calculated by using an intersection-over-union function; Contribution values of each of the hidden layer neurons in each of the hidden layer neuron groups to the hidden layer neuron group are calculated using an intersection-over-union function; Based on the hidden layer neuron groups and the contribution values, a corresponding correlation loss is calculated; The hidden layer representation is optimized according to the correlation loss to obtain a first optimized hidden layer representation; The first optimized hidden layer representation is modeled for sparsity to obtain a second optimized hidden layer representation, including: A sparsity loss corresponding to the first optimized hidden layer representation is calculated; The first optimized hidden layer representation is optimized according to the sparsity loss to obtain the second optimized hidden layer representation; The second optimized hidden layer representation is modeled for support to obtain the optimized hidden layer representation, including: A support loss corresponding to the second optimized hidden layer representation is calculated; The second optimized hidden layer representation is optimized according to the support loss to obtain the optimized hidden layer representation.
5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the event detection model interpretation method of any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the event detection model interpretation method of any one of claims 1 to 3.
Citation Information
Patent Citations
Event detection method based on explicit event structure knowledge enhancement and terminal equipment
CN113111184A
Image privacy detection method with interpretability
CN113378859A