Event detection method and system and related equipment

By using the sample set of event subject and event action tags for training in the event detection model, the problem of difficult labels to be expanded and reused in the prior art is solved, and higher event detection accuracy and model robustness are achieved.

CN119494338APending Publication Date: 2025-02-21HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311022077.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the existing trigger word-based event detection methods, tags are difficult to expand and reuse, resulting in low event detection accuracy.

Method used

By using sample sets to train the event detection model, the model can recognize event subjects and event actions without relying on the annotation of the trigger word. This sample set includes event subject labels and event action labels, which enables the model to work effectively in different application scenarios.

Benefits of technology

The problem of tag expansion and reuse is solved, the accuracy of event detection and the robustness of the model are improved, and the dependence on trigger word annotation is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494338A_ABST
    Figure CN119494338A_ABST
Patent Text Reader

Abstract

The invention discloses an event detection method and system and related equipment, and the method comprises the following steps: obtaining a to-be-detected text input by a user, inputting the to-be-detected text into an event detection model, and obtaining an event main body and an event action of the to-be-detected text, the event main body comprising main body information in an event described by the to-be-detected text, the event action comprises action information executed by an event subject, the event detection model is obtained by training a sample set, and the sample set comprises an input text, an event subject tag corresponding to the input text and an event action tag; by using the sample set, the event detection model can have the capability of identifying the event main body and the event action from the text and does not depend on the labeling of the trigger word any more, even if an application scene is changed, the event detection model can obtain an event detection result of a new scene according to the identification capability of the event detection model, and the user experience is improved. Therefore, the problem that labels are difficult to expand and reuse in a current event detection method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence (AI), and in particular to an event detection method, system and related equipment. Background Art

[0002] Event detection is a technology that discovers important events from massive data. It can automatically extract some meaningful events from the data. These events can be natural disasters, social events, business events, etc. Through event detection, users can be informed of the occurrence of important events in a timely manner, so as to better deal with various situations. For example, in the business field, event detection algorithms can be used to monitor market changes to better specify business strategies; in the social field, event detection algorithms can be used to monitor the occurrence of social events to better understand the dynamic changes in society.

[0003] However, event detection usually requires first identifying trigger words from the text, and then dividing the text into different event types based on the trigger words to obtain event detection results. The trigger words here are defined as the words or phrases in the text that can most clearly express the occurrence of an event. However, selecting the "clearest" words as trigger words from a given text, especially long texts, not only tests the professional ability of the annotators, but also different annotators have different understandings of trigger words. For the same text, different annotators may mark different words as trigger words, resulting in trigger words that are difficult to identify or ambiguous. Once the trigger word is not identified accurately, the final event detection accuracy will be reduced. Summary of the invention

[0004] The present application provides an event detection method, system and related equipment, which are used to solve the problem of low event detection accuracy caused by current event detection based on trigger words.

[0005] In a first aspect, an event detection method is provided, the method comprising the following steps: obtaining a text to be detected input by a user, inputting the text to be detected into an event detection model, obtaining an event detection result of the text to be detected, the event detection result comprising an event subject and an event action, wherein the event subject comprises subject information in an event described by the text to be detected, and the event action comprises action information performed by the event subject, and the event detection model is obtained by training using a sample set, the sample set comprising the input text and an event subject label and an event action label corresponding to the input text.

[0006] The method described in the first aspect is implemented, by obtaining the text to be detected input by the user, and then inputting the text to be detected into the event detection model to obtain the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, and the event action includes the action information performed by the event subject, and then according to the event subject and the event action, the event detection result of the text to be detected is obtained, wherein the event detection model is trained using a sample set, and the sample set includes an event subject label and an event action label. Using such a sample set to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain the event detection result of the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in the current event detection method based on trigger words.

[0007] In a possible implementation, the event subject is the subject in the event described by the text to be detected, and the event action is the predicate in the event described by the text to be detected.

[0008] In a specific implementation, the subject and predicate can be the original subject and predicate in the text to be detected, or the subject and predicate of a generalized event obtained by summarizing and superpositioning the event described in the text to be detected. The subject can be a noun, a pronoun, a numeral, a nominalized adjective, etc. For example, an enterprise, a stock market, a market, an economic indicator, etc. can all be used as the event subject, and the predicate can be the action, state, attribute, etc. of the event subject, such as a verb, an adjective, etc., such as listing, mergers and acquisitions, investment, release, decline, rise, etc., which is not specifically limited in this application.

[0009] For example, the text to be detected is: "The market quotation fell nearly four points in one day, traders were not active in purchasing, and the skeleton of listed companies in the industry has fallen by 30%. Then the event detection result obtained by using the event detection model provided by this application includes the event subject and event action, wherein the event subject is "global stock market" and the event action is "decline". For another example, the text to be detected is: "On that day, the average price of domestic metal cobalt market was 617,500 yuan / ton, a single-day drop of 23,000 yuan / ton." Then the event subject in the event detection result is "global gold market" and the event action is "decline". The above examples are for illustration and are not specifically limited in this application.

[0010] Optionally, the text to be detected may contain multiple subjects and predicates, but the event subject and event action are the most representative subjects and predicates in the text to be detected. For example, assuming the text to be detected is: "The National Bureau of Statistics said on Tuesday that the consumer price index fell 0.05% from February", the subjects in the sentence include "National Bureau of Statistics" and "Consumer Price Index", and the predicates include "indicates" and "decline", then according to the context of the sentence and the semantics of the sentence, it can be determined that the actual meaning of the sentence is "the consumer price index has fallen", so the event subject label of the sentence is "Consumer Price Index", and the event action label is "decline". The above examples are for illustration and are not specifically limited in this application.

[0011] Optionally, there are also deviations between the event subjects and event actions of the text to be detected in different application scenarios. For example, in the financial field, the event subjects are more index parameters in the financial field, such as the consumer price index, global oil prices, annual inflation rate, global stock market, global gold market, etc. Event actions are more actions in the financial field, such as rise, fall, mergers and acquisitions, investment, etc. In the field of natural disasters, the event subjects are more place names where disasters occur, such as Wenchuan, Zhengzhou, Xiamen, etc., and event actions are more names of natural disasters, such as earthquakes, rainstorms, typhoons, etc. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0012] The above implementation method, by defining the label of the sample as the event subject label and the event action label, and then using such labeled samples to train the event detection model, can enable the event detection model to have the ability to identify the event subject and event action from the text, and no longer rely on the annotation of the trigger word. In this way, even if the application scenario is changed, the event detection model can obtain the event detection results of the new scenario based on its ability to identify the event subject and event action, thereby solving the problem that the labels in the current event detection method based on trigger words are difficult to expand and reuse. Secondly, the labels obtained by this annotation method make the distribution of sample data denser than the labels obtained by the traditional mode. The dense distribution of samples means that there are abundant sample points in the same feature space. The model can learn the details of the feature space from the abundant sample points, and then learn the decision boundaries and key features of the corresponding categories of the feature space, thereby producing more accurate classification results. In contrast, when the sample distribution is sparse, the model may not be able to obtain enough information to accurately identify and classify. Therefore, the labeled samples provided in this application are beneficial to the training and feature learning of the model. Finally, this annotation method requires fewer annotations and can improve annotation efficiency. In the traditional trigger-word-based event detection method, annotators need to annotate trigger words and event type labels for each text. For an input sample of M event subjects and N event actions, there are MN possible event combinations in the input sample, and the annotators need to annotate MN times. However, when the method provided in this application is used to annotate event subjects and event actions, only M+N times of annotation are required, and the number of annotations required by the annotators is reduced, thereby improving the annotation efficiency of the annotators.

[0013] In one possible implementation, the event detection model is a first model obtained after adversarial training of a neural network using a sample set. The adversarial samples used in the adversarial training process are obtained by performing sample perturbations on labeled samples in the sample set. The labels of the adversarial samples are the same as the labels of the labeled samples before the adversarial samples are perturbed.

[0014] In the above implementation, during the adversarial training process, a slightly perturbation is performed on the labeled sample set to generate adversarial samples. The event subject label and / or event action label of the adversarial sample is the same as that of the labeled sample before the perturbation. This can further increase the density of samples of the same category, thereby improving the model prediction performance and robustness in the case of few samples.

[0015] In one possible implementation, the sample perturbation method refers to making a slight perturbation to the input sample to obtain an adversarial sample, the label of which remains unchanged from the label of the input sample, thereby realizing adversarial training of the event detection model. In other implementations, perturbations in the direction of gradient ascent may be added to the input vector of the embedding layer, and the label of the perturbed input vector is consistent with the label of the input vector before the perturbation, thereby realizing adversarial training of the event detection model.

[0016] In a specific implementation, the vector generated by the embedding layer can be slightly adjusted to introduce some subtle changes without changing the overall semantic information of the input sample. For example, the perturbation vector is added to the original vector in the embedding layer to obtain the perturbed embedding vector, wherein each perturbation vector can be obtained based on the original gradient vector. This not only changes the vector value to a certain extent, but also the direction of change is related to the direction of the gradient, thereby achieving the purpose of adding perturbations in the direction of gradient ascent in the embedding layer. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0017] The above implementation method, by adding a perturbation in the upward direction of the gradient to the vector in the embedding layer, can more accurately change the vector representation, avoid excessive perturbation, and ensure that the label of the embedding vector after the perturbation is the same as the label of the vector before the perturbation, which can further increase the sample density in the same data area, thereby achieving the purpose of data enhancement and improving the prediction effect of the model in the case of few samples. At the same time, since adversarial samples are challenging to the event detection model and can cause the recognition accuracy of the event detection model to decrease, the event detection model can be trained in this way, so that the final event detection model has stronger robustness.

[0018] In one possible implementation, the event detection model is obtained by using self-training samples to perform adversarial training on the first model, the labels of the self-training samples are prediction results obtained by using the first model to predict unlabeled samples, and the confidence of the labels of the self-training samples is higher than a first threshold.

[0019] In the above implementation, self-training samples are samples whose confidence levels are higher than a first threshold. The sample labels of the self-training samples are obtained by using the first model to predict unlabeled samples. The confidence level of the samples is higher than the first threshold, indicating that the prediction result of the first model for the samples is highly accurate. Since such samples do not require manual labeling, a large number of self-training samples can be obtained to conduct further adversarial training on the event inspection model, thereby further increasing the sample density and improving the performance of the event inspection model.

[0020] In one possible implementation, the event detection model is obtained by adversarial training of active learning samples against the first model, and the labels of the active learning samples are obtained by manually annotating unlabeled samples, and the unlabeled samples are difficult samples for the first model.

[0021] In a possible implementation, the information entropy of the prediction result of the first model for the active learning sample is higher than the second threshold.

[0022] In the specific implementation, difficult samples refer to samples that are difficult for the model to learn or classify. These samples may have complex features that make it difficult for the model to learn the classification features, or the sample has a high similarity with samples of other categories, making it difficult for the classifier to classify. Usually, difficult samples are determined by judging the gap between the predicted result and the true value. The larger the gap, the higher the difficulty of the difficult sample. However, the unlabeled samples in this application are samples without true values, so this application determines the difficult samples by judging the information entropy of the pseudo-labels of the unlabeled samples.

