Event detection method and system

Through the method of combining multi-label comparison learning and loss function, the event detection model is optimized, which solves the problems of difficulty in positioning trigger words and poor generalization ability of the model, and achieves more accurate event detection and better generalization performance.

CN120387047APending Publication Date: 2025-07-29GUANGXI POWER GRID CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510253716.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Among the existing event detection methods, trigger word positioning is difficult, model generalization ability is poor, and knowledge-driven methods may cause noise problems.

Method used

The multi-label comparison learning method is adopted, and the detection text is encoded using the first language model. Standardized label-aware embedding is extracted through multi-label classification and comparison learning. The event detection model is trained in combination with the loss function, and the event detection model is optimized to realize the detection of specific events.

Benefits of technology

It improves the accuracy and generalization ability of the model in identifying trigger words, reduces dependence on external knowledge bases, avoids noise interference, and enhances sample representation ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387047A_ABST
    Figure CN120387047A_ABST
Patent Text Reader

Abstract

The invention discloses an event detection method and system, and the method comprises the steps: obtaining a detection text, and carrying out the coding of the detection text through a first language model, and obtaining a first code; performing multi-label classification on the first code, and processing the classified result by utilizing multi-label comparison learning to obtain standardized label sensing embedding; extracting a first related feature based on the standardized tag perception embedding; and taking the first related features as a sample pair, enhancing sample representation through comparative learning, and training an event detection model in combination with a loss function to obtain an optimized event detection model so as to realize detection of a specific event in the text. And the event type knowledge extraction process is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of event detection, and in particular, to an event detection method and system. Background Art

[0002] Event Detection (ED) aims to identify trigger words representing specific events from texts, plays a crucial role in Information Extraction (IE), and is beneficial to various downstream applications such as text summarization and machine reading comprehension. Early ED methods relied on traditional machine learning models with manually annotated features to extract events. With the development of deep learning, many research works have been devoted to enhancing ED with different neural network architectures, such as models based on convolutional neural networks, models based on recurrent neural networks, and hybrid models. However, due to the limited scale of ED datasets, data-driven methods cannot fully utilize the capabilities of neural networks and still suffer from poor generalization ability.

[0003] In recent years, new methods have attempted to use external knowledge to solve the problems of ED, such as using knowledge bases, syntactic features, argument information, and document-level context. In addition, adversarial training and distant supervision have been proposed to obtain more training data. With the success of pre-trained language models (PLMs), BERT-based methods have been proposed to enhance representations. Although the above methods have achieved good results, knowledge-driven methods may introduce noise and mislead the learning process. The recently proposed CLEVE model obtains more powerful representations by using external resources for contrastive pre-training. The current state-of-the-art method, SaliencyED, uses the saliency attributes of trigger words to distinguish trigger-word-related and context-related event types. This method deeply studies the bottlenecks of current ED models and defines prior knowledge as event type information to assist in extracting trigger words. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides an event detection method and system to solve the problems of difficult trigger word positioning, poor model generalization ability, and the possible introduction of noise by knowledge-driven methods.

[0006] To solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides an event detection method, including:

[0008] Obtain a detection text, and encode the detection text using a first language model to obtain a first encoding;

[0009] Perform multi-label classification on the first encoding, and use multi-label contrast learning to process the classified results to obtain a standardized label-aware embedding;

[0010] Extract the first relevant features based on the standardized label-aware embedding;

[0011] Use the first relevant features as sample pairs, enhance the sample representation through contrast learning, and train an event detection model in combination with a loss function to obtain an optimized event detection model to achieve the detection of specific events in the text.

[0012] As a preferred solution of the event detection method described in the present invention, wherein: using the first language model to encode the detection text includes:

[0013] Use the first language model as a text encoder to represent sentences and words;

[0014] Encode the sentence into a first sequence, and use the embedding of the classification token to represent the sentence embedding.

[0015] As a preferred solution of the event detection method described in the present invention, wherein: performing multi-label classification on the encoding result includes:

[0016] For the event label of each sentence, define the event label as a one-hot vector;

[0017] Input the sentence embedding into a linear classifier, and use the first loss function to optimize the multi-label event classification model to obtain a classification loss.

