Event causal relationship identification method based on generative adversarial network
By generating potential causal labeled text through generative adversarial networks and combining it with a contrastive learning module, the problem of unstable causal relationship recognition in existing technologies is solved, and high accuracy and stability recognition are achieved in complex text environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUIZHOU NORMAL UNIVERSITY
- Filing Date
- 2026-02-10
- Publication Date
- 2026-04-17
AI Technical Summary
Existing methods for identifying causal relationships in events struggle to effectively bridge semantic gaps when dealing with complex event contexts, resulting in unstable and insufficiently robust causal relationship identification results. In particular, when language expressions are subtle or the context is complex, the model is prone to introducing irrelevant contextual information, weakening the basis for causal judgment.
A generative adversarial network-based approach is adopted, which generates potential causal label text by combining an encoding module, a generative adversarial network module, a contrastive learning module, and a causal relationship prediction module, and performs causal relationship identification. This avoids direct reliance on contextual representation and enhances discriminative and distinguishing capabilities.
It improves the stability of the causal relationship determination process and the accuracy of the recognition results, maintains consistent recognition performance in complex text scenarios, enhances the robustness of the model, and reduces sensitivity to text style and semantic distribution.
Smart Images

Figure CN121683891B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text processing technology, and more specifically to a method for identifying event causality based on generative adversarial networks. Background Technology
[0002] Event causality identification is an important research direction in the field of natural language processing. It is mainly used to analyze whether causal relationships exist between different event mentions in text, playing a crucial role in applications such as event understanding, information extraction, knowledge construction, and intelligent reasoning. With the continuous increase in the scale and complexity of text data, causal relationships between events are often implicit in long contexts, exhibiting characteristics such as cross-sentence distribution, subtle semantics, and complex dependencies. This places higher demands on the semantic modeling capabilities and discriminative stability of event causality identification models.
[0003] In natural language processing applications, event causality identification is used to determine whether there is a causal relationship between different event mentions in text. However, in real-world tasks, the semantics of event context are often complex and subtle, and the causal relationships between different events are usually implied in long-distance dependencies, diverse expressions, and semantic details.
[0004] Existing methods mainly rely on context-based causal determination mechanisms, which directly map complex event contexts to causal relationship label spaces. This transformation process is usually achieved through simple feature transformations or feedforward structures, which makes it difficult to effectively bridge the semantic gap between complex event contexts and target causal labels. In cases of subtle language expression or complex contexts, irrelevant contextual information is easily introduced and the causal judgment criteria are weakened, resulting in unstable causal relationship recognition results and insufficient robustness. Summary of the Invention
[0005] The purpose of this invention is to provide a method for identifying event causality based on generative adversarial networks, in order to solve the technical problems existing in related technologies.
[0006] To achieve the above objectives, the present invention provides a method for identifying event causality based on generative adversarial networks, comprising:
[0007] The text of the first event is input into the target prediction model to obtain the event causal relationship identification result;
[0008] The target prediction model is obtained by training the prediction model with multiple second event texts. The prediction model includes an encoding module, a generative adversarial network module, a contrastive learning module, and a causal relationship prediction module, specifically including:
[0009] Determine the target second event text, wherein the target second event text is any one of a plurality of second event texts;
[0010] The target second event text is encoded by the encoding module to obtain a word-level contextualized semantic representation. The target event pair is determined from the word-level contextualized semantic representation based on the target index, which is used to identify the start and end positions of the trigger word in the text.
[0011] Determine the first label text for the target event pair, the first label text being used to characterize the causal relationship between the target event pair;
[0012] By processing target event pairs using a generative adversarial network module, potential causal label text is obtained.
[0013] The contrastive learning module calculates the similarity between the potential causal label text and the first label text and the second label text, respectively, and calculates the contrastive loss based on the similarity. The second label text is the label text corresponding to other second event texts besides the target second event text.
[0014] The target event pair, the first label text, and the potential causal label text are concatenated dimensionally. The concatenated text is then input into the causal relationship prediction module to obtain the probability distribution of the causal relationship. The prediction loss is then calculated based on the probability distribution of the causal relationship.
[0015] The contrast loss and the prediction loss are added together to obtain the total loss. When the total loss does not meet the first preset condition, the parameters in the prediction model are updated according to the total loss. At the same time, the new target second event text is obtained. The above steps are repeated to obtain a new total loss until the new total loss meets the first preset condition. The prediction model updated last time is determined as the target prediction model.
[0016] Optionally, the method further includes:
[0017] When the contrast loss does not meet the second preset condition, the generative adversarial network parameters in the generative adversarial network module and the encoding parameters in the encoding module are updated according to the contrast loss. The new target second event text is then acquired again. The above steps are repeated to obtain a new contrast loss. The updating of the generative adversarial network parameters and the encoding parameters in the encoding module is stopped when the new contrast loss meets the second preset condition.
[0018] Optionally, the contrast loss is expressed by the following formula:
[0019] ;
[0020] ;
[0021] ;
[0022] ;
[0023] in, To compare the losses; The similarity between the semantic vectors of the first label in the potential causal labeled text and the first labeled text; The similarity between the semantic vectors of the second label in the potential causal labeled text and the first labeled text; The similarity between the potential causal label text and the second label text; It is a positive value for the temperature coefficient; For potential causal label text; The semantic vector of the first tag in the first tag text; The semantic vector of the second tag in the text of the first tag; is the text of the second tag; T is the matrix transpose.
[0024] Optionally, the prediction loss is expressed by the following formula:
[0025] ;
[0026] in, To predict losses; For a given target event pair, the context semantic vector and potential causal label text The model outputs the predicted probability of the target event pair; For a given target event pair, the context semantic vector and the semantic vector of the first tag in the first tag text The model outputs the predicted probability of the target event pair; For the true labels of the target event pairs; For the context semantic vector of the target event pair; This is the semantic vector of the first tag in the first tag text.
[0027] Optionally, the generative adversarial network module includes a generator and a reconciler, and the method further includes:
[0028] The potential causal label text and the first label text are processed by a discriminator, and the generator is optimized based on the processing results.
[0029] Optionally, the loss function of the generator is expressed by the following formula:
[0030] ;
[0031] in, The loss function for the generator; For the context semantic vector of the target event pair With random noise Take the expected value on the joint distribution; The true label probability score output by the discriminator; Hyperparameters for balancing adversarial and reconstructive terms; For the context semantic vector of the target event pair Take the expected value on the distribution; For potential causal label text; The first tag text;
[0032] The loss function of the resolver is expressed by the following formula:
[0033] ;
[0034] in, The loss function of the resolution; The expectation of the semantic distribution of the first tag text; Let be the expectation over the joint distribution of the target event pair and the noise.
[0035] Optionally, determining the target event pair from the lexical-level contextualized semantic representation based on the target index includes:
[0036] Based on the starting index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the first event;
[0037] Based on the end index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the second event;
[0038] The contextual semantic representations of the first event and the second event are stacked to obtain the target event pair.
[0039] The above technical solution inputs the first event text into the target prediction model to obtain the event causal relationship identification result corresponding to the first event text. The target prediction model is trained using multiple second event texts. During training, a generative adversarial network (GAN) module generates latent causal label text, which carries the latent causal semantic information between event pairs. This avoids directly relying on contextual representations to determine causal relationships, thus enabling the generated causal relationship representation to maintain consistency with the target causal label while reducing the interference of redundant contextual semantics on causal determination. During the training of the prediction model, a contrastive learning module is added to compare the latent causal label text, the first label text, and the second label text. This widens the representational distance between different causal event pairs, enhancing the discriminative and distinguishing ability of the event causal relationship representation. By updating the prediction model parameters using the total loss, the accuracy of the target prediction model can be improved. Therefore, when using the target prediction model to predict the first event text, the stability of the causal relationship determination process and the accuracy of the event causal relationship identification result can be improved.
[0040] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0041] Figure 1 This is a schematic diagram illustrating an event causality identification method based on generative adversarial networks according to an exemplary embodiment of the present invention.
[0042] Figure 2 This is a schematic diagram illustrating the target prediction model training process according to an exemplary embodiment of the present invention.
[0043] Figure 3 This is a flowchart illustrating an event causality identification method based on generative adversarial networks according to an exemplary embodiment of the present invention.
[0044] Figure 4 This is a schematic diagram illustrating a target prediction model according to an exemplary embodiment of the present invention.
[0045] Figure 5 This is a schematic diagram illustrating a generative adversarial network module according to an exemplary embodiment of the present invention. Detailed Implementation
[0046] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, so as to provide a better understanding of the concept of the present invention, the technical problem solved, the technical features constituting the technical solution, and the technical effects brought about.
[0047] Most existing event causal relationship recognition technologies are based on contextual semantic representation for modeling. They typically employ pre-trained language models or neural network structures with self-attention mechanisms to encode events and their contextual information, obtaining event-level or event-pair-level contextual representations (LSTM, BERT), and then determining causal relationships based on these representations. In recent years, some methods have enhanced contextual modeling capabilities by introducing multi-layer Transformer structures or auxiliary components, enabling models to capture long-distance dependencies between events and thus improving causal prediction performance (CausalBERT). In these technical approaches, models generally follow the basic process of "event contextual representation construction—causal relationship discrimination," where contextual semantic representation is the core basis for causal judgment. In the causal relationship determination stage, existing technologies typically map the obtained event contextual representation directly to the causal relationship label space to calculate causal scores or classification results between event pairs. This mapping process often relies on feedforward neural networks or simple feature transformation structures (BERT+FFN, RichGCN, LSIN, KEMM). These implementations are structurally simple and can accomplish causal relationship recognition tasks to a certain extent, thus becoming a common implementation method in current event causal relationship recognition and the one most similar to this invention. However, due to the high information redundancy, diverse forms of expression, and complex semantic details of event context semantics, direct conversion methods often fail to fully depict the deep semantic relationship between the event context and the target causal relationship label when dealing with event pairs with subtle linguistic expressions or complex contexts, posing challenges to the stability and robustness of subsequent causal judgments.
[0048] However, existing methods for identifying causal relationships in events typically employ a modeling approach that directly maps the complex event context representation to the causal relationship label space. The causal relationship determination stage often relies on feedforward neural networks or linear classification structures, without independently modeling and constraining the semantics of the causal labels. Consequently, in scenarios where language expression is subtle or the causal relationship is highly implicit, the model struggles to bridge the semantic gap between the complex event context and the target causal label, leading to unstable causal relationship determination results.
[0049] Existing methods typically encode events and their context as a whole during the context representation construction stage, without distinguishing between key information directly related to causal relationship determination and background or decorative semantic information. Irrelevant semantics are introduced along with the representation construction process, and contextual noise continues to participate in the calculation during the causal relationship determination stage, weakening the effective semantic foundation on which causal relationship discrimination depends and affecting the model's recognition accuracy in complex text environments.
[0050] Although some methods improve event representation by introducing structural enhancement or contextual enhancement mechanisms, their causal relationship determination still relies on the direct transformation of context representation. They lack discriminative constraint mechanisms for the causal relationship determination target. When the text style, language expression or context distribution changes, the model's ability to discriminate the causal relationship of events is prone to fluctuations, making it difficult to maintain stable performance in multilingual or noisy scenarios.
[0051] In view of this, the present invention provides an event causality identification method based on generative adversarial networks to solve the technical problems existing in the above-mentioned related technologies.
[0052] like Figure 1 and Figure 2 As shown, Figure 1 This is a schematic diagram illustrating an event causality identification method based on generative adversarial networks according to an exemplary embodiment of the present invention. Figure 2 This is a schematic diagram illustrating the target prediction model training process according to an exemplary embodiment of the present invention, with reference to... Figure 1 and Figure 2 The method includes;
[0053] S101: Input the text of the first event into the target prediction model to obtain the event causal relationship identification result;
[0054] The target prediction model is obtained by training the prediction model with multiple second event texts. The prediction model includes an encoding module, a generative adversarial network module, a contrastive learning module, and a causal relationship prediction module, specifically including:
[0055] S201: Determine the target second event text, wherein the target second event text is any one of a plurality of second event texts;
[0056] S202: The target second event text is encoded by the encoding module to obtain a word-level contextualized semantic representation, and the target event pair is determined from the word-level contextualized semantic representation according to the target index, wherein the target index is used to identify the start and end positions of the trigger word in the text;
[0057] S203: Determine the first label text of the target event pair, wherein the first label text is used to characterize the causal relationship between the target event pair;
[0058] S204: The target event pairs are processed by a generative adversarial network module to obtain potential causal label text;
[0059] S205: Calculate the similarity between the potential causal label text and the first label text and the second label text respectively through the contrastive learning module, and calculate the contrastive loss based on the similarity. The second label text is the label text corresponding to other second event texts besides the target second event text.
[0060] S206: Concatenate the target event pair, the first label text, and the potential causal label text in terms of dimensions. Input the concatenated text into the causal relationship prediction module to obtain the probability distribution of the causal relationship. Calculate the prediction loss based on the probability distribution of the causal relationship.
[0061] S207: Add the contrast loss to the prediction loss to obtain the total loss. When the total loss does not meet the first preset condition, update the parameters in the prediction model according to the total loss, and at the same time obtain the new target second event text. Repeat the above steps to obtain a new total loss until the new total loss meets the first preset condition. Then, determine the last updated prediction model as the target prediction model.
[0062] The above technical solution inputs the first event text into the target prediction model to obtain the event causal relationship identification result corresponding to the first event text. The target prediction model is trained using multiple second event texts. During training, a generative adversarial network (GAN) module generates latent causal label text, which carries the latent causal semantic information between event pairs. This avoids directly relying on contextual representations to determine causal relationships, thus enabling the generated causal relationship representation to maintain consistency with the target causal label while reducing the interference of redundant contextual semantics on causal determination. During the training of the prediction model, a contrastive learning module is added to compare the latent causal label text, the first label text, and the second label text. This widens the representational distance between different causal event pairs, enhancing the discriminative and distinguishing ability of the event causal relationship representation. By updating the prediction model parameters using the total loss, the accuracy of the target prediction model can be improved. Therefore, when using the target prediction model to predict the first event text, the stability of the causal relationship determination process and the accuracy of the event causal relationship identification result can be improved.
[0063] To enable those skilled in the art to better understand the event causality identification method based on generative adversarial networks provided by this invention, the above steps are illustrated in detail below.
[0064] For example, the first event text can be in English or Chinese. Specifically, the first event text can be any paragraph or chapter description, a news description, or a specific description of a certain time; this embodiment of the invention does not impose specific limitations on this. The target prediction model can be used to predict the causal relationship of events in the text. By inputting the first event text into the target prediction model, and after the target prediction model processes the first event text, the event causal relationship identification result can be obtained.
[0065] In the target prediction model, such as Figure 3 As shown, Figure 3 The encoder in this application is the encoding module, and the classifier includes a generative adversarial network module, a contrastive learning module, and a causal relationship prediction module. Specifically, the process for processing the first event text includes: the first event text can be s1, s2, and s3. Figure 3 The first event text is in English. It can then be encoded using an encoding module to extract the event. With the event , the event With the event Events are combined into event pairs. These event pairs are processed by a generative adversarial network (GAN) module to obtain corresponding latent causal label text. This latent causal label text is then input into a causal relationship prediction module. The module uses a multilayer perceptron and a softmax output layer for processing to obtain the event causal relationship identification result. This result can be used to identify the causal relationship of events. Caused the incident or event With the event There is no causal relationship.
[0066] For example, the target prediction model can be trained using multiple second event texts, such as... Figure 4As shown, the prediction model includes an encoding module, a generative adversarial network (GAN) module, a contrastive learning module, and a causal relationship prediction module. The encoding module encodes the event text; a RoBERTa encoder can be used. The GAN module can be a Generative Adversarial Network (GAN). The contrastive learning module constructs similar / dissimilar sample pairs based solely on the data's own features, eliminating the need for manually labeled ground truth pairs. This allows the model to cluster similar samples and separate dissimilar samples in the feature space, ultimately learning a more discriminative, robust, and generalizable feature representation. The causal relationship prediction module, including a multilayer perceptron (MLP) and a softmax output layer, is used to identify causal relationships in the event text, yielding the causal relationship prediction results.
[0067] The second event text can be different from the first event text. Among multiple second event texts, a target second event text can be determined, where the target second event text is any one of the multiple second event texts. During training, the target second event text can be encoded using an encoding module to obtain a word-level contextualized semantic representation. Then, the target event pair is determined from the word-level contextualized semantic representation based on the target index.
[0068] Specifically, when the target second event text is a piece of natural language text, two events mentioned in that natural language text are selected and denoted as events. With the event Event location tuples are established by the start and end positions of the trigger words in the text. : ,in, Indicates the starting index of the trigger word in the text sequence. This indicates the end index of the trigger word in the text sequence. When there are multiple second event texts input, this batch of second event texts can be processed. The trigger word in this batch will then be... There are 1 sample, and the corresponding event location is denoted as . , For the first A binary tuple of samples, For the trigger word in the first The starting index of each sample. For the trigger word in the first The end index of each sample. Event Causality Identification (ECI) is formalized as the identification of true labels for target event pairs. For the prediction problem, the following settings can be adopted: when When, it indicates an event. Caused the incident ;when When, it indicates an event. With the event There is no causal relationship. Addressing the real-world problem that long-distance, noisy text contexts can introduce a semantic gap between complex event representations and causal labels, the requirement is to achieve accurate prediction even under long context and noisy conditions. The target second event text is encoded using the encoding module. Let the batch size be... The text length is The semantic vector dimension is For input text and its attention mask Encoding is performed to obtain a word-level contextualized semantic representation: ,in, This is a random mask parameter used for random dropout. This is the encoding function. Then, target event pairs are determined from the word-level contextualized semantic representation, where M is the attention mask. For dimensions.
[0069] In one possible manner, determining the target event pair from the lexical-level contextualized semantic representation based on the target index includes:
[0070] Based on the starting index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the first event;
[0071] Based on the end index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the second event;
[0072] The contextual semantic representations of the first event and the second event are stacked to obtain the target event pair.
[0073] It should be understood that when constructing target event pairs, the location of the trigger words can be used to determine them. The trigger words can be the core words in the event text that are used to directly identify the existence of causal logical relationships or the occurrence of events.
[0074] Specifically, based on the target index From the text of potential causal labels respectively The hidden state vectors at corresponding positions are extracted as the contextual semantic representations of the first event and the second event, such as... Figure 4 As shown, this can be specifically expressed by the following calculation formula: and ,in: Indicates the events The event representation is the embedding vector, which is the contextual semantic representation of the first event; Indicates the events The event representation embedding vector is the contextual semantic representation of the second event.
[0075] Then and The vectors are concatenated to form the context semantic vectors of the target event pairs. This is used to model the semantic environment of event pairs within a unified context. This concatenation can also be achieved by adding delimiters, structured markers, etc., to the original text to ensure the model can distinguish the context fragments corresponding to different events. To obtain a semantic representation at the event pair level, [the following is used:] and Stacking or concatenating the data yields the contextual semantic vector of the target event pair. : ,in, This represents a stacking operation on two event representation vectors. Wherein, It can serve as one of the core inputs for subsequent potential causal label text and prediction modules.
[0076] For example, during the training process of target event pairs, after the target event pairs are extracted, specific determinations can be made based on the target event pairs. and The relationship between them will be specifically determined. and The relationships between these elements are applied to the training process. This can alleviate the semantic compression and information loss caused by directly mapping event context representations to discrete label spaces. For target event pairs... and its real label Construct the corresponding tag text The text explicitly contains target event pairs and a description of the relationship between them, for example: right There is no causal relationship; or lead to Specifically, such as Figure 4 As shown, when from the target second event text The target event pairs extracted are: events : Introduction, event It has been improved. Then you can directly address the event. and events The relationship is defined as label 1: event Caused the incident To enhance the robustness and multi-perspective expressiveness of tag semantic representation, tag text was processed under different random deactivation parameters. The first tag semantic vector is obtained by performing two encodings. With the second label semantic vector They are expressed by the following calculation formulas: and .in, and Different random inactivation parameters are used. By pooling the embedding or taking the hidden state at a specific position, two label-level first label semantic vectors can be obtained. With the second label semantic vector This is used for reconstruction constraints in subsequent potential label generation and for constructing positive samples in contrastive learning. Figure 4 The m-InfoNCE loss in the example is the contrast loss.
[0077] For example, after obtaining the target event pair, it can be input into the generative adversarial network module to obtain the latent causal label text. The target event pair and a random noise vector are then used as input to generate latent causal label text aligned with the real label semantic space. Specifically, as follows... Figure 5 As shown, let the random noise vector be... The generator function is Then for the first One sample, potential causal label text The generation form is: ,in, and , Maintain consistency in dimensions.
[0078] In one possible manner, the generative adversarial network module includes a generator and a discriminator, and the method further includes:
[0079] The potential causal label text and the first label text are processed by a discriminator, and the generator is optimized based on the processing results.
[0080] It should be understood that the generative adversarial network module can update itself by comparing the generated potential causal label text with the first label text.
[0081] Specifically, in order to generate potential causal label text It can both fool the resolution sensor and approximate the true label representation. Let the first label text be... The generator loss is then defined as: ,in, Let the loss function of the generator be... For the context semantic vector of the target event pair With random noise Take the expected value on the joint distribution. The true label probability score output by the discriminator. To balance the hyperparameters of adversarial and reconstruction terms, For the context semantic vector of the target event pair Take the expected value on the distribution. For potential causal label text, The first label text. This is achieved by minimizing the generator's loss function. The generator can learn to generate latent causal label embeddings that are closer to the semantic distribution of real labels, providing higher quality semantic features for subsequent predictions.
[0082] To distinguish between the first-label text and the potential causal-label text, a discriminative network can be constructed. Its input is a label semantic vector, and its output is the probability score of that vector belonging to the "true label semantics." Specifically, for example... Figure 5 As shown. For the first label text With potential causal label text The loss function of the discriminant network is defined as: ,in, Let the loss function of the resolution be... To the expectation of the semantic distribution of the first tag text, This represents the expectation over the joint distribution of the target event pair and the noise. During training, the generator's loss function is optimized alternately. loss function of the resolution The generator attempts to minimize the loss function. To generate more "realistic" latent label embeddings; the discriminator attempts to minimize the loss function. This enhances the ability to distinguish between real label embeddings and latent label embeddings. As the two gradually reach equilibrium during training, the generated latent causal label embeddings closely approximate the distribution of the real label semantics, achieving alignment between the event context semantic space and the label semantic space. (First label text) Can be label text .
[0083] For example, after obtaining the potential causal label text, the similarity between the potential causal label text and the first label text and the second label text can be calculated using a contrastive learning module. A contrastive loss is then calculated based on the similarity, and the parameters in the prediction model can be updated according to the contrastive loss. Specifically, to improve the ability of the potential causal label text to distinguish different causal relationship categories, a self-supervised contrastive learning module is introduced to... Discriminative enhancement is performed. In the contrastive learning module, such as... Figure 4 As shown, the text of the potential causal label Treated as an anchor event, it is determined by the semantic vector of the first tag in the first tag text. Second label semantic vector The second-labeled text is considered a positive sample event within the same semantic category. As a negative sample event, where the second label text is the label text corresponding to other second event pairs, the similarity between the anchor event and the positive sample event and the negative sample event can be calculated separately as follows:
[0084] ;
[0085] ;
[0086] ;
[0087] in, A positive value for the temperature coefficient is used to adjust the smoothness of the similarity distribution. This represents the similarity between the semantic vectors of the first label in the potential causal labeled text and the first labeled text. This represents the similarity between the semantic vectors of the second label in the potential causal labeled text and the first labeled text. The similarity between the potential causal label text and the second label text. For potential causal label text, This is the semantic vector of the first tag in the first tag text. This is the semantic vector of the second tag in the text of the first tag. This is the text for the second tag.
[0088] In the case of multiple positive samples, this invention employs a loss function in the form of supervised contrastive learning, defining the contrastive loss for each anchor sample as follows:
[0089] ;
[0090] By minimizing the contrast loss This makes the potentially causal label text In the embedding space, it is closer to its corresponding first label semantic vector. With the second label semantic vector At the same time, away from negative samples This significantly improves the discriminative power of latent label embeddings across different causal categories, providing a more discriminative feature representation for the final causal relationship prediction.
[0091] In some possible ways, the method further includes:
[0092] When the contrast loss does not meet the second preset condition, the generative adversarial network parameters in the generative adversarial network module and the encoding parameters in the encoding module are updated according to the contrast loss. The new target second event text is then acquired again. The above steps are repeated to obtain a new contrast loss. The updating of the generative adversarial network parameters and the encoding parameters in the encoding module is stopped when the new contrast loss meets the second preset condition.
[0093] It should be understood that after calculating the contrastive loss, it can be determined whether the contrastive loss meets the second preset condition. This second preset condition can be achieved by comparing the contrastive loss with the previous contrastive loss value to determine if it approaches a certain value, or by calculating the difference between the previous and current contrastive losses to determine if the difference is close to zero, or by determining if the total number of calculations has reached a preset number to minimize the contrastive loss. When the contrastive loss does not meet the second preset condition, the parameters of the generative adversarial network (GAN) and the encoding parameters in the encoding module can be updated based on the contrastive loss until a new contrastive loss is obtained that no longer changes. The last updated GAN and encoding modules are then identified as the GAN and encoding modules in the target prediction model. By using contrastive constraints to widen the representational distance between different causal event pairs, the discriminative and distinguishing ability of the event causal relationship representation is enhanced.
[0094] For example, the target event pair, label text, and potential causal label text are then concatenated dimensionally. The concatenated text is input into the causal relationship prediction module to obtain the probability distribution of the causal relationship. The prediction loss is then calculated based on this probability distribution. Specifically, in the causal relationship prediction module, causal relationships are determined using event context representation and label semantic representation. During the model training phase, the target event pair... With the semantic vector of the first label The data is concatenated and input into a Multilayer Perceptron (MLP) structure to map it into a new latent space. Then, the probability distribution of causal relationships is obtained through a softmax output layer. During model validation and inference, the target event pairs are... With potential causal label text After concatenation, the results are input into the same prediction network to obtain the final prediction result. This process can be formalized as follows: ;in, Indicates the true label of the target event pair. During the training phase The combination of these elements, in the reasoning stage, is... To simultaneously constrain the prediction performance using both the first-label text and the potential causal-label text, a prediction loss can be used for discrimination. The prediction loss can be expressed by the following formula:
[0095] ;
[0096] in, To predict losses, For a given target event pair, the context semantic vector and potential causal label text The model outputs the predicted probability of the target event pair. For a given target event pair, the context semantic vector and the semantic vector of the first tag in the first tag text The model outputs the predicted probability of the target event pair. For the true labels of the target event pairs, For the context semantic vector of the target event pair, This is the semantic vector of the first tag in the first tag text.
[0097] For example, the contrastive loss can then be added to the prediction loss to obtain the total loss. It is then determined whether the total loss meets a first preset condition. If the first preset condition is not met, the parameters of the prediction model can be updated based on the total loss, and a new target second event pair can be obtained. The above steps are repeated to obtain a new total loss until the new total loss meets the first preset condition. The last updated prediction model is then determined as the target prediction model. The first preset condition can be that the total loss reaches a preset threshold, or that the total loss is close to a certain value.
[0098] During the overall training phase, a multi-objective joint optimization strategy is adopted, taking into account the prediction loss. Comparative learning loss Loss function of generator And supplemented by the loss function of the discriminator The optimization process enables the four components—generation, discrimination, comparison, and prediction—to be trained collaboratively. Through these steps, high-fidelity, high-discrimination, and high-robustness event causal relationship recognition is achieved in complex contexts.
[0099] In actual processing, as shown in Table 1, the performance metrics of this invention on event storyline datasets and causal-temporal datasets are summarized as precision (P), recall (R), and macro-average F1 score (F1).
[0100] Experimental results show that the present invention improves the macro-average F1 score by 4.3% and 7.9% on the event storyline dataset and causal-temporal dataset, respectively, compared to existing models. These findings confirm the effectiveness of the proposed contrastive learning framework in enhancing event causal identification.
[0101] Table 1. Model performance on the event storyline dataset and the causal-temporal dataset.
[0102] .
[0103] Through the above technical solution, in the process of event causality identification, an intermediate causal relationship representation, the potential causal label text, independent of the event context representation, is introduced to carry the potential causal semantic information between event pairs, avoiding direct reliance on context representation to complete causal relationship determination. The potential causal label text is constructed using a generative approach, enabling the generated causal relationship representation to maintain consistency with the target causal label while reducing the interference of redundant contextual semantics on causal determination. A generator produces corresponding potential causal label text based on the event context representation to characterize the causal relationship semantics between event pairs. A discriminator constrains the generated potential causal label text with the first label text, ensuring that the generated causal relationship representation remains aligned with the target causal label in the semantic space. During model training, a contrastive learning strategy is introduced to construct positive and negative event pair samples, bringing event pairs with the same or similar causal relationships closer together in the representation space. Contrastive constraints widen the representation distance between event pairs with different causal relationships, enhancing the discriminative and distinguishing ability of the event causal relationship representation. By unifying the modeling of event context representation learning, latent causal label embedding generation, and causal relationship determination process, a complete technical solution for event causal relationship identification is formed. In the causal relationship determination stage, causal relationship prediction is completed based on latent causal label embedding rather than the original context representation, thereby improving the stability of the causal relationship determination process.
[0104] Because this invention introduces an independent causal relationship representation modeling mechanism between the semantic representation of the event context and the determination of causal relationships, and through generative latent causal label text construction and alignment constraints, the determination of causal relationships no longer relies solely on the direct mapping of the original context representation. Therefore, it can effectively reduce the interference of irrelevant semantics on the causal determination process when the context contains a large amount of background description, modifying statements, or redundant semantic information. This alleviates the instability problem caused by the "difficult-to-bridge semantic gap between complex context semantics and target causal labels" in existing technologies, thereby improving the accuracy and stability of event causal relationship recognition in complex text scenarios with subtle language expressions and large context spans. At the same time, this invention introduces contrast constraints oriented towards the causal determination target during the training phase. By discriminative learning of positive and negative event pairs, it enhances the distinguishing ability of event causal relationship representations, enabling the model to more stably capture key semantic patterns related to causal relationships. It maintains consistent recognition performance in multilingual or noisy text environments, thereby improving overall robustness and reducing sensitivity to specific text styles or semantic distributions.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying event causality based on a generative adversarial network, characterized in that, include: The text of the first event is input into the target prediction model to obtain the event causal relationship identification result; The target prediction model is obtained by training the prediction model with multiple second event texts. The prediction model includes an encoding module, a generative adversarial network module, a contrastive learning module, and a causal relationship prediction module, specifically including: Determine the target second event text, wherein the target second event text is any one of a plurality of second event texts; The target second event text is encoded by the encoding module to obtain a word-level contextualized semantic representation. The target event pair is determined from the word-level contextualized semantic representation based on the target index, which is used to identify the start and end positions of the trigger word in the text. Determine the first label text for the target event pair, the first label text being used to characterize the causal relationship between the target event pair; By processing target event pairs using a generative adversarial network module, potential causal label text is obtained. The contrastive learning module calculates the similarity between the potential causal label text and the first label text and the second label text, respectively, and calculates the contrastive loss based on the similarity. The second label text is the label text corresponding to other second event texts besides the target second event text. The target event pair, the first label text, and the potential causal label text are concatenated dimensionally. The concatenated text is then input into the causal relationship prediction module to obtain the probability distribution of the causal relationship. The prediction loss is then calculated based on the probability distribution of the causal relationship. The contrast loss and the prediction loss are added together to obtain the total loss. When the total loss does not meet the first preset condition, the parameters in the prediction model are updated according to the total loss. At the same time, the new target second event text is obtained. The above steps are repeated to obtain a new total loss until the new total loss meets the first preset condition. The prediction model updated last time is determined as the target prediction model. 2.The event causal relationship identification method based on a generative adversarial network according to claim 1, characterized in that, The method further includes: When the contrast loss does not meet the second preset condition, the generative adversarial network parameters in the generative adversarial network module and the encoding parameters in the encoding module are updated according to the contrast loss. The new target second event text is then acquired again. The above steps are repeated to obtain a new contrast loss. The updating of the generative adversarial network parameters and the encoding parameters in the encoding module is stopped when the new contrast loss meets the second preset condition. 3.The event causal relationship identification method based on a generative adversarial network according to claim 1 or 2, characterized in that, The contrast loss is expressed by the following formula: ; ; ; ; in, To compare the losses; The similarity between the semantic vectors of the first label in the potential causal labeled text and the first labeled text; The similarity between the semantic vectors of the second label in the potential causal labeled text and the first labeled text; The similarity between the potential causal label text and the second label text; It represents a positive value for the temperature coefficient; For potential causal label text; The semantic vector of the first tag in the first tag text; The semantic vector of the second tag in the text of the first tag; is the text of the second tag; T is the matrix transpose.
4. The event causality identification method based on generative adversarial networks according to claim 1, characterized in that, The prediction loss is expressed by the following formula: ; in, To predict losses; For a given target event pair, the context semantic vector and potential causal label text The model outputs the predicted probability of the target event pair; For a given target event pair, the context semantic vector and the semantic vector of the first tag in the first tag text The model outputs the predicted probability of the target event pair; For the true labels of the target event pairs; For the context semantic vector of the target event pair; This is the semantic vector of the first tag in the first tag text.
5. The event causality identification method based on generative adversarial networks according to claim 1, characterized in that, The generative adversarial network module includes a generator and a discriminator, and the method further includes: The potential causal label text and the first label text are processed by a discriminator, and the generator is optimized based on the processing results.
6. The event causality identification method based on generative adversarial networks according to claim 5, characterized in that, The loss function of the generator is expressed by the following formula: ; in, The loss function for the generator; For the context semantic vector of the target event pair With random noise Take the expected value on the joint distribution; The true label probability score output by the discriminator; Hyperparameters for balancing adversarial and reconstructive terms; For the context semantic vector of the target event pair Take the expected value on the distribution; For potential causal label text; The first tag text; The loss function of the resolver is expressed by the following formula: ; in, The loss function of the resolution; The expectation of the semantic distribution of the first tag text; Let be the expectation over the joint distribution of the target event pair and the noise.
7. The event causality identification method based on generative adversarial networks according to claim 1, characterized in that, The step of determining the target event pair from the word-level contextualized semantic representation based on the target index includes: Based on the starting index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the first event; Based on the end index in the target index position, the corresponding trigger word is extracted from the word-level contextualized semantic representation to form the contextual semantic representation of the second event; The contextual semantic representations of the first event and the second event are stacked to obtain the target event pair.
Citation Information
Patent Citations
Accident scene reasoning method and device
CN119918665A
Equipment fault prediction method based on industrial causal logic
CN121327655A