[0023] In the specific implementation, the higher the information entropy of the prediction result, the greater the uncertainty of the event detection model in predicting the unlabeled sample. The prediction result given by the event detection model shows that the probabilities of different categories to which the sample belongs show a certain balance, or the probability distribution of the prediction result is relatively uniform. For example, assuming that the prediction result of the event detection model for the unlabeled sample is (0.3, 0.3, 0.4), although the prediction result shows that the sample belongs to the third category, the probability of belonging to the third category is only 40%, the probability of belonging to the first category is 30%, and the probability of belonging to the second category is 30%. This means that the event detection model has difficulty in predicting the unlabeled sample. Using manually annotated information entropy samples exceeding the second threshold for training can provide the model with richer information, which is beneficial to optimizing the model.

[0024] In a possible implementation, the active learning sample may also include a boundary sample, wherein the boundary sample may be a special case of a difficult sample, which is a sample that is difficult for the model to classify. Specifically, in the feature space, there is a small gap between the feature representation of the sample and the feature representation of samples of different categories, so the category attribution of the boundary sample is relatively vague or uncertain, making it difficult for the model to correctly classify. In a specific implementation, the KL divergence (KLD) between the prediction result of the first model for the active learning sample and the prediction result of the first model for the adversarial sample of the active learning sample is higher than the third threshold. The KL divergence is the KL divergence between the unlabeled sample 222 and its adversarial sample. When the KL divergence between the unlabeled sample and its corresponding adversarial sample is higher, it means that the difference between the two is greater, then the adversarial sample of the unlabeled sample contains more new and useful information relative to the unlabeled sample, which is more conducive to adversarial training and beneficial to the optimization model, so the unlabeled sample and the corresponding adversarial sample can be used as active learning samples to participate in the optimization of the event inspection model.

[0025] It should be understood that self-training samples and adversarial samples can increase the density of samples, but they do not solve the boundary problem of model classification well. When encountering difficult samples, they may not be able to give correct or high-confidence results. Therefore, the performance of the model can be further improved by manually labeling some difficult samples and boundary samples. It should be noted that active learning samples can also be difficult samples and boundary samples obtained by other means. The difficult samples and boundary samples determined by the information entropy and KL divergence of the samples are an exemplary implementation method, and this application does not make specific limitations.

[0026] In a possible implementation, the event detection model is obtained by alternately using self-training samples and active learning samples to perform adversarial training on the first model.

[0027] Optionally, the above-mentioned alternating training refers to alternating the use of self-training samples and active learning samples to perform multiple rounds of training on the event detection model, for example, odd rounds use self-training samples for training, even rounds use active learning samples for training, or even rounds use active learning samples for training, odd rounds use self-training samples for training. Alternatively, the first 3 rounds use self-training samples for training, the next 3 rounds use active learning samples for training, then 3 rounds use self-training samples for training, then 3 rounds use active learning samples for training, and so on, which is not specifically limited in this application.

[0028] In the above implementation, the labels of the self-training samples are the prediction results of the first model for the unlabeled samples, and the labels of the active learning samples are manually annotated labels. Therefore, some labels of the self-training samples may be inaccurate and have certain noise. By alternately using the self-training samples and the active learning samples to train the first model, the noise effect brought by the self-training samples can be gradually corrected. Each round of manually annotated active learning samples can help correct the errors that may be introduced by the previous self-training samples, strengthen the influence of these accurate labels, and the model can better learn the laws in the real situation and improve the accuracy and robustness of the model. At the same time, if the self-training samples are used for multiple rounds, the model may pay too much attention to certain specific laws, causing the model to pay too much attention to known laws and unable to effectively handle new unknown situations. The alternating training method can effectively reduce the model's dependence on specific laws and improve the model's generalization ability to different situations.

[0029] In a second aspect, an event detection system is provided, which includes: an acquisition unit for acquiring a text to be detected input by a user; a detection unit for inputting the text to be detected into an event detection model to obtain an event detection result of the text to be detected, wherein the event detection result includes an event subject and an event action, wherein the event subject includes subject information in the event described by the text to be detected, and the event action includes action information performed by the event subject, and the event detection model is obtained by training using a sample set, and the sample set includes the input text and the event subject label and event action label corresponding to the input text.

[0030] The method described in the second aspect is implemented, by obtaining the text to be detected input by the user, and then inputting the text to be detected into the event detection model to obtain the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, and the event action includes the action information performed by the event subject, and then according to the event subject and the event action, the event detection result of the text to be detected is obtained, wherein the event detection model is trained using a sample set, and the sample set includes an event subject label and an event action label. Using such a sample set to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain the event detection result of the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in the current event detection method based on trigger words.

[0031] In a possible implementation, the event subject is the subject in the event described by the text to be detected, and the event action is the predicate in the event described by the text to be detected.

[0032] In one possible implementation, the event detection model is a first model obtained after adversarial training of a neural network using a sample set. The adversarial samples used in the adversarial training process are obtained by performing sample perturbations on labeled samples in the sample set. The labels of the adversarial samples are the same as the labels of the labeled samples before the adversarial samples are perturbed.

[0033] In one possible implementation, the event detection model is obtained by using self-training samples to perform adversarial training on the first model, the labels of the self-training samples are prediction results obtained by using the first model to predict unlabeled samples, and the confidence of the labels of the self-training samples is higher than a first threshold.

[0034] In one possible implementation, the event detection model is obtained by adversarial training of active learning samples against the first model, and the labels of the active learning samples are obtained by manually annotating unlabeled samples, and the unlabeled samples are difficult samples for the first model.

[0035] In a possible implementation, the information entropy of the prediction result of the first model for the active learning sample is higher than the second threshold.

[0036] In one possible implementation, a KL divergence between a prediction result of the first model for the active learning sample and a prediction result of the first model for the adversarial sample of the active learning sample is higher than a third threshold.

[0037] In a possible implementation, the event detection model is obtained by alternately using self-training samples and active learning samples to perform adversarial training on the first model.

[0038] In a third aspect, a computing device is provided, which includes a processor and a memory, the memory is used to store instructions, and the processor is used to execute instructions, so that the computing device implements the method described in the first aspect.

[0039] In a fourth aspect, a computing device cluster is provided, which includes at least one computing device, each of the at least one computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster implements the method described in the first aspect.

[0040] In a fifth aspect, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed by a computing device or a computing device cluster, the method described in the first aspect is implemented.

[0041] In a sixth aspect, a computer program product comprising instructions is provided, wherein the computer program product includes instructions that can be run on a computing device or software or a program product stored in any available medium, and when the computer program product is run on a computing device or a computing device cluster, the computing device or the computing device cluster executes the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is an architecture diagram of an event detection system provided by this application;

[0043] Figure 2 It is a schematic diagram of the steps of an event detection method provided by the present application;

[0044] Figure 3 This is a labeled example diagram of an event detection method provided by the present application in an application scenario;

[0045] Figure 4 It is a schematic diagram of the steps of a training method for an event detection model provided in the present application;

[0046] Figure 5 It is a flow chart of the steps for obtaining self-training samples and active learning samples in an event detection method provided by the present application;

[0047] Figure 6 This is an exemplary interface display diagram of the event detection method provided by the present application;

[0048] Figure 7 It is a structural schematic diagram of a computing device provided by this application. DETAILED DESCRIPTION

[0049] First, some terms involved in the embodiments of the present application are explained.

[0050] Trigger word: In event detection, for a text, the word or phrase that can most clearly express the occurrence of an event is the trigger word of the text.

[0051] Adversarial training: refers to the method of constructing adversarial samples during the model training process and mixing adversarial samples with original samples to train the model. Its purpose is to improve the model's defense capabilities against adversarial attacks.

[0052] Gradient descent algorithm: Gradient descent is an iterative algorithm for finding the optimal solution of linear and nonlinear models. In calculus, the gradient vector of a multivariate function can be obtained by expressing the partial derivatives of each parameter of the multivariate function in the form of a vector. It is easier to find the maximum value of the function along the direction of the gradient vector, and it is easier to find the minimum value of the function along the direction of the gradient vector descent. In machine learning, it is necessary to construct a loss function for the model in training. The loss function is determined based on the gap between the output of the model and the true value. The smaller the loss function, the smaller the gap between the output of the sample and the true value, and the better the performance of the model. The minimum value of the loss function can be found through the gradient descent algorithm, so the gradient descent algorithm is also a commonly used algorithm in machine learning.

[0053] Embedding layer: The embedding layer is a layer in the neural network structure, usually located after the input layer, or directly as the input layer in the first layer of the model. Its specific location can be determined according to the model architecture and task requirements. Its function is to map the input text into a vector and retain the semantic information of the text as much as possible. In some embodiments, the embedding layer can further reduce or increase the dimension of the mapped vector so that the output vector contains not only the semantic information of the text, but also the intrinsic relationship between characters, words, and sentences. In other words, the embedding layer can encode the semantic information of the text in the semantic space into vectors. The distance and angle relationship of these vectors in the high-dimensional space reflects the semantic similarity and association of words. In this way, the input discrete text is converted into a dense vector representation, providing the model with richer semantic information.

[0054] Secondly, the application scenario "event detection" involved in this application is explained.

[0055] Event detection is a common semantic analysis task in the field of natural language processing. Its purpose is to detect whether a text is related to a certain type of event. Usually, event detection needs to be implemented based on trigger words. The trigger word here is defined as the word or phrase that most clearly expresses the occurrence of an event. Therefore, the current event detection algorithm needs to first identify the trigger word in the sentence, and then classify the sentence into different event types based on the trigger word to obtain the event detection result, where the event type here is predefined. For example, N types of event types are predefined. Text A is: "Gasoline prices fall in line with the world oil price", and the trigger word here can be "fall". According to the trigger word, the event type corresponding to the text A is obtained as "oil price fall". Text B is: "The consumer price index fell 0.05% from February", and the trigger word here can be "fall", and the corresponding event type is "consumer price index fall".

[0056] From the above examples, we can see that the event detection algorithm needs to mark the trigger words and event types in the training data. However, selecting the "clearest" word as the trigger word from a given text, especially a long text, not only tests the professional ability of the annotator, but also different annotators have different understandings of trigger words. For the same text, different annotators may mark different words as trigger words, resulting in the trigger words being difficult to identify or ambiguous. Once the trigger word is not identified accurately, the final event detection accuracy will be reduced.

[0057] At the same time, since event types are pre-defined event types, each event type has its fixed semantic scope. The emergence of new event types will make it impossible for the system to accurately label these events. For example, the currently labeled samples are based on samples in the financial field. The model has learned that the event type of text A is "the consumer price index has fallen." Then for text C "an earthquake occurred," the model cannot perform event detection on this sentence based on the knowledge obtained from text A, because the event type "the consumer price index has fallen" has nothing to do with text C, making it difficult to expand and reuse the labels in the event detection algorithm, and unable to quickly adapt to new business needs based on existing event types and trigger words.

[0058] In summary, the samples of current event detection algorithms need to be labeled with trigger words and event types. Such samples are not only difficult to label manually, but also the labels are difficult to expand and reuse, resulting in a small number of samples and high labeling costs, which affects the development of event detection algorithms.

[0059] In order to solve the problems of small number of samples and high annotation cost in the field of event detection, the present application provides an event detection solution, which obtains the text to be detected input by the user, and then inputs the text to be detected into an event detection model to obtain the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, and the event action includes the action information performed by the event subject, and then obtains the event detection result of the text to be detected based on the event subject and the event action, wherein the event detection model is trained using a sample set, and the sample set includes an event subject label and an event action label. Using such a sample set to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain the event detection result of the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in current event detection methods based on trigger words.