[0018] As a preferred solution of the event detection method described in the present invention, wherein: using multi-label contrast learning to process the classified results includes:

[0019] According to the sentence representation and label embedding output by the first language model, use the attention mechanism to obtain a label-aware embedding;

[0020] Add a non-linear mapping head, input the label-aware embedding into the first multi-layer perceptron to obtain a standardized embedding;

[0021] Combine the classification loss and the multi-label contrast loss to obtain an optimized event knowledge extraction model to achieve multi-label event knowledge extraction.

[0022] As a preferred solution of the event detection method described in the present invention, wherein: the multi-label contrast loss includes:

[0023] Denote each instance as the target instance, the positive example pair set contains instances with the same label as the target instance and is denoted as the first instance, and the other embedding set contains those except the target instance and is denoted as the second instance;

[0024] Calculate the dot product of the embedding vector of the target instance and the embedding vectors of each first instance, divide the result by the temperature parameter, and take the exponential to obtain the first exponential value;

[0025] Calculate the dot product of the embedding vector of the target instance and the embedding vectors of each second instance, divide the result by the temperature parameter, and take the exponential to obtain the exponential values. Sum the exponential values of all second instances to obtain the second exponential sum;

[0026] Divide the first exponential value by the second exponential sum, take the logarithm of the result, sum the logarithmic values of all positive example pairs and take the negative value to obtain the multi-label contrast loss.

[0027] As a preferred solution of the event detection method described in the present invention, wherein: extracting trigger word-related features and context-related features includes:

[0028] Use the standardized label-aware embedding to represent the trigger word-related features;

[0029] Replace the original symbols with masked tokens, and use the representation of the masked tokens as the context-related features.

[0030] As a preferred solution of the event detection method described in the present invention, wherein: training the event detection model by combining loss functions includes:

[0031] Train the event detection model by combining the contrast loss and the classification loss;

[0032] Wherein, the contrast loss is defined as a positive example set, including all symbol representations having the same event type as each symbol, as well as the label embedding and masked embedding corresponding to each symbol;

[0033] For each positive example in the positive example set, calculate the similarity between each positive example and the processed symbol representation of each symbol;

[0034] For other symbol representations, calculate the similarity between other symbol representations and the processed symbol representation of each symbol, and sum them to obtain the similarity sum;

[0035] Divide the similarity of the positive example by the similarity sum of other symbol representations, take the logarithm of the result, sum the logarithmic values of all positive examples and take the negative value to obtain the contrast loss.

[0036] In a second aspect, the present invention provides an event detection system, including:

[0037] An encoding module, configured to obtain the detection text, and encode the detection text by using a first language model to obtain a first encoding;

[0038] A multi-label classification module for performing multi-label classification on the first encoding, and using multi-label contrast learning to process the classified result to obtain a standardized label-aware embedding;

[0039] A feature extraction module for extracting first relevant features based on the standardized label-aware embedding;

[0040] An event detection module for using the first relevant features as sample pairs, enhancing sample representations through contrast learning, and training an event detection model in combination with a loss function to obtain an optimized event detection model for detecting specific events in text.

[0041] In a third aspect, the present invention provides a computing device, including:

[0042] A memory and a processor;

[0043] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the event detection method are implemented.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the event detection method are implemented.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows: By using multi-label contrast learning to extract event type knowledge as prior knowledge, the model can more accurately identify and locate trigger words. Combining multiple contrast losses, the model can learn context-related and trigger-word-related information, thereby enhancing the representation ability of samples. By introducing prior knowledge and contrast learning, the model can better generalize when facing unseen data. Through the internal contrast learning mechanism, the dependence on external knowledge bases is reduced, and the noise and misguidance that may be brought by external knowledge are avoided. The introduction of multi-label contrast learning enables the model to consider the relationships of multiple event types simultaneously and optimizes the extraction process of event type knowledge. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0047] Figure 1 It is a schematic diagram of the overall process logic of the event detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe in detail the specific embodiments of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0049] Embodiment 1

[0050] Referring to Figure 1 , for an embodiment of the present invention, an event detection method is provided, including:

[0051] S100: Obtain the detection text, and encode the detection text using the first language model to obtain the first encoding;

[0052] S200: Perform multi-label classification on the first encoding, and use multi-label contrast learning to process the classified result to obtain a standardized label-aware embedding;

[0053] S300: Extract the first relevant features based on the standardized label-aware embedding;

[0054] S400: Use the first relevant features as sample pairs, enhance the sample representation through contrast learning, and train the event detection model in combination with the loss function to obtain an optimized event detection model to achieve the detection of specific events in the text.

[0055] It should be noted that using multi-label contrast learning to extract event type knowledge as prior knowledge and combining multiple contrast losses to learn context-related and trigger-word-related information to enhance the sample representation can effectively alleviate the problem of difficult trigger-word localization in the absence of additional information.

[0056] In the embodiment of the present application, the above step S100 includes the following sub-steps A1-A2;

[0057] In A1: Use the first language model as a text encoder to represent sentences and words;

[0058] In A2: Encode the sentence into a first sequence, and use the embedding of the classification token to represent the sentence embedding.

[0059] In an alternative embodiment, the first language model can be ALBERT, and the input sentence is encoded into a hidden embedding sequence, denoted as: {h1, h2, …, h n} = f ALBERT ({w1, w2, …, w n}), use the classification token "[CLS]" token embedding of ALBERT to represent the sentence embedding s;

[0060] In an alternative embodiment, the first language model can also be RoBERTa, which encodes the input sentence into a sequence of hidden embeddings, denoted as: {h1, h2, …, h n} = f RoBERTa ({w1, w2, …, w n}) and use the classification token "[CLS]" token embedding of RoBERTa to represent the sentence embedding s;

[0061] In the embodiment of the present application, the first language model selects the BERT model based on the multi-layer Transformer model as the text encoder to represent sentences and words;

[0062] Specifically, the sentence s is encoded into a first sequence of hidden embeddings, denoted as:

[0063] {h1, h2, …, h n} = f({w1, w2, …, w n )

[0064] where f is the encoder, and h i is the hidden representation of each symbol w i ;

[0065] Use the embedding of the classification token "[CLS]" to represent the sentence embedding s. In practice, the embedding of each symbol is used to identify and classify trigger words, and the sentence embedding s is used to extract event knowledge.

[0066] It should be noted that the BERT model is based on a multi-layer Transformer architecture and can capture long-distance dependencies and complex semantic information between words, enabling the model to better understand the context of sentences, thereby providing a more accurate semantic basis for the event detection task. The sentence embedding s is used to extract event type knowledge, which helps the model to more comprehensively understand the semantic content of sentences in the multi-label classification task, thereby improving the accuracy of event type recognition.

[0067] In the embodiment of the present application, the above step S200 includes the following sub-steps B1 - B2;

[0068] In B1: For the event label of each sentence, define the event label as a one-hot vector;

[0069] In B2: Input the sentence embedding into a linear classifier, and use the first loss function to optimize the multi-label event classification model to obtain the classification loss.

[0070] In an alternative embodiment, the first loss function can be the focal loss. In multi-label classification, the traditional binary cross-entropy loss is replaced by the focal loss, which for each label is expressed as:

[0071] FL(p t )=-α t (1-p t ) γ ylog(p t )

[0072] where p t is the probability that the model predicts the positive class, α t is a parameter for balancing the weights of positive and negative samples, γ≥0 is a focusing parameter for adjusting the weights of easy and hard samples, and y is the true label;

[0073] In an alternative embodiment, the first loss function can be the Dice loss. In multi-label classification, the Dice loss is combined with the binary cross-entropy loss and is expressed as:

[0074]

[0075] where p i is the probability of the i-th label predicted by the model, y i is the true label, and ∈ is a smoothing term;

[0076] In an alternative embodiment, the first loss function can also be the Hamming loss, which is combined with the binary cross-entropy loss and is expressed as:

[0077]

[0078] where N is the number of samples, L is the number of labels, p ij is the predicted value of the j-th label of the i-th sample, and y ij is the true value.

[0079] In the embodiments of the present application, the first loss function includes the binary cross-entropy loss;

[0080] Specifically, given the i-th sentence s i , the event label is defined as a one-hot vector and is expressed as:

[0081]

[0082] where L is the number of event labels;

[0083] The sentence embedding is input into the linear classifier head, and the binary cross-entropy loss is used to optimize the multi-label event classification model, and the classification loss is expressed as:

[0084]

[0085] Among them, is the probability vector of s i , and W s and b s are trainable parameters;

[0086] It should be noted that a sentence may contain multiple events. Therefore, event knowledge extraction is defined as a multi-label classification task to cover as many event types as possible. Since the instances in the event detection dataset are labeled at the word level, all trigger words in the sentence are considered for the corresponding event types to generate the event labels for each sentence, more comprehensively identify the event types in the sentence, and provide important prior knowledge for subsequent event detection tasks.

[0087] In the embodiment of the present application, after completing steps B1 - B2 in the above step S200, the following steps B3 - B5 are further included;

[0088] In B3: According to the sentence representation and label embedding output by the first language model, use the attention mechanism to obtain the label-aware embedding;

[0089] In B4: Add a non-linear mapping head, input the label-aware embedding into the first multi-layer perceptron to obtain the normalized embedding;

[0090] In B5: Combine the classification loss and the multi-label contrast loss to obtain an optimized event knowledge extraction model to achieve multi-label event knowledge extraction.

[0091] In an alternative embodiment, the first multi-layer perceptron can be a Deep MLP. Taking the label-aware embedding obtained by the attention mechanism in the first stage as the input, perform feature extraction and non-linear transformation through multiple fully connected layers (FC) and activation functions (such as ReLU). LayerNorm can be added for normalization between each layer to stabilize the training process. After the output layer, perform L2-norm normalization on the embedding vector to make its length 1 for subsequent contrast learning; the first multi-layer perceptron can also be a Transformer encoder. Taking the label-aware embedding as the input of the Transformer encoder, capture the relationship between the embeddings through the multi-head self-attention module, further enhance the feature representation through the feed-forward network, and perform L2-norm normalization on the embedding vector after the output;

[0092] In an alternative embodiment, the first multi-layer perceptron can also be a lightweight convolutional network. Taking the label-aware embedding as the input of the convolutional network, use lightweight convolutional operations to extract local features, introduce non-linearity through activation functions such as ReLU, and perform L2-norm normalization on the embedding vector after the output;

[0093] In the embodiment of the present application, the first multi-layer perceptron is a 2-layer multi-layer perceptron (MLP) with L2 norm;

[0094] Specifically, given the i-th sentence representation s output by the BERT model i and the j-th label embedding e j , the label-aware embedding s is obtained by using the attention mechanism ij , which is expressed as:

[0095] s ij = α ij s i

[0096]

[0097] Adding a non-linear mapping head can improve the performance of contrastive learning. Therefore, the obtained s ij is input into a 2-layer multi-layer perceptron (MLP) with L2 norm to generate a normalized embedding, which is expressed as:

[0098] z ij = l2(W2σ(W1s ij ))

[0099] where W1 and W2 are trainable parameters;

[0100] In the embodiment of the present application, after completing steps B3 - B5 in the above step S200, the following steps B6 - B9 are further included;

[0101] In B6: Each instance is recorded as the target instance. The instances in the positive example pair set that have the same label as the target instance are recorded as the first instance, and the instances in the other embedding set that exclude the target instance are recorded as the second instance;

[0102] In B7: Calculate the dot product of the embedding vector of the target instance and the embedding vector of each first instance, divide the result by the temperature parameter, and take the exponent to obtain the first exponential value;

[0103] In B8: Calculate the dot product of the embedding vector of the target instance and the embedding vector of each second instance, divide the result by the temperature parameter, and take the exponent to obtain the exponential value. Add up the exponential values of all second instances to obtain the second exponential sum;

[0104] In B9: Divide the first exponential value by the second exponential sum, take the logarithm of the result, add up the logarithmic values of all positive example pairs and take the negative value to obtain the multi-label contrast loss.

[0105] Specifically, given that the target instance is a batch of instances where N is the number of instances and L is the number of labels. The positive example pair set defines the first instance as The other embedding set defines the second instance as The calculation of the multi-label contrast loss is expressed as:

[0106]

[0107] where τ is the temperature parameter for measuring the loss;

[0108] Combining the cross-entropy loss and the contrast loss to optimize the event knowledge extraction model is expressed as:

[0109]

[0110] where α is the trade-off parameter for balancing the loss.

[0111] It should be noted that different sentences may contain some of the same event types, thus having similar semantic information. Simple classification methods only consider the semantic information of a single sentence and ignore the semantic associations between different sentences, which will lead to excessive differences in the representations of sentences with the same event type, thereby affecting the performance of the model. Therefore, the model uses multi-label contrast learning to model the semantic associations between sentences.

[0112] In multi-label tasks, although two instances may share the same labels, they may also have completely different labels, which makes traditional supervised contrast learning methods inapplicable. Therefore, the model first uses the label names and descriptions to obtain meaningful embedding representations for each event type, that is, label embeddings, and then combines the label embeddings with the sentence representations to generate label-aware embeddings for each sentence to construct contrast instances from the perspective of the semantic associations of sentences.

[0113] In the embodiment of this application, the above step S300 includes the following sub-steps C1-C2;

[0114] In C1: Use the standardized label-aware embedding to represent the trigger word-related features;

[0115] In C2: Replace the original symbols with mask tokens and use the representations of the mask tokens as context-related features;

[0116] Specifically, use the standardized label-aware embedding to represent the features related to trigger words.

[0117] For context-related mentions, replace the original symbols with the mask token "[MASK]" to force the model to only focus on the context information, and use the representation of "[MASK]" as the context-related feature; both representations are regarded as positive example pairs for the model to learn different patterns of different instances during the training process.

[0118] It should be noted that the model divides event mentions into trigger-related mentions that can be directly recognized from trigger words and context-related mentions that can only be recognized through context information; the SaliencyED model designs a threshold based on word saliency to divide event labels into these two types, but there are some event types that may contain both trigger-related and context-related event mentions, so the problem should be solved at the word level rather than the category level. Since trigger-related mentions are trigger words that can clearly express the meaning of an event, they have a high similarity with the semantics of the corresponding labels.

[0119] In the embodiment of the present application, the above step S400 includes the following sub-steps D1-D5;

[0120] In D1: Combine the contrast loss and the classification loss to train the event detection model;

[0121] In D2: Among them, the contrast loss is defined as a positive example set, including all symbol representations with the same event type as each symbol, as well as the label embedding and mask embedding corresponding to each symbol;

[0122] In D3: For each positive example in the positive example set, calculate the similarity between each positive example and the processed symbol representation of each symbol;

[0123] In D4: For other symbol representations, calculate the similarity between other symbol representations and the processed symbol representation of each symbol, and sum them to obtain the total similarity;

[0124] In D5: Divide the similarity of the positive example by the total similarity of other symbol representations, take the logarithm of the result to obtain a logarithmic value, sum the logarithmic values of all positive examples and take the negative value to obtain the contrast loss.

[0125] Specifically, given a mini-batch of N t symbols, for the i-th symbol w i , use the same mapping head and L2 norm to obtain the processed symbol representation Define the positive example set as where and represent the label embedding and mask embedding corresponding to the event type of the i-th symbol respectively, and the contrast loss is expressed as:

[0126]

[0127] where, τ ′ is a balancing parameter;

[0128] It is a mixture of supervised and self-supervised contrastive learning. Since both label information and data augmentation methods are used to generate positive examples, the contrastive loss and the classification loss are combined to train the event detection model, which is expressed as:

[0129]

[0130] where θ is the parameter of the model, and β is the trade-off parameter used to balance the loss.

[0131] It should be noted that the contrastive loss optimizes the similarity relationship between symbolic representations, enabling the model to better distinguish different event types. By incorporating label embeddings and masked embeddings into the positive example set, the model can learn the semantic features of event types from multiple perspectives, not only enhancing the model's semantic understanding ability and the accuracy of event detection, but also improving the model's robustness and generalization ability.

[0132] The above is a schematic solution of an event detection method in this embodiment. It should be noted that the technical solution of this event detection system belongs to the same concept as the technical solution of the above event detection method. For the details not described in the technical solution of this event detection system in this embodiment, reference can be made to the description of the technical solution of the above event detection method.

[0133] The event detection system in this embodiment includes:

[0134] An encoding module, configured to obtain the detection text and encode the detection text using a first language model to obtain a first encoding;

[0135] A multi-label classification module, configured to perform multi-label classification on the first encoding, and process the classified result using multi-label contrastive learning to obtain a normalized label-aware embedding;

[0136] A feature extraction module, configured to extract first relevant features based on the normalized label-aware embedding;

[0137] An event detection module, configured to use the first relevant features as sample pairs, enhance the sample representation through contrastive learning, and train an event detection model in combination with a loss function to obtain an optimized event detection model to achieve the detection of specific events in the text.

[0138] This embodiment also provides a computing device applicable to the event detection scenario, including:

[0139] A memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the event detection method proposed in the above embodiment.

[0140] This embodiment also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the event detection method proposed in the above embodiment.

[0141] The storage medium proposed in this embodiment and the event detection method proposed in the above embodiment belong to the same inventive concept. For technical details not described in detail in this embodiment, reference can be made to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0142] From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general-purpose hardware, and of course, it can also be implemented by hardware. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes 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 floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk, or optical disc of a computer, etc., including several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0143] Embodiment 2