[0060] The technical solution to be protected by this application is described in detail below with reference to the accompanying drawings.

[0061] Figure 1 This is an architecture diagram of an event detection system provided by this application, such as Figure 1 As shown, the architecture includes a client 100, an event detection system 200, and an application system 300, wherein the client 100, the event detection system 200, and the application system 300 establish a communication connection through a network, which may be a wired connection or a wireless connection, which is not specifically limited in this application. The number of clients 100 and application systems 300 that establish a communication connection with the event detection system 200 may be one or more, which is not specifically limited in this application.

[0062] The client 100 is used to realize human-computer interaction and can be deployed on terminal devices, including personal computers, smart phones, wearable devices, handheld processing devices, tablet computers, mobile notebooks, augmented reality (AR) devices, virtual reality (VR) devices, integrated handheld devices, wearable devices, vehicle-mounted devices, smart conference devices, smart advertising devices, smart home appliances, etc. Smart home appliances can be sweeping robots, mopping robots, etc., which are not specifically limited here.

[0063] In a specific implementation, the above-mentioned client 100 can be a software or application running on a terminal device or computing device controlled by a user, such as a personal computer (PC) client, or a web client accessed based on a browser, or an application (APP) client running on a mobile terminal, which is not specifically limited in this application.

[0064] Optionally, the client 100 may be a client specifically used for event detection, or a client of some data analysis applications that include event detection functions. This type of client needs to perform event detection on data in the network, extract some meaningful events from the data, and implement certain data analysis applications based on this. For example, the client 100 may be a client of a public opinion monitoring system. Enterprises can use this client to understand consumer needs, thereby adjusting marketing and corporate strategies. The government can use this client to understand public opinion feedback, hot events, etc., thereby formulating policies that better meet public needs. The media can use this client to understand social hot events, news reporting effects, etc., thereby adjusting reporting strategies and news content. It should be understood that the above examples are used for illustrative purposes, and the above-mentioned applications that include event detection functions are not limited to the clients of the above-mentioned public opinion detection system, but can also be other types of clients. For example, in the medical field, it can be a client that can detect disease outbreaks and health trends by analyzing medical literature through event detection. In the transportation and urban planning field, it can be a client that can detect traffic congestion and urban planning problems by analyzing social media and traffic data through event detection. In the scientific research field, it can be a client that can timely discover new scientific discoveries, research trends and knowledge evolution through event detection of scientific literature, academic papers and patent data, and so on. Examples are not given here one by one.

[0065] Optionally, the client 100 can also be a console of the cloud platform, which, as a sub-service of the cloud platform, provides the user with a message event detection function, and the user can use the function of the event detection method provided by the present application by purchasing the cloud service. The console can be a web-based client, an application client, or an application programming interface (API), which is not specifically limited in the present application.

[0066] The event detection system 200 and the application system 300 can be deployed on a computing device, a computing device cluster or a terminal device, wherein the computing device includes a bare metal server (BMS), a virtual machine, a container or an edge computing device. BMS refers to a general physical server, such as an ARM server or an X86 server; a virtual machine refers to a complete computer system with complete hardware system functions and running in a completely isolated environment simulated by software. All the work that can be done in a physical computer can be done in a virtual machine. When creating a virtual machine in a computing device, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent basic input / output system (CMOS), hard disk and operating system, and can operate the virtual machine like a physical machine; a container is a portable software unit that can merge an application and all its dependencies into a software package that is not limited by the underlying host operating system, so there is no need to build a complex environment, simplifying the process from application development to deployment; an edge computing device refers to a device that is closer to the data source and end user, with low latency and high bandwidth characteristics, such as smart routing, edge servers, etc. The computing device cluster may include multiple computing devices as described above, such as a data center, which is not specifically limited in this application; the description of the terminal device can refer to the aforementioned content and will not be repeated here.

[0067] Among them, the event detection system 200 is used to perform event detection on the data sent by the client 100 to obtain the event detection result. The application system 300 is used to receive the event detection result output by the event detection system 200, further process the event detection result, and obtain the processing result. Among them, the application system 300 can be a data processing system that generates a knowledge graph or an event context, and the processing result here can be a knowledge graph or an event context, and the processing result can be sent to other application systems 300 for further data processing; the application system 300 can also be an application service system that produces data analysis results, and the processing result here can be a data analysis result that can be sent to the client 100. For example, if the client 100 is a client of the public opinion detection system, then the application system 300 is used to perform a series of processing according to the event detection result to generate the public opinion detection report required by the user, such as a corporate financial report, a social hot spot report, etc. It should be understood that different application systems 300 can implement different functions based on the event detection results, and this application does not limit the specific type of the application system 300.

[0068] Optionally, the event detection system 200 and the client 100 can be deployed on the same terminal device; or, the event detection system 200 is deployed on a computing device and the client 100 is deployed on a terminal device; or, the event detection system 200 is deployed on a computing device cluster and the client 100 is deployed on a terminal device. It should be understood that the above examples are for illustration only, and the specific deployment of the event detection system 200 and the client 100 can be determined based on the actual application scenario.

[0069] Optionally, the event detection system 200 and the application system 300 can be deployed on the same computing device; or, the event detection system 200 and the application system 300 are deployed on different computing devices in the same computing device cluster; or, the event detection system 200 and the application system 300 are deployed on different computing devices in different computing device clusters, which is not specifically limited in this application. For example, the event detection system 200 can be any one in a data center, and the application system 300 is deployed on another computing device in the data center, or the application system 300 is deployed in another data center, and the above examples are for illustration only and are not specifically limited in this application.

[0070] Further, Figure 1 The event detection system 200 in the embodiment can be further divided into a plurality of unit modules. For example, Figure 1 is a schematic diagram of the structure of the event detection system 200 provided in this application, such as Figure 1 As shown, the event detection system 200 may include a first expansion unit 211, a training unit 212, a second expansion unit 213, a third expansion unit 214, an acquisition unit 215, a detection unit 216 and a sending unit 217. It should be understood that Figure 1 This is an exemplary division method. The event detection system 200 may also include more or fewer units. For example, the event detection system 200 may also include a sample labeling unit, which is connected to the third expansion unit 214 and is used to feed back the active learning samples screened by the third expansion unit 214 to the user for manual correction, or to merge the second expansion unit 213 and the third expansion unit 214 into one expansion unit. It should be understood that the above examples are for illustration, and the unit module can be determined specifically according to the actual application scenario, and this application does not make any specific limitations.

[0071] Among them, the first expansion unit 211, the training unit 212, the second expansion unit 213, the third expansion unit 214, the acquisition unit 215, the detection unit 216 and the sending unit 217 can be implemented by software or by hardware. Exemplarily, the implementation of the training unit 212 is described below by taking the training unit 212 as an example. Similarly, the implementation of the first expansion unit 211, the second expansion unit 213, the third expansion unit 214, the acquisition unit 215, the detection unit 216 and the sending unit 217 can refer to the implementation of the training unit 212.

[0072] The training unit 212 is an example of a software functional unit. The training unit 212 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the training unit 212 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code may be deployed in the same data center or in different data centers. When the multiple hosts / virtual machines / containers for running the code are deployed in different data centers, the different data centers may be distributed in the same region or in different regions. The region here is used to describe the location of the data center. The data centers in the same region share public services such as elastic computing, block storage, and object storage. The different data centers may also be distributed in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple data centers with similar geographical locations. An AZ is a collection of one or more physical data centers with independent wind, fire, water, and electricity. The computing, network, storage, and other resources are logically divided into multiple clusters within the AZ. Usually, a region can include multiple AZs, and multiple AZs in a region are connected by high-speed optical fibers to meet the needs of users to build high-availability systems across AZs.

[0073] The training unit 212 is an example of a hardware functional unit. The training unit 212 can also be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. For example, the training unit 212 can be implemented by a data processing unit (DPU), which is not limited in the present application.

[0074] Need to explain, Figure 1 The structure shown may be an implementation method in which the event detection system 200 is deployed on a single computing device. When the event detection system 200 is deployed on a computing device cluster composed of multiple computing devices, different computing devices in the computing device cluster may respectively store instructions for implementing the first expansion unit 211, the training unit 212, the second expansion unit 213, the third expansion unit 214, the acquisition unit 215, the detection unit 216, and the sending unit 217. For example, the computing device A in the computing device cluster stores the instructions of the first expansion unit 211, the training unit 212, the second expansion unit 213, and the third expansion unit 214, and the computing device B stores the instructions of the acquisition unit 215, the detection unit 216, and the sending unit 217. This application does not make specific limitations. Of course, different computing devices may also store the same instructions, such as computing device B and computing device C both store the instructions of the acquisition unit 215, the detection unit 216, and the sending unit 217, which are used to implement the functions of the acquisition unit 215, the detection unit 216, and the sending unit 217 in combination. This application does not make specific limitations.

[0075] Among them, the first expansion unit 211, the training unit 212, the second expansion unit 213 and the third expansion unit 214 are used to train the event detection model, and run in the model training phase, and the acquisition unit 215, the detection unit 216 and the sending unit 217 are used to use the event detection model for reasoning, and run in the model reasoning phase. The functions of each unit module in the event detection system 200 are described below.

[0076] The first expansion unit 211 is used to generate adversarial samples according to the labeled samples 221 .

[0077] The labeled samples 221 include input samples and labels, wherein the input samples include input text, which can be a sentence, paragraph or article. The source of the input text can include any text such as news reports, social media, blog posts, papers, patent documents, etc., which is not specifically limited in this application. It should be noted that the above input text can be obtained after sending an application to a user or relevant department and obtaining approval and authorization. Unauthorized and unapproved text cannot be used as a sample for training.

[0078] Furthermore, the above-mentioned tags include event subject tags and event action tags, wherein the event subject tags include the subject information in the event described by the input text, which may specifically be the issuer of the action in the event expressed by the input text, or the owner of the state in the event expressed by the input text; the event action tags include the action information performed by the event subject, which may specifically be the specific action taken by the event subject or the state of the event subject in the event expressed by the input text.

[0079] In a possible implementation, the event subject label and the event action label can be the original words in the input text, wherein the event subject label can be the subject of the sentence in the text, such as nouns, pronouns, numerals, nominalized adjectives, etc. For example, enterprises, stock markets, markets, economic indicators, etc. can all be used as event subject labels. The event action label can be the predicate of the sentence in the text, used to explain the action, state, attributes, etc. of the event subject, such as verbs, adjectives, etc., such as listing, mergers and acquisitions, investment, release, decline, rise, etc., which are not specifically limited in this application.

[0080] Optionally, the event subject label and event action label of the input text can be determined in combination with the semantics and context of the input text. It should be understood that the number of subjects and predicates contained in the input text can be multiple, and not every subject and predicate are event subject labels and event action labels. The event subject label and event action label of the input text can be the most representative subjects and predicates in the input text. For example, assuming the input text is: "The National Bureau of Statistics said on Tuesday that the consumer price index fell 0.05% from February", the subjects in the sentence include "National Bureau of Statistics" and "Consumer Price Index", and the predicates include "indicates" and "decline", then according to the context of the sentence and the semantics of the sentence, it can be determined that the actual meaning of the sentence is "Consumer Price Index Decline", so the event subject label of the sentence is "Consumer Price Index" and the event action label is "Decline". The above examples are for illustration and are not specifically limited in this application.

[0081] Optionally, the event subject label and event action label of the input text can also be determined based on the specific application scenario. For example, in the financial field, the event subject label is more of some index parameters in the financial field, such as the consumer price index, global oil prices, annual inflation rate, global stock market, global gold market, etc. The event action label is more of some actions in the financial field, such as rising, falling, mergers and acquisitions, investment, etc. In the field of natural disasters, the event subject label is more of some place names where disasters occur, such as Wenchuan, Zhengzhou, Xiamen, etc., and the event action label is more of some natural disaster names, such as earthquakes, rainstorms, typhoons, etc. It should be understood that the above examples are for illustration and this application does not make specific limitations.

[0082] In a possible implementation, the event subject label and event action label can also be summarized according to the meaning of each sentence in the input text, the contextual relationship between sentences, and the actual application scenario to summarize the event subject and event action of the event expressed by the input text. For example, the input text is: "Mexico inflation eased in March, and gasoline prices fell in line with the world oil price." The main meaning of this text is the fall in oil prices. In this text, "Mexico inflation eased in March" is less important than "gasoline prices fell in line with the world oil price." Therefore, the event subject label of this text is "global oil prices" and the event action label is "fall." For another example, the input text is: "The US Federal Reserve Board ended its two-day monetary policy meeting on the 26th and announced that it would raise the target range of the federal funds rate by 25 basis points to between 5.25% and 5.5%." In this text, "the US Federal Reserve Board" is the subject, and its predicates are "end", "announce", and "increase". The text expresses that the "US Federal Reserve Board" did three things, one is to end the meeting, one is to announce the decision, and the other is to increase the federal funds rate. Combining these three things, it can be known that the actual meaning of the text is "the Federal Reserve raised interest rates", so the event subject label of the sentence is "the Federal Reserve" and the event action label is "rate increase". It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0083] It should be noted that the above event subjects and event actions are pre-defined, that is, the annotator can annotate samples according to the defined event subjects and event actions. For example, the text "Gasoline prices are consistent with the decline in world oil prices" is artificially summarized as the event described by the sentence "World oil prices have fallen", but the pre-defined event subject label is only "global oil prices" and the action subject is only "falling", so the label of the text is "global oil prices" and the event action label is "falling". It should be understood that each word has a large number of synonyms. By using unified labels, the burden of subsequent model training can be reduced and the efficiency and accuracy of model training can be improved.

[0084] It should be noted that for ease of understanding, the examples in this application are all based on Chinese examples. However, in actual applications, the technical solutions of this application are not limited to any language. As long as the technical solutions described in this application are used for sample annotation and model training, they can be included in the technical scope of protection to be applied for in this application.

[0085] It can be understood that in the labeled samples used in this application, the labels of the samples include event subjects and event actions. Using such labeled samples to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain event detection results for the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in current event detection methods based on trigger words.

[0086] At the same time, the labels obtained by the labeling method provided by the present application make the distribution of sample data denser than the labels obtained by the traditional mode. Specifically, the probability of the event type predefined in the traditional mode can be regarded as the joint probability p(x, y), the probability of the label event class provided by the present application is p(x), and the probability of the event action is p(y), combined with formula (1):

[0087] Among them, p(y|x) and p(x|y) are conditional probabilities, between 0 and 1, so P(x,y)<p(x), P(x,y)<p(y). Therefore, it can be obtained that the present application can make the sample distribution of the labeled samples 221 denser by marking the event subject labels and event action labels. The dense sample distribution means that there are abundant sample points in the same feature space. The model can learn the details of the feature space from the abundant sample points, and then learn the decision boundaries and key features of the corresponding categories of the feature space, thereby producing more accurate classification results. In contrast, when the sample distribution is sparse, the model may not be able to obtain enough information for accurate identification and classification. Therefore, the labeled samples 221 provided in the present application are beneficial to the training and feature learning of the model.

[0088] The adversarial sample is obtained based on the labeled sample 221. The adversarial sample can participate in the training of the event detection model together with the labeled sample 221, thereby increasing the number of samples and solving the problem of a small number of event detection samples.

[0089] In one possible implementation, the adversarial sample may be obtained by performing sample perturbation on the labeled sample 221, and the label of the adversarial sample obtained after perturbation on the labeled sample 221 is consistent with the label of the corresponding unperturbed labeled sample, thereby further increasing the density of samples of the same category.

[0090] In the specific implementation, since the label of the adversarial sample is consistent with the label of the corresponding unperturbed labeled sample, the adversarial sample and the corresponding unperturbed labeled sample are samples of the same category, so the sample perturbation performed on the labeled sample can be a subtle perturbation. These subtle perturbations can cause errors in the output results of the event detection model or reduce the accuracy of model recognition. In other words, the adversarial samples obtained by sample perturbation are challenging samples for the event detection model, which can further improve the performance of the event detection model.

[0091] Optionally, the content in the input text that is not related to the event subject label and the event action label can be modified, such as adjusting the event attributes, where the event attributes are fields that describe the specific details of the event, such as changing the time of the event from 8:10 to 8:15, or changing the indicator corresponding to the event from 98.1% to 98.2%, etc., which is not specifically limited in this application. It should be noted that the adversarial sample obtained after adjusting the event attributes in the input text can cause errors in the event detection model results or reduce the recognition accuracy of the event detection model. If the adversarial sample obtained after adjusting a certain event attribute cannot affect the event detection model, then the event attribute can be adjusted.

[0092] Optionally, the fields related to the event subject label or the event action label in the input text can also be adjusted, such as replacing synonyms, hypernyms or hyponyms, etc., so that the perturbed adversarial sample label is consistent with the label of its corresponding unperturbed labeled sample, such as modifying the field "decline" related to the event action label to the synonym "decline", or modifying the field "gross domestic product" related to the event subject label to "GDP", etc., which is not specifically limited in this application.

[0093] It should be understood that the labeling method provided in the present application enables the labeled samples to have event subject labels and event action labels, thereby decoupling the event category labels, making it easier to obtain adversarial samples of the same category as the samples before disturbance, and being more beneficial for making subtle perturbations to the labeled samples 221. This can further increase the density of the data, and the model can more accurately learn the decision boundaries and key features of each category, providing the model with more variation range and diversity, enabling the model to better generalize to unseen data and improve the generalization ability of the model.

[0094] Optionally, the above-mentioned sample perturbation method refers to making a slight perturbation to the input sample to obtain an adversarial sample, and the label of the adversarial sample is unchanged from the label of the input sample, so as to achieve adversarial training of the event detection model. In some other implementations, the perturbation in the direction of gradient ascent can also be added to the input vector of the embedding layer, and the label of the input vector after the perturbation is consistent with the label of the input vector before the perturbation, so as to achieve adversarial training of the event detection model.

[0095] As can be seen from the description in the reference terminology, the commonly used algorithm for machine learning models is the gradient descent algorithm. The training goal of the model is to obtain the minimum value of the loss function. Therefore, adding perturbations in the direction of gradient ascent can have a certain impact on the model performance, making the model more inclined to classify samples as incorrect category labels, thereby achieving the generation of adversarial samples. At the same time, as can be seen from the description of the embedding layer in the reference terminology section, the embedding layer is a technology that converts discrete input data (such as words, characters, etc.) into low-dimensional continuous vector representations. These low-dimensional continuous vectors also contain the semantic similarity and association of words in the input data, and during the model training process, the parameters in the embedding layer will be adjusted and updated as the training progresses, so that the model can better represent and understand the input data. Therefore, adding perturbations to the embedding layer can interfere with the model's ability to understand and represent input data, change the model's prediction results, and achieve the purpose of adversarial interference. It should be understood that if the perturbed adversarial sample is added directly to the input layer, the characteristics of the input data may be changed, causing the model to be unable to correctly understand the input data, resulting in unreasonable outputs and failure to achieve the purpose of subtle perturbations. Adding perturbations to the embedding layer can more accurately change the vector representation, avoid excessive perturbations, and ensure that the labels of the perturbed embedding vectors are the same as the labels of the vectors before the perturbations.

[0096] In a specific implementation, the vector generated by the embedding layer can be slightly adjusted to introduce some subtle changes without changing the overall semantic information of the input sample. For example, the perturbation vector is added to the original vector in the embedding layer to obtain the perturbed embedding vector, wherein each perturbation vector can be obtained based on the original gradient vector. This not only changes the vector value to a certain extent, but also the direction of change is related to the direction of the gradient, thereby achieving the purpose of adding perturbations in the direction of gradient ascent in the embedding layer. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0097] It should be understood that by adding perturbations in the upward direction of the gradient to the vector in the embedding layer, the vector representation can be changed more accurately, avoiding excessive perturbations, and ensuring that the labels of the perturbed embedding vectors are the same as the labels of the vectors before the perturbations. This can further increase the sample density in the same data region, thereby achieving the purpose of data enhancement and improving the prediction effect of the model in the case of few samples. At the same time, because adversarial samples are challenging to event detection models and can lead to a decrease in the recognition accuracy of event detection models, training the event detection model in this way can make the final event detection model more robust.

[0098] The training unit 212 is used to train the neural network using the sample set to obtain the first model, wherein the sample includes the labeled sample 221 and the adversarial sample generated by the first expansion unit 211. In a specific implementation, the first loss value can be determined based on the label and output result of the labeled sample 221, the second loss value can be determined based on the label and output result of the adversarial sample, and the event detection model is back-propagated according to the first loss value and the second loss value to obtain the first model.

[0099] In a specific implementation, the neural network includes but is not limited to a convolutional neural network (CNN), a recurrent neural network (RNN), a long short term memory network (LSTM), etc. It can also be a pre-trained network model, such as a bidirectional encoder representation from transformers (BERT) network model, a generative pre-trained transformer (GPT) network model, etc. The above examples are for illustration only and are not specifically limited in this application.

[0100] It should be understood that the training unit 212 performs adversarial training on the neural network based on the labeled sample 221. The label of the labeled sample 221 includes an event subject label and an event action label. The sample is densely distributed and has abundant sample points in the same feature space. The model can learn the details of the feature space from the abundant sample points. At the same time, by generating adversarial samples by slightly perturbing the labeled sample 221 through adversarial training, the density of samples of the same category can be further increased, thereby improving the model prediction performance and robustness in the case of few samples. Compared with the traditional event detection algorithm based on trigger words, the event detection method provided in the present application not only does not need to mark the trigger words, but also solves the problems of difficulty in manual marking and difficulty in label expansion and reuse caused by trigger words, and can improve the model prediction performance in the case of few samples.

[0101] In an embodiment of the present application, the first expansion unit 211 and the training unit 212 can obtain a first model by performing adversarial training on the labeled sample 221. Here, the first model can be obtained by training multiple rounds until the model converges, such as obtaining the first model after N rounds of training, or training until the model loss value reaches a threshold value. This application does not make specific limitations. Further, after obtaining the first model, the first model can be further optimized by the second expansion unit 213 and / or the third expansion unit 214 to obtain an event detection model. The second expansion unit 213 and the third expansion unit 214 are explained below.

[0102] The second expansion unit 213 is used to generate self-training samples according to the unlabeled samples 222 .