[0144] Referring to Tables 1-2, the difference between this embodiment and the first embodiment is that a verification test of an event detection method is provided to verify and explain the technical effects adopted in this method.

[0145] Experiments of this method were conducted on two widely used benchmark datasets, ACE2005 and MAVEN. Among them, ACE2005 contains more than 4,000 event mentions in 599 documents. MAVEN contains 70,852 sentences, and its event types exceed 100. This method was compared with the currently excellent baseline models on these two datasets;

[0146] ACE2005: This method compares the proposed PKEED with data-driven and knowledge-driven baselines. DMCNN and JRNN are traditional data-driven methods that use convolutional neural networks (with dynamic multi-pooling components) and recurrent neural networks respectively to extract events. ANN-S2 introduces supervised attention using argument information. DYGIE++ builds a graph-based model to capture local and global context. TriggerQA transforms the ED task into a question-answering task (QA) and uses machine reading comprehension to solve the problem. OneIE constructs an event graph to learn global features, and BERTEns is a framework that integrates two BERT models. As the state-of-the-art method, SaliencyED classifies event types into context-related and trigger-word-related based on word saliency and designs different strategies to handle these two cases.

[0147] MAVEN: This method maintains the same settings as previous studies and compares PKEED with the following baselines: DMCNN, BiLSTM, BiLSTM+CRF, MOGA-NED, DMBERT, SaliencyED, and CLEVE. Among them, CLEVE conducts contrastive pre-training on large-scale external resources, and the results of the comparative experiments are shown in Tables 1 and 2;