[0103] It should be noted that the unlabeled sample 222 can be text that has not been annotated, specifically a sentence, paragraph or article, and the source can include any text such as news reports, social media, blog posts, papers, patent documents, etc., and this application does not specifically limit this. It should be noted that the unlabeled sample 222 is obtained after sending an application to the user or relevant department and obtaining approval and authorization. Unauthorized and unapproved text cannot be used as a sample for training.

[0104] Optionally, the self-training sample can be obtained by using the first model to predict the unlabeled sample 222, and the input text of the self-training sample is the unlabeled sample 222, and the label of the input text is the prediction result of the event detection model on the input text, or the pseudo label. In a specific implementation, after the training unit 212 performs adversarial training on the neural network based on the labeled sample 221 to obtain the first model, the second expansion unit 213 can use the event detection model to predict the unlabeled sample 222 to obtain the self-training sample. It should be noted that the pseudo label of the self-training sample includes an event subject label and an event action label.

[0105] Optionally, the confidence of the pseudo label of the self-training sample is greater than a preset threshold. In other words, after using the first model to predict the unlabeled sample 222, the prediction result with a confidence exceeding the first threshold is used as the pseudo label of the corresponding unlabeled sample to obtain the self-training sample.

[0106] In one embodiment, after the training unit 212 performs adversarial training on the neural network through the labeled samples 221, the self-training samples can be used to further optimize the event detection model. In a specific implementation, the self-training samples can be used as new labeled samples, and the event detection model can be further adversarially trained based on the self-training samples. In other words, the first expansion unit 211 can generate its corresponding adversarial samples based on the self-training samples, and then further train the first model based on the self-training samples and the corresponding adversarial samples, thereby increasing the number of samples and alleviating the pressure of manual labeling.

[0107] For example, the training unit 212 may first use the labeled samples 221 to perform N rounds of adversarial training on the neural network to obtain a first model, and then use the self-training samples generated by the second expansion unit 213 to perform M rounds of adversarial training on the neural network from the N+1th round to obtain an event detection model. It should be understood that further training the event detection model using self-training samples can increase the number of samples and alleviate the pressure of manual labeling.

[0108] The third expansion unit 214 is used to generate active learning samples according to the unlabeled samples 222 .

[0109] Optionally, the active learning samples can be obtained by manually annotating the unlabeled samples 222. It should be understood that manually annotated samples can improve the accuracy of the model. Further, in order to reduce the pressure of manual annotation, the unlabeled samples 222 can be sampled, and then the sampled samples can be manually annotated to obtain active learning samples.

[0110] In a possible implementation, active learning samples may be samples containing rich information, and specifically may include difficult samples, wherein difficult samples refer to samples that are difficult for the model to learn or classify. These samples may have complex features that make it difficult for the model to learn the classification features, or the sample has a high similarity to other categories of samples, making it difficult for the classifier to classify. Generally, difficult samples are determined by judging the large gap between the predicted result and the true value. The larger the gap, the higher the difficulty of the difficult sample. However, the unlabeled sample 222 in the present application is a sample without a true value, so the present application determines the difficult sample by judging the information entropy of the pseudo-label of the unlabeled sample 222. Further, the active learning sample may include an unlabeled sample whose information entropy is higher than the second threshold, and the label of the active learning sample is the true value of the manual annotation of the unlabeled sample. Specifically, the unlabeled sample 222 can be input into the first model to obtain the prediction result of the unlabeled sample 222, and then the information entropy of the unlabeled sample 222 can be determined based on the prediction result. The unlabeled sample 222 with an information entropy higher than the second threshold is used as an active learning sample and manually labeled. In other words, the prediction result of the unlabeled sample 222 with an information entropy higher than the second threshold is manually corrected to obtain an active learning sample.

[0111] In a specific implementation, after the event detection model obtains a prediction result for the unlabeled sample 222, the higher the information entropy of the prediction result, the greater the uncertainty of the event detection model in predicting the unlabeled sample. The prediction result given by the event detection model shows that the probabilities of different categories to which the sample belongs show a certain balance, or the probability distribution of the prediction result is relatively uniform. For example, assuming that the prediction result of the event detection model for the unlabeled sample is (0.3, 0.3, 0.4), although the prediction result shows that the sample belongs to the third category, the probability of belonging to the third category is only 40%, the probability of belonging to the first category is 30%, and the probability of belonging to the second category is 30%, which means that the event detection model has difficulty in predicting the unlabeled sample. Using manually annotated information entropy samples exceeding the second threshold for training can provide the model with richer information, which is beneficial to optimizing the model.

[0112] In one possible implementation, active learning samples may also include boundary samples, where the boundary samples may be a special case of difficult samples, which are samples that are difficult for the model to classify. Specifically, in the feature space, there is a small gap between the feature representation of the sample and the feature representation of samples of different categories. Therefore, the category attribution of the boundary samples is vague or uncertain, making it difficult for the model to classify correctly.

[0113] In a specific implementation, the above-mentioned active learning samples that are difficult to classify may include unlabeled samples whose KL divergence (KLD) is higher than the third threshold and adversarial samples corresponding to the unlabeled samples. The labels of the active learning samples are the true values ​​of the above-mentioned unlabeled samples and adversarial samples that are manually annotated. Among them, the KL divergence is the KL divergence between the unlabeled sample 222 and its adversarial sample. When the KL divergence between the unlabeled sample 222 and its corresponding adversarial sample is higher, it means that the difference between the two is greater. Then, the adversarial sample of the unlabeled sample contains more new and useful information relative to the unlabeled sample, which is more conducive to adversarial training and beneficial to the optimization model. Therefore, the unlabeled sample and the corresponding adversarial sample can both be used as active learning samples to participate in the optimization of the event inspection model.

[0114] Specifically, the unlabeled sample 222 can be input into the first model to obtain a prediction result of the unlabeled sample 222, and then an adversarial sample corresponding to the unlabeled sample 222 is generated through the first expansion unit 211, and the adversarial sample is input into the event detection model to obtain the prediction result of the adversarial sample, and the KL divergence of the unlabeled sample is determined according to the prediction result of the unlabeled sample and the prediction result of the adversarial sample.

[0115] In one possible implementation, active learning samples may be obtained by sampling a plurality of unlabeled samples whose information entropy exceeds a second threshold, and a plurality of unlabeled samples whose KL divergence exceeds a third threshold and corresponding adversarial samples, thereby further reducing the number of manual annotations and reducing labor costs.

[0116] It should be understood that the self-training samples generated by the second expansion unit 213 and the adversarial samples generated by the first expansion unit 211 can increase the density of the samples, but do not solve the boundary problem of model classification well. When encountering difficult samples, it may not be possible to give correct or high-confidence results. Therefore, the performance of the model can be further improved by manually annotating some difficult samples and boundary samples. It should be noted that the active learning samples can also be difficult samples and boundary samples obtained by other means. The difficult samples and boundary samples determined by the information entropy and KL divergence of the samples are an exemplary implementation method, and this application does not make specific limitations.

[0117] In one embodiment, after the training unit 212 performs adversarial training on the neural network through the labeled samples 221, the active learning samples can be used to further optimize the event detection model. In a specific implementation, the active learning samples can be used as new labeled samples, and the event detection model can be further adversarially trained based on the active learning samples. In other words, the first expansion unit 211 can generate corresponding adversarial samples based on the active learning samples, and then further train the first model based on the active learning samples and their corresponding adversarial samples, thereby increasing the number of samples and alleviating the pressure of manual labeling.

[0118] For example, the training unit 212 may first use the active learning samples to perform N rounds of adversarial training on the neural network to obtain the first model, and then use the active learning samples generated by the third expansion unit 214 to perform M rounds of adversarial training on the neural network from the N+1th round to obtain the event detection model. It should be understood that the event detection model is further trained using active learning samples, and the active learning samples are samples whose information entropy exceeds the second threshold and whose KL divergence exceeds the third threshold. The active learning samples whose information entropy exceeds the second threshold can provide richer information for the model, and the samples whose KL divergence exceeds the third threshold can provide a better decision boundary in adversarial training, so that the model can have better prediction effect and robustness.

[0119] In one embodiment, after the training unit 212 performs adversarial training on the neural network through the labeled samples 221, the active learning samples and the self-training samples can be used to further optimize the training of the event detection model. It should be understood that the active learning samples are manually labeled samples, the labeling cost is high and the number of samples is small, and the self-training samples are high-confidence samples, which can increase the number of samples and reduce the labeling cost. However, the labels of the high-confidence samples are pseudo-labels, and there may be a certain gap between them and the real labels, which will bring noise data to the model, while the labels of the manually labeled active learning samples are real labels, which can bring reliable data to the model and correct the noise data brought by the high-confidence samples. In this way, the combination of the two can further optimize the event detection model and solve the problem of poor model prediction effect in the case of few samples.

[0120] Optionally, the self-training samples and the active learning samples can be used in an alternating training manner to optimize the event detection model. Further, the alternating training can be an alternating adversarial training. In a specific implementation, the above-mentioned alternating training refers to alternating the use of self-training samples and active learning samples to perform multiple rounds of training on the event detection model. For example, odd rounds use self-training samples for training, and even rounds use active learning samples for training, or even rounds use active learning samples for training, and odd rounds use self-training samples for training. Alternatively, the first 3 rounds use self-training samples for training, the next 3 rounds use active learning samples for training, and then 3 rounds use self-training samples for training, and then 3 rounds use active learning samples for training, and so on. This application does not make specific limitations.

[0121] Specifically, the event detection model may be trained for X rounds using self-training samples, and then the event detection model may be trained for Y rounds using active learning samples, and then the event inspection model may be trained for X rounds using self-training samples, and then the event inspection model may be trained for Y rounds using active learning samples, and so on, until the number of training rounds reaches a preset threshold, such as M rounds. Or, until the performance of the event inspection model reaches a preset threshold, which is not specifically limited in this application.

[0122] Optionally, the values ​​of X and Y may be the same or different, for example, X may be greater than Y. It should be understood that since the labels of the self-training samples are pseudo-labels inferred by the event detection model, and the active learning samples are manually labeled samples, the number of the self-training samples is much higher than that of the active learning samples. Therefore, a large number of self-training samples can be used for training during alternating training, and a small number of active learning samples can be added to guide them alternately. The combination of the two can further optimize the event detection model, which can solve the problem of poor model prediction effect in the case of few samples.

[0123] Optionally, the event detection model may be first trained for X1 rounds using self-training samples, and then the event detection model may be trained for Y1 rounds using active learning samples, and then the event inspection model may be trained for X2 rounds using self-training samples, and then the event inspection model may be trained for Y2 rounds using active learning samples, and so on, until the number of training rounds reaches a preset threshold. The numbers of X1 and X2 mentioned above may be different, and the numbers of Y1 and Y2 may also be different, such as using self-training samples for training in the first 3 rounds, using active learning samples for training in the next 2 rounds, and then using self-training samples for training in the next 4 rounds, and then using active learning samples for training in the next 3 rounds, and so on, and examples are not given here one by one. It should be understood that the present application does not limit the number of rounds when using self-training samples for training during alternating training, and the number of rounds when using active learning samples for training.

[0124] Optionally, when using self-training samples for training, the self-training samples used in each round may be the same or different. Referring to the foregoing content, it can be known that the self-training samples are samples whose confidence exceeds the first threshold selected from the unlabeled samples 222 after the unlabeled samples 222 are predicted using the event detection model. Then the self-training samples used in each round of training can be sampled from these samples whose confidence exceeds the first threshold, so the self-training samples used in each round of training may be the same or different. Similarly, when using active learning samples for Y1 rounds of training, the active learning samples used in each round of these Y rounds of training may be the same or different. This application does not make specific limitations.

[0125] It should be noted that active learning samples and self-training samples are implemented based on unlabeled samples 222. The unlabeled samples used by the two can be the same or different, and this application does not make specific restrictions. At the same time, all unlabeled samples 222 that meet the active learning sample conditions can be labeled before training, and then the labeled active learning samples can be sampled and trained. It is also possible to sample unlabeled samples 222 that meet the active learning sample conditions each time during the training process, label the sampled unlabeled samples 222, and then participate in the training, thereby further reducing the number of manual annotations.

[0126] It should be understood that the alternating training method can gradually correct the noise impact brought by the self-training samples. Each round of manually labeled active learning samples can help correct the errors that may be introduced by the previous self-training samples, strengthen the influence of these accurate labels, and the model can better learn the laws of real situations, improving the accuracy and robustness of the model. At the same time, if self-training samples are used for multiple rounds, the model may pay too much attention to certain specific laws, causing the model to pay too much attention to known laws and unable to effectively handle new unknown situations. The alternating training method can effectively reduce the model's dependence on specific laws and improve the model's generalization ability to different situations.

[0127] In summary, this application provides multiple ways to train the event inspection model, which are summarized below.

[0128] The first method is to train a neural network using the labeled sample set provided by the present application to obtain a trained event detection model, wherein the labeled sample set includes event subject labels and event action labels. This method of decoupling labels can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain event detection results for new scenarios based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in current event detection methods based on trigger words.

[0129] The second method is to use the labeled sample set provided by this application to perform adversarial training on the neural network to obtain a trained event detection model. During adversarial training, the labeled sample set can be slightly perturbed so that the labels of the adversarial samples are the same as the labels of the labeled samples before the perturbation, thereby increasing the number of samples of the same category and improving the sample density, thereby improving the model prediction performance and robustness in the case of few samples.

[0130] The third method is to use the labeled samples provided by the present application to perform adversarial training on the neural network to obtain a trained first model, and then use the self-training samples to perform adversarial training on the first model to obtain an event detection model. Among them, the self-training samples are samples with a confidence level higher than the first threshold, and the sample labels of the self-training samples are obtained after predicting the unlabeled samples using the first model. Since such samples do not require manual labeling, a large number of self-training samples can be obtained to perform further adversarial training on the event detection model, thereby further increasing the sample density and improving the performance of the event detection model.

[0131] The fourth method is to obtain the first model by using the above-mentioned labeled sample set to perform adversarial training on the neural network, and then use active learning samples to perform further adversarial training on the event detection model to obtain the event detection model. Among them, the active learning samples are obtained after manually annotating a part of the unlabeled samples, and this part of the unlabeled samples can be difficult-to-learn samples and difficult-to-classify samples of the first model, and specifically can include samples with information entropy higher than the second threshold and samples with KL divergence higher than the third threshold. It should be understood that by manually annotating the difficult-to-learn samples and difficult-to-classify samples, the active learning samples can bring more information-rich and more accurately annotated features to the first model, thereby improving the performance of the first model in a targeted manner.

[0132] The fifth method is to obtain the first model by conducting adversarial training on the neural network with the above-mentioned labeled samples, and then alternately use the self-training samples and the active learning samples to further conduct adversarial training on the event detection model to obtain the event detection model. Among them, the labels of the self-training samples are the prediction results of the first model for the unlabeled samples, and the labels of the active learning samples are manually labeled labels. Therefore, some labels of the self-training samples may be inaccurate and have certain noise. By alternately using the self-training samples and the active learning samples to train the first model, the noise effect brought by the self-training samples can be gradually corrected. Each round of manually labeled active learning samples can help correct the errors that may be introduced by the previous self-training samples, strengthen the influence of these accurate labels, and the model can better learn the laws in the real situation and improve the accuracy and robustness of the model. At the same time, if the self-training samples are used for multiple rounds, the model may pay too much attention to certain specific laws, resulting in the model paying too much attention to known laws and being unable to effectively handle new unknown situations. The alternating training method can effectively reduce the model's dependence on specific laws and improve the model's generalization ability to different situations.

[0133] It should be understood that the above schemes are only some possible implementation methods provided by the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed in the present application, and these repairs or replacements should be included in the protection scope of the present application.

[0134] The acquisition unit 215 is used to obtain the text to be detected input by the user through the client 100. The text to be detected may be a sentence, a paragraph or an article. The source of the text to be detected may include any text such as news reports, social media, blog posts, papers, patent documents, etc. This application does not specifically limit this.

[0135] The detection unit 216 is used to input the text to be detected into the event detection model to obtain the event detection result. The event detection model can be obtained by using any of the above four solutions, and this application does not limit them collectively.

[0136] In a specific implementation, the above event detection result includes the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, which may be the issuer of the action in the event expressed by the input text, or the owner of the state in the event expressed by the input text; the event action includes the action information performed by the event subject, which may be the specific action of the event subject or the state of the event subject in the event expressed by the input text. The description of the above event subject and event action can refer to the relevant description of the labeled sample 221 in the aforementioned content, and will not be repeated here.

[0137] In a specific implementation, the above event detection result can be a decoupled event subject and event action, or an event type obtained by combining an event action and an event subject. The content of the event detection result can be determined specifically according to the actual application scenario. If the event detection result required by the client is to display the event action and the event subject separately, then the event detection result is the decoupled event action and event subject. If the event detection result is to give the event type corresponding to the text to be detected, then the event type can be obtained based on the event action and the event subject. For example, if the event subject is "global gold market", the event action is "decline", the event detection result can be "global gold market decline", the event subject is "global stock market", and the event action is "decline", then the event detection result is "global stock market decline". It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0138] The sending unit 217 is used to feed back the event detection result to the client 100, or send the detection result to the application system 300. The specific method can be determined according to the actual application situation, and this application does not make any specific limitation.

[0139] In summary, the event detection system provided by the present application obtains the text to be detected input by the user, and then inputs the text to be detected into the event detection model to obtain the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, and the event action includes the action information performed by the event subject, and then obtains the event detection result of the text to be detected based on the event subject and the event action, wherein the event detection model is trained using a sample set, and the sample set includes an event subject label and an event action label. Using such a sample set to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain the event detection result of the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in the current event detection method based on trigger words.

[0140] Combined with the above Figure 1 , describes in detail the event detection system provided by the present application, and will now be combined with Figures 2 to 6 , describing the event detection method provided by this application.

[0141] Figure 2 This is a schematic diagram of the steps of an event detection method provided by the present application. The method can be applied to Figure 1 In the event detection system architecture shown in Figure 2 As shown, the method comprises the following steps:

[0142] S210: The client 100 sends the text to be detected input by the user to the event detection system 200. This step can be performed by Figure 1 The client 100 and the acquisition unit 215 in the event detection system 200 are implemented.

[0143] In a specific implementation, the above-mentioned text to be detected can be a sentence, paragraph or article. The source of the text to be detected can include any text such as news reports, social media, blog posts, papers, patent documents, etc. This application does not specifically limit this. The description of the text to be detected can be referred to Figure 1 The relevant descriptions in the embodiments are not repeated here.

[0144] S220: The event detection system 200 inputs the text to be detected into the event detection model to obtain the event subject and event action of the text to be detected. Figure 1 The detection unit 216 in is implemented.

[0145] In a specific implementation, the above-mentioned event detection results include the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, which may specifically be the issuer of the action in the event expressed by the input text, or the owner of the state in the event expressed by the input text; the event action includes the action information performed by the event subject, which may specifically be the specific action performed by the event subject or the state of the event subject in the event expressed by the input text.

[0146] In a possible implementation, the event subject and event action are the subject and predicate of the event described by the text to be detected, and the subject and predicate may be the original subject and predicate in the text to be detected, or may be the subject and predicate of a generalized event obtained by summarizing and superpositioning the event described by the text to be detected. The subject may be a noun, a pronoun, a numeral, a nominalized adjective, etc. For example, an enterprise, a stock market, a market, an economic indicator, etc. may all be used as the event subject, and the predicate may be the action, state, attribute, etc. of the event subject, such as a verb, an adjective, etc., such as listing, merger, investment, release, decline, rise, etc., which are not specifically limited in this application.

[0147] For example, the text to be detected is: "The market quotation fell nearly four points in one day, traders were not active in purchasing, and the skeleton of listed companies in the industry has fallen by 30%. Then the event detection result obtained by using the event detection model provided by this application includes the event subject and event action, wherein the event subject is "global stock market" and the event action is "decline". For another example, the text to be detected is: "On that day, the average price of domestic metal cobalt market was 617,500 yuan / ton, a single-day drop of 23,000 yuan / ton." Then the event subject in the event detection result is "global gold market" and the event action is "decline". The above examples are for illustration and are not specifically limited in this application.

[0148] Optionally, the text to be detected may contain multiple subjects and predicates, but the event subject and event action are the most representative subjects and predicates in the text to be detected. For example, assuming the text to be detected is: "The National Bureau of Statistics said on Tuesday that the consumer price index fell 0.05% from February", the subjects in the sentence include "National Bureau of Statistics" and "Consumer Price Index", and the predicates include "indicates" and "decline", then according to the context of the sentence and the semantics of the sentence, it can be determined that the actual meaning of the sentence is "the consumer price index has fallen", so the event subject label of the sentence is "Consumer Price Index", and the event action label is "decline". The above examples are for illustration and are not specifically limited in this application.

[0149] Optionally, there are also deviations between the event subjects and event actions of the text to be detected in different application scenarios. For example, in the financial field, the event subjects are more index parameters in the financial field, such as the consumer price index, global oil prices, annual inflation rate, global stock market, global gold market, etc. Event actions are more actions in the financial field, such as rise, fall, mergers and acquisitions, investment, etc. In the field of natural disasters, the event subjects are more place names where disasters occur, such as Wenchuan, Zhengzhou, Xiamen, etc., and event actions are more names of natural disasters, such as earthquakes, rainstorms, typhoons, etc. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0150] S230A: The event detection system 200 sends the event subject and event action to the client 100. This step can be performed by Figure 1 The sending unit 217 in is implemented.

[0151] Optionally, if the client 100 needs the event type corresponding to the text to be detected, the event detection system 200 can also determine the event type corresponding to the text to be detected based on the event subject and the event action. For example, if the event subject is "Consumer Price Index" and the event action is "Decline", then the event type is "Consumer Price Index Decline". It should be understood that the event subject is the subject of the event and the event action is the predicate of the event. When the subject and predicate are determined, the event type of the text to be detected can be easily determined.

[0152] S230B: The event detection system 200 sends the event subject and event action to the application system 300. This step can be performed by Figure 1 The sending unit 217 in is implemented.

[0153] S240B: The application system 300 sends the processing result of the application system to the client 100. This step can be performed by Figure 1 The application system 300 is implemented in.