[0148] Table 1 Performance of each model on the ACE2005 test set

[0149]

[0150]

[0151] Table 2 Performance of each model on the MAVEN test set

[0152]

[0153] As shown in Tables 1 and 2, the PKEED model proposed in this method performs significantly better than various baseline methods (F1 score of 77.1 on ACE2005 and F1 score of 68.5 on MAVEN), demonstrating the effectiveness of the knowledge-enhanced ED model;

[0154] The performance of PLM-based models (DYGIE++, TriggerQA, OneIE, BERTEns, SaliencyED, and the PKEED of this method) is better than that of traditional neural network-based models, indicating the effectiveness of pre-trained knowledge in large-scale corpora. In addition, compared with ordinary data-driven methods, knowledge-driven methods have better performance, which shows that introducing existing knowledge to help ED models has good effects;

[0155] Compared with the CLEVE model which is trained using large-scale external resources, PKEED achieves similar performance without the need to use external resources and avoid the risk of introducing noise. Since the PKEED model extracts potential event types as prior knowledge, enabling the model to know which types to focus on, and through multi-contrast learning, PKEED can learn more meaningful representations from context-related views and trigger-word-related views.

[0156] 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 preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

Claims

1. An event detection method, characterized in that, Including: Obtain the detection text, encode the detection text using a first language model to obtain a first encoding; Perform multi-label classification on the first encoding, and use multi-label contrast learning to process the classified result to obtain a standardized label-aware embedding; Based on the standardized label-aware embedding, extract first relevant features; Use the first relevant features as sample pairs, enhance the sample representation through contrast learning, and train an event detection model in combination with a loss function to obtain an optimized event detection model to achieve the detection of specific events in the text.

2. The event detection method according to claim 1, wherein Encoding the detection text using a first language model includes: Use the first language model as a text encoder to represent sentences and words; Encode the sentence into a first sequence, and use the embedding of the classification token to represent the sentence embedding.

3. The event detection method according to claim 2, wherein Performing multi-label classification on the encoding result includes: For the event label of each sentence, define the event label as a one-hot vector; Input the sentence embedding into a linear classifier, and use a first loss function to optimize the multi-label event classification model to obtain a classification loss.

4. The event detection method according to claim 3, characterized in that, Using multi-label contrast learning to process the classified result includes: According to the sentence representation and label embedding output by the first language model, use the attention mechanism to obtain a label-aware embedding; Add a non-linear mapping head, input the label-aware embedding into a first multi-layer perceptron to obtain a standardized embedding; Combine the classification loss and the multi-label contrast loss to obtain an optimized event knowledge extraction model to achieve multi-label event knowledge extraction.

5. The event detection method according to claim 4, wherein The multi-label contrast loss includes: Denote each instance as the target instance, the positive example pair set contains instances with the same label as the target instance and is denoted as the first instance, and the other embedding set contains those other than the target instance and is denoted as the second instance; Calculate the dot product of the embedding vector of the target instance and the embedding vector of each first instance, divide the result by the temperature parameter, and take the exponent to obtain a first exponential value; Calculate the dot product of the embedding vector of the target instance and the embedding vector of each second instance, divide the result by the temperature parameter, and take the exponent to obtain an exponential value, and sum the exponential values of all second instances to obtain a second exponential sum; Divide the first exponential value by the second exponential sum, take the logarithm of the result, sum the logarithmic values of all positive example pairs and take the negative value to obtain the multi-label contrast loss.

6. The event detection method according to claim 4, wherein Extracting trigger word-related features and context-related features includes: Use the standardized label-aware embedding to represent trigger word-related features; Replace the original symbol with a mask token, and use the representation of the mask token as the context-related feature.

7. The event detection method according to claim 5 or 6, characterized in that Training the event detection model in combination with a loss function includes: Combine the contrast loss and the classification loss to train the event detection model; Among them, the contrast loss is defined as a positive example set, including all symbol representations with the same event type as each symbol, as well as the label embedding and mask embedding corresponding to each symbol; For each positive example in the positive example set, calculate the similarity between each positive example and the processed symbol representation of each symbol; For other symbol representations, calculate the similarity between other symbol representations and the processed symbol representation of each symbol, and sum them to obtain a similarity sum; Divide the similarity of the positive examples by the sum of the similarities of other symbolic representations, take the logarithm of the result to obtain a logarithmic value, sum the logarithmic values of all positive examples and take the negative value to obtain the contrastive loss.

8. A system applying the event detection method according to any one of claims 1-7, characterized in that, Including: An encoding module, configured to obtain the detection text, and encode the detection text by using a first language model to obtain a first encoding; A multi-label classification module, configured to perform multi-label classification on the first encoding, and process the classified result by using multi-label contrastive learning to obtain a normalized label-aware embedding; A feature extraction module, configured to extract first relevant features based on the normalized label-aware embedding; An event detection module, configured to use the first relevant features as sample pairs, enhance the sample representation through contrastive learning, and train an event detection model in combination with a loss function to obtain an optimized event detection model for detecting specific events in the text.

9. An electronic device, including: A memory and a processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the event detection method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the event detection method according to any one of claims 1 to 7 are implemented.