[0154] Wherein step S230A and step S230B may occur simultaneously or successively, or only step S230A or only step S230B may be executed, wherein S240B needs to be executed after executing S230B, and S240B may not be executed when only S230A is executed. Specifically, if the client 100 is a client for event detection, then S230A may be executed to feedback the event detection result to the client, that is, the above-mentioned event subject and event action. If the client 100 is a client of a certain application based on event inspection, such as a public opinion analysis client, a financial analysis client, etc., then S230B may be executed to send the event subject and event action to the application system 300, and the application system 300 may perform some analysis and processing based on the event subject and event action. For example, if the application system 300 is an event context system, then the application system 300 may generate an event context result based on the event inspection result, and then send the event context result to the client 100. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0155] According to the above S210 to S240B, the event detection method provided in the present application is implemented based on an event detection model, which has the following functions: according to the input text to be detected, determining the event subject and event action of the event described by the text to be detected. Figure 1 The embodiments provide a variety of training schemes for event detection models. In order to make this application better understood, they are summarized below. It should be noted that the various schemes summarized below are only specific implementation methods provided by this application, but the protection scope of this application is not limited thereto. Any technician familiar with this technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed in this application, and these repairs or replacements should be covered within the protection scope of this application.

[0156] In a possible implementation, a neural network may be trained using a labeled sample set including event subject labels and event action labels to obtain a trained event detection model.

[0157] For a detailed description of the above implementation, please refer to the above description of the labeled sample 221, which will not be repeated here. The beneficial effects of the implementation are described below.

[0158] First of all, using such labeled samples to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain event detection results for the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels are difficult to expand and reuse in current trigger word-based event detection methods.

[0159] Secondly, the labels obtained by the annotation method provided by the present application make the distribution of sample data denser than the labels obtained by the traditional mode (the reason is explained in the above part about formula (1)). The dense distribution of samples means that there are abundant sample points in the same feature space. The model can learn the details of the feature space from the abundant sample points, and then learn the decision boundaries and key features of the corresponding categories in the feature space, thereby producing more accurate classification results. In contrast, when the sample distribution is sparse, the model may not be able to obtain enough information for accurate identification and classification. Therefore, the labeled samples provided by the present application are beneficial to the training and feature learning of the model.

[0160] Finally, the annotation method provided by the present application requires fewer annotations, which can improve the annotation efficiency. In the traditional event detection method based on trigger words, the annotators need to annotate the trigger words and event type labels for each text. Then for an input sample with M event subjects and N event actions, there are MN possible event combinations in the input sample, and the annotators need to annotate MN times. However, when the method provided by the present application is used to annotate the event subjects and event actions, only M+N times of annotation are required, and the number of annotations required by the annotators is reduced, thereby improving the annotation efficiency of the annotators.

[0161] For example, Figure 3 This is a labeling example diagram of an event detection method provided by the present application in an application scenario. The input text in the application scenario shown is: "Mexico's inflation eased in March, and gasoline prices fell in line with the world oil price. The National Bureau of Statistics said on Tuesday that the consumer price index fell 0.05% from February, and the annual inflation rate slowed from 3.7% to 3.25%." The input text is labeled using the traditional trigger word and event type labeling method. The three trigger words "fall", "decline" and "slowdown" need to be labeled, and the event types corresponding to these three trigger words also need to be labeled. For example, the event type corresponding to the trigger word "fall" is "fall in oil prices", the event type corresponding to the trigger word "decline" is "fall in the consumer price index", and the event type corresponding to the trigger word "slowdown" is "fall in inflation rate". Then the labeling personnel use this method to label Figure 2The text shown in the figure needs to be annotated 6 times, while the event subject and event action of the input text are annotated using the method provided by the present application, and only one event action "decline" and three event subjects "global oil price", "consumer price index" and "inflation rate" need to be annotated. In other words, Figure 2 When the input text shown is annotated using the method provided in this application, the annotator only needs to annotate 4 times, while when using the traditional trigger word and event type annotation method, it needs to be annotated 6 times. The workload of the annotator is greatly reduced and the annotation efficiency is improved.

[0162] Therefore, using the labeled samples provided in this application to train the event detection model can not only solve the problems of label expansion and difficulty in reuse of the event detection method, but also improve the sampling density of the samples, which is beneficial to the training of the model. At the same time, it can reduce the number of sample annotations, reduce the processing pressure of the annotation personnel, and improve the annotation efficiency.

[0163] In one possible implementation, the neural network may be adversarially trained using the labeled sample set to obtain a trained event detection model.

[0164] In the adversarial training process, the above implementation method slightly perturbs the labeled sample set to generate adversarial samples. The event subject label and / or event action label of the adversarial sample are the same as the labeled sample before the perturbation. This can further increase the density of samples of the same category, thereby improving the model prediction performance and robustness in the case of few samples. For a detailed description of this solution, please refer to Figure 1 The description of the first expansion unit 211 in the embodiment will not be repeated here.

[0165] In one possible implementation, the above-mentioned labeled sample set can be used to perform adversarial training on the neural network to obtain a first model, and then the self-training samples can be used to perform further adversarial training on the event detection model to obtain the event detection model.

[0166] Among them, the self-training samples are samples with confidence higher than the first threshold. The sample labels of the self-training samples are obtained by using the first model to predict the unlabeled samples. The confidence of the samples is higher than the first threshold, which means that the prediction result of the first model for the samples is highly accurate. Since such samples do not need manual labeling, a large number of self-training samples can be obtained to further conduct adversarial training on the event inspection model, thereby further increasing the sample density and improving the performance of the event inspection model. For a detailed description of this solution, please refer to Figure 1 The description of the second expansion unit 213 in the embodiment will not be repeated here.

[0167] In one possible implementation, the above-mentioned labeled sample set can be used to perform adversarial training on the neural network to obtain a first model, and then the active learning samples can be used to further perform adversarial training on the event detection model to obtain the event detection model.

[0168] Among them, active learning samples are obtained after manually annotating a part of unlabeled samples. This part of unlabeled samples can be difficult-to-learn samples and difficult-to-classify samples of the first model, and can specifically include samples with information entropy higher than the second threshold and samples with KL divergence higher than the third threshold. It should be understood that by manually annotating difficult-to-learn samples and difficult-to-classify samples, active learning samples can bring more information-rich and more accurately annotated features to the first model, thereby improving the performance of the first model in a targeted manner. For a specific description of this solution, please refer to Figure 1 The description of the third expansion unit 214 in the embodiment will not be repeated here.

[0169] In a possible implementation, the self-training samples and the active learning samples may be used alternately to perform further adversarial training on the event detection model to obtain the event detection model. In a specific implementation, a training set may be first obtained, and then the training set may be used to perform adversarial training on the neural network to obtain a first model. Based on the first model and the unlabeled sample set, self-training samples and active learning samples may be obtained. The self-training samples and active learning samples may be used alternately to perform adversarial training on the first model to obtain the event detection model.

[0170] In order to make this application better understood, Figure 4 The steps of further adversarial training of the event detection model by alternating between self-training samples and active learning samples to obtain the event detection model are described. Figure 4 This is a schematic diagram of the steps of a training method for an event detection model provided by the present application. The method can be applied to Figure 1 In the event detection system 200 shown. Figure 4 As shown, the method may include the following steps:

[0171] S410: Use the training set to perform adversarial training on the neural network to obtain a first model. This step can be performed by Figure 1 The first expansion unit 211 and the training unit 212 in the embodiment are implemented.

[0172] In the specific implementation, Figure 4As shown, a training set can be obtained first, which includes labeled samples, and then sample perturbations are performed on the labeled samples to obtain adversarial samples, where the labels of the adversarial samples are the same as the labels of the labeled samples before perturbations. The labeled samples and the adversarial samples are then input into a neural network to obtain output results, a first loss value is obtained based on the gap between the output result of the labeled sample and the label of the labeled sample, a second loss value is obtained based on the gap between the output result of the adversarial sample and the label of the adversarial sample, back propagation is performed on the neural network based on the first loss value and the second loss value, and the network parameters of the neural network are adjusted, and so on, until the number of training rounds reaches N, and step S420 is started.

[0173] It should be understood that the termination condition for obtaining the first model by performing adversarial training using the training set may include but is not limited to setting a fixed number of rounds, such as Figure 4 Whether the number of training rounds shown is greater than N, in some embodiments, other types of termination conditions may also be used, such as when the prediction effect of the first model reaches a preset threshold, which is not specifically limited in this application.

[0174] S420: Alternately use the self-training samples and the active learning samples to perform adversarial training on the first model to obtain an event detection model. This step can be performed by Figure 1 The second expansion unit 213, the third expansion unit 214 and the training unit 212 in the embodiment are implemented.

[0175] In the specific implementation, Figure 4 As shown, self-training samples and active learning samples can be obtained first, where the labels of self-training samples are the prediction results of the first model for unlabeled samples, and the labels of active learning samples are manually annotated labels. Therefore, some labels of self-training samples may be inaccurate and have certain noise. By alternately using self-training samples and active learning samples to train the first model, the noise influence brought by self-training samples can be gradually corrected. Each round of manually annotated active learning samples can help correct the errors that may be introduced by previous self-training samples, strengthen the influence of these accurate labels, and the model can better learn the laws in real situations and improve the accuracy and robustness of the model. At the same time, if self-training samples are used for multiple rounds, the model may pay too much attention to certain specific laws, resulting in the model paying too much attention to known laws and being unable to effectively handle new unknown situations. The alternating training method can effectively reduce the model's dependence on specific laws and improve the model's generalization ability to different situations.

[0176] It should be understood that Figure 4An example is given of using self-training samples for training in odd rounds and using active learning samples for training in even rounds. In a specific implementation, any method of alternating between self-training samples and active learning samples for training falls within the scope of protection of this application. For example, self-training samples are used in the first three rounds, active learning samples are used in the next three rounds, self-training samples are used in another three rounds, and active learning samples are used in another three rounds. For details, please refer to the relevant description in the aforementioned content, which will not be repeated here.

[0177] It should be noted that the termination conditions for alternating adversarial training using self-training samples and active learning samples may include but are not limited to setting a fixed number of rounds, such as Figure 4 Whether the number of training rounds shown is greater than M may also be determined through other types of termination conditions in some embodiments, which is not specifically limited in this application.

[0178] Combine the following Figure 5 ,right Figure 4 The method of obtaining the self-training samples and active learning samples used in step S420 in FIG. Figure 5 This is a flow chart of the steps for obtaining self-training samples and active learning samples in an event detection method provided in this application.

[0179] like Figure 5 As shown, the self-training samples can be obtained as follows:

[0180] After the unlabeled sample is input into the first model, the prediction result of the unlabeled sample can be obtained. When the confidence of the prediction result of the unlabeled sample is higher than the first threshold, the prediction result can be used as a pseudo label of the unlabeled sample to generate a self-training sample.

[0181] It should be understood that the self-training samples generate labels through the first model without manual labeling, so a large number of self-training samples can be generated, thereby solving the problem of small number of samples in the event detection method. At the same time, using prediction results with higher confidence as labels to participate in training can avoid introducing too much noise and improve the accuracy of the model.

[0182] Active learning samples can be obtained as follows:

[0183] The first method: when the information entropy of the prediction result of the unlabeled sample is higher than the second threshold, the unlabeled sample can be manually labeled to obtain an active learning sample.

[0184] The second method is to perform sample perturbation on the unlabeled sample to produce an adversarial sample of the unlabeled sample, input the adversarial sample into the first model to obtain the prediction result of the adversarial sample, determine the KL divergence between the prediction result of the unlabeled sample and the prediction result of the adversarial sample, and when the KL divergence is greater than the third threshold, the unlabeled sample can be manually labeled to obtain an active learning sample.

[0185] It should be understood that by screening out samples that are difficult for the first model to learn and classify from the unlabeled samples for manual labeling, the number of manual labeling can be further reduced, while providing the first model with active learning samples with richer information and more accurate labels for training. Each round of manually labeled active learning samples can help correct errors that may have been introduced by previous self-training samples, and strengthen the influence of these accurate labels. The model can better learn the laws of real situations and improve the accuracy and robustness of the model.

[0186] In order to make this application better understood, Figure 6 The event detection method provided in this application is further described. Figure 6 is an exemplary interface display diagram of the event detection method provided in this application, Figure 6 The interface shown is an example and this application does not limit this interface.

[0187] like Figure 6 As shown, the user can input the text to be detected through the input area 610, and then start event detection by clicking the control 630. The event detection result is obtained in the output area 620.

[0188] For example, Figure 6 The interface shown shows the event detection results corresponding to the three event descriptions of the text to be detected. It should be understood that Figure 6 In the example shown, the text to be detected includes multiple sentences to be detected, so multiple event descriptions can be extracted from the multiple sentences to be detected, and then the event subject and event action can be determined. For example, the event description is: "Previously on May 4, the company had planned to purchase 100% of the equity of a company in Zhuhai City for 1.2 billion yuan." Event detection can be performed on it to obtain the event subject as "enterprise" and the event action as "acquisition." Referring to the foregoing content, it can be seen that the event subject and event action are predefined classification terms, so in other implementations, the event action can also be "purchase." The event subject can also be "enterprise acquisition". The event subject and event action can be defined according to the actual application scenario and business needs, and then the samples are labeled and trained. This application does not make specific limitations.

[0189] In a possible implementation, event detection can be performed on the text to be detected to determine the event subject and event action of each event in the multiple events described in the text to be detected, and then the corresponding event description in the original text to be detected is determined according to the event subject and event action of each event, so as to obtain Figure 6In another possible implementation, the text to be detected may be segmented into sentences, one sentence for one event description, and then the event subject and event action of each event description are determined, and then the event descriptions corresponding to the same event subject and event action are merged to generate the final event detection processing result.

[0190] It should be understood that Figure 6 This is an exemplary interface. In other implementations, the event description may not be displayed, and the event subject and event action may be directly marked in the text to be detected. This application does not make any specific limitations.

[0191] In summary, the event detection method provided by the present application obtains the text to be detected input by the user, and then inputs the text to be detected into the event detection model to obtain the event subject and event action of the text to be detected, wherein the event subject includes the subject information in the event described by the text to be detected, and the event action includes the action information performed by the event subject, and then obtains the event detection result of the text to be detected based on the event subject and the event action, wherein the event detection model is trained using a sample set, and the sample set includes an event subject label and an event action label. Using such a sample set to train the event detection model can enable the event detection model to have the ability to identify event subjects and event actions from text, and no longer rely on the annotation of trigger words. In this way, even if the application scenario is changed, the event detection model can obtain the event detection result of the new scenario based on its ability to identify event subjects and event actions, thereby solving the problem that labels in the current event detection method based on trigger words are difficult to expand and reuse.

[0192] Combined with the above Figures 2 to 6 , describes in detail the event detection system provided by the present application, and will now be combined with Figure 7 , describing a computing device provided according to the present application.

[0193] Figure 7 It is a structural diagram of a computing device provided in the present application. The computing device 700 may be the event detection system in the aforementioned content.

[0194] Furthermore, the computing device 700 includes a processor 701, a storage unit 702, a storage medium 703 and a communication interface 704, wherein the processor 701, the storage unit 702, the storage medium 703 and the communication interface 704 communicate through a bus 705, and also communicate through other means such as wireless transmission.

[0195] The processor 701 is composed of a plurality of general-purpose processors, such as a CPU, an NPU, or a combination of a CPU and a hardware chip. The hardware chip is an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system on chip (SoC), or any combination thereof. The processor 701 executes various types of digital storage instructions, such as software or firmware programs stored in the storage unit 702, which enables the computing device 700 to provide a wide variety of services.

[0196] In a specific implementation, as an embodiment, the processor 701 includes one or more CPUs, such as Figure 7 CPU0 and CPU1 are shown in the figure.

[0197] In a specific implementation, as an embodiment, the computing device 700 also includes multiple processors, such as Figure 7 1 and 10. Each of these processors may be a single-CPU or a multi-CPU. A processor herein refers to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0198] The storage unit 702 is used to store program codes, and is controlled by the processor 701 to execute the above Figure 1-Figure 6 The processing steps of the event detection method in any embodiment of the present invention. The program code includes one or more software units. The one or more software units are Figure 1 The acquisition unit, the detection unit, the sending unit, the first expansion unit, the training unit, the second expansion unit and the third expansion unit in the embodiment, specifically, the acquisition unit is used to acquire the text to be detected, specifically for executing Figure 2 S210 and its optional steps in the embodiment; the detection unit is used to input the text to be detected into the event detection model to obtain the event detection result corresponding to the text to be detected, and the event detection result includes the event subject and event action of the event described by the text to be detected, which is specifically used to implement Figure 2S220 and its optional steps in the embodiment; the sending unit is used to return the event detection result to the user, specifically for implementing Figure 2 S230A, S230B, S240B and optional steps thereof in the embodiment. The first expansion unit is used to generate adversarial samples of labeled samples, and the training unit is used to perform adversarial training on the neural network according to the labeled samples and the adversarial samples to generate a first model, specifically for implementing Figure 4 In S410 and its optional steps in the embodiment, the second expansion unit is used to generate self-training samples according to the unlabeled samples and the first model, the third expansion unit is used to generate active learning samples according to the unlabeled samples and the first model, and the training unit is used to alternately train the first model using the self-training samples and the active learning samples to obtain a trained event detection model. Figure 4 S420 and its optional steps in the embodiment.

[0199] The storage unit 702 includes a read-only memory and a random access memory, and provides instructions and data to the processor 701. The storage unit 702 also includes a non-volatile random access memory. The storage unit 702 is a volatile memory or a non-volatile memory, or includes both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct RAM bus random access memory (DR RAM). It can also be a hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk is a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.

[0200] The storage medium 703 is a carrier for storing data, such as a hard disk, a USB flash drive (universal serialbus), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk can be a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.

[0201] The communication interface 704 is a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface) for communicating with other servers or units.

[0202] The bus 705 is a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 705 is divided into an address bus, a data bus, a control bus, etc.

[0203] The bus 705 includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are labeled as bus 705 in the figure.

[0204] Need to explain, Figure 7 This is only a possible implementation of the embodiment of the present application. In practical applications, the computing device 700 may also include more or fewer components, which is not limited here. For the contents not shown or described in the embodiment of the present application, please refer to the aforementioned Figure 1-Figure 6 The relevant explanations in the embodiments will not be repeated here.

[0205] The embodiment of the present application further provides a computing device cluster, which includes at least one computing device 700. The storage unit 702 in one or more computing devices 700 in the computing device cluster may store the same or different instructions for executing the event detection method.

[0206] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the event detection method.

[0207] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the event detection method.

[0208] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes a plurality of computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0209] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed by the present invention, and these repairs or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An event detection method, characterized in that: The method comprises: Get the text to be detected entered by the user; The text to be detected is input into an event detection model to obtain an event detection result of the text to be detected, wherein the event detection result includes an event subject and an event action, wherein the event subject includes subject information in the event described by the text to be detected, and the event action includes action information performed by the event subject. The event detection model is obtained by training using a sample set, and the sample set includes an input text and an event subject label and an event action label corresponding to the input text.

2. The method according to claim 1, characterized in that The event subject is the subject in the event described by the text to be detected, and the event action is the predicate in the event described by the text to be detected.

3. The method according to claim 1, characterized in that The event detection model is a first model obtained after adversarial training of a neural network using the sample set. The adversarial samples used in the adversarial training process are obtained after sample perturbation of labeled samples in the sample set. The labels of the adversarial samples are the same as the labels of the labeled samples before the adversarial samples are perturbed.

4. The method according to claim 3, characterized in that The event detection model is obtained by using self-training samples to perform adversarial training on the first model, the labels of the self-training samples are prediction results obtained by using the first model to predict unlabeled samples, and the confidence of the labels of the self-training samples is higher than a first threshold.

5. The method according to claim 3, characterized in that: The event detection model is obtained after active learning samples are subjected to adversarial training on the first model. The labels of the active learning samples are obtained after manual annotation of unlabeled samples. The unlabeled samples are difficult samples for the first model.

6. The method according to claim 5, characterized in that The information entropy of the prediction result of the first model for the active learning sample is higher than a second threshold.

7. The method according to claim 5 or 6, characterized in that: A KL divergence between a prediction result of the first model for the active learning sample and a prediction result of the first model for the adversarial sample of the active learning sample is higher than a third threshold.

8. The method according to any one of claims 4 to 6, characterized in that: The event detection model is obtained by alternately using the self-training samples and the active learning samples to perform adversarial training on the first model.

9. An event detection system, characterized in that: The system comprises: An acquisition unit, used for acquiring the text to be detected input by the user; A detection unit is used to input the text to be detected into an event detection model to obtain an event detection result of the text to be detected, wherein the event detection result includes an event subject and an event action, wherein the event subject includes subject information in the event described by the text to be detected, and the event action includes action information performed by the event subject. The event detection model is obtained by training using a sample set, and the sample set includes an input text and an event subject label and an event action label corresponding to the input text.

10. The system according to claim 9, characterized in that The event subject is the subject in the event described by the text to be detected, and the event action is the predicate in the event described by the text to be detected.

11. The system according to claim 10, characterized in that The event detection model is a first model obtained after adversarial training of a neural network using the sample set. The adversarial samples used in the adversarial training process are obtained after sample perturbation of labeled samples in the sample set. The labels of the adversarial samples are the same as the labels of the labeled samples before the adversarial samples are perturbed.

12. The system according to claim 11, characterized in that The event detection model is obtained by using self-training samples to perform adversarial training on the first model, the labels of the self-training samples are prediction results obtained by using the first model to predict unlabeled samples, and the confidence of the labels of the self-training samples is higher than a first threshold.

13. The system according to claim 11, characterized in that The event detection model is obtained after active learning samples are subjected to adversarial training on the first model. The labels of the active learning samples are obtained after manual annotation of unlabeled samples. The unlabeled samples are difficult samples for the first model.

14. The system according to claim 13, characterized in that The information entropy of the prediction result of the first model for the active learning sample is higher than a second threshold.

15. The system according to claim 13 or 14, characterized in that A KL divergence between a prediction result of the first model for the active learning sample and a prediction result of the first model for the adversarial sample of the active learning sample is higher than a third threshold.

16. The system according to any one of claims 13 to 15, characterized in that: The event detection model is obtained by alternately using the self-training samples and the active learning samples to perform adversarial training on the first model.

17. A computing device, characterized in that The computing device comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions, so that the computing device implements the method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are executed by a computing device or a computing device cluster to implement the method according to any one of claims 1 to 8.