Event detection model, event detection method, system, equipment and medium
By adopting the transfer learning and meta-learning methods of the Bert-BiLSTM-CRF framework in the field of event detection, combined with the adversarial generation network and the prototype network, the identification problem under highly imbalanced data sets is solved, and the identification of small samples and multi-sample categories is achieved. Effective recognition improves the versatility and recognition performance of the model.
Patent Information
- Application Number
- CN202410350576.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-09-06
AI Technical Summary
It is difficult for existing technologies to effectively handle highly imbalanced mixed sample data sets, especially in the field of event detection. Traditional supervised learning models and small sample meta-learning methods perform poorly when identifying categories with few samples, and it is difficult to take into account multi-sample categories. recognition performance.
The Bert-BiLSTM-CRF framework is used to build transfer learning sub-models and meta-learning sub-models. Shared and private features are pre-trained on multiple source domain data sets through transfer learning. The adversarial generation network and prototype network are combined to achieve two-stage transfer learning. , Enhance the model’s ability to identify small sample categories and multi-sample categories.
It improves the model's versatility and recognition performance under highly imbalanced data sets, can effectively identify small sample categories and multi-sample categories, and improves the overall effect of event detection.
Smart Images

Figure CN118606833A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language structured processing, and specifically to a small sample meta-learning event detection model based on two-stage migration applied to a highly unbalanced mixed sample data set, an event detection method, a system, a device and a medium. Background Art
[0002] With the development of information technology and the popularization of mobile access, the amount of electronic text data has increased rapidly. Most text data from the Internet or scientific research is unstructured and consists only of human-readable natural language. Automatically extracting structured information from text is the main step in automated natural language understanding. Most texts focus on describing entities and their relationships, explaining how these entities interact and influence each other. Event extraction (EE) is to automatically extract the elements that make up an event from text: trigger words, event types, arguments (event participants) and argument roles. The identification and extraction of effective event types and parameters can greatly help the formation of structured knowledge and has a wide range of applications in automatic abstraction, automatic question answering, information retrieval, and knowledge graph construction. Among them, event detection is the first step in the event extraction process. Its main task is to identify event trigger words, which is the basis for event element identification and the core step of the entire event extraction. Therefore, in recent years, event detection has attracted the attention of many research institutions and researchers and has become the research focus of natural language understanding.
[0003] The typical method of constructing event detection models is based on supervised machine learning methods. In recent years, deep neural networks (DNNs) have achieved state-of-the-art performance in this research field. The success of these deep neural network models depends on a large amount of high-quality labeled training data. However, in practical application areas, the coverage of manually labeled event patterns is very limited. In other words, there is a lack of large-scale, labeled datasets required for building models. In addition, in the limited labeled data, there is also a problem of significant imbalance in data between categories. For example, in the widely used corpus MLEE (Multi-Level Event Extraction), about 40% of the categories have less than 30 pieces of training data, accounting for only 3% of the data with the most training data. What's worse, there are even more categories with very small amounts of data with less than 5 annotations. In other words, the dataset is highly imbalanced, and the number of labeled samples for some categories is very small. This phenomenon is not only common in MLEE, but also in real-world datasets: with the occurrence of new events in a certain field, new categories with only a small number of samples are introduced, which leads to the problem of imbalanced distribution between data categories. For example, event detection tasks in the biomedical field face rapid changes in subdomains, and usually only 1-2 labeled data can be found in new subdomains. Traditional supervised learning-based models can no longer meet the needs of such scenarios.
[0004] Detecting these events that rarely appear in the domain training set and identifying their arguments and corresponding role types is a very difficult task. Currently, many studies focus on weakly supervised machine learning methods with small data dependency (WeakSupervised Learning). Among them, Few-Shot Learning (FSL) is a weakly supervised learning research field that has emerged in recent years. It solves machine learning tasks with limited data (only a few or one training sample in the target domain category). The most common FSL natural language processing application is text classification. When there is insufficient labeled data, a small number of documents or word samples are used to infer document category labels. Subsequently, FSL research has also been successfully applied to the field of sequence labeling, such as named entity recognition and event detection. Unlike the classic FSL setting, the highly unbalanced datasets in the real world contain not only categories with sparse training samples (small sample categories), but also categories with sufficient training samples (multiple sample categories). The high data imbalance exacerbates the difficulty of model training. This means that the current FSL model is difficult to directly generalize to actual event detection applications.
[0005] Recent studies have shown that meta-learning is an effective way to solve the problem of learning with small sample data. This is a process that uses the knowledge and experience learned from a large number of similar tasks to guide the current model to learn new tasks, so that the model can learn. Meta-learning can not only solve the problem of insufficient training samples and improve the generalization performance of the model, but also is a systematic learning paradigm. However, when it is directly applied to solve the training problem of highly unbalanced data sets, there are still the following limitations: ① When identifying a few-sample category, meta-learning uses the model to learn general, task-agnostic features from a large number of similar small-sample tasks. This causes the model feature space to tend to be simplistic, and there is a problem of insufficient and inaccurate expression of the domain-related features of the sample. ② It reduces the performance of other multi-sample category recognition. Recognizing new categories based only on the text features of small samples abandons the advantage of sufficient samples in the multi-data category and cannot achieve its original learning effect. Summary of the invention
[0006] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0007] One object of the present invention is to provide a small sample meta-learning event detection model to make up for the lack of data resources and improve the versatility of the model when faced with highly unbalanced mixed samples.
[0008] Another object of the present invention is to provide a method for event detection using the above model.
[0009] Another object of the present invention is to provide an event detection system.
[0010] In order to achieve the above-mentioned object, the present invention provides an event detection model on the one hand, comprising:
[0011] The transfer learning sub-model and meta-learning sub-model are constructed using the Bert-BiLSTM-CRF framework respectively;
[0012] The transfer learning sub-model uses a portion of the labeled datasets of other related source domains for pre-training to learn shared feature representations between different domains and provide a pre-trained feature space for the meta-learning sub-model.
[0013] The meta-learning sub-model uses another part of the labeled multiple other related source domain datasets and the target domain dataset to build the meta-training set and meta-test set of the model; based on the network parameters of the pre-trained transfer learning sub-model, it integrates and selects features from the transfer learning sub-model, combines the small sample meta-features from the prototype network and the cross-attention network, and performs hybrid learning on the small sample categories and multi-sample categories in the target domain.
[0014] Preferably, the transfer learning sub-model further constructs a generative adversarial network, which distinguishes the features output by the embedding layer of the transfer learning sub-model into domain-independent shared features and domain-dependent private features.
[0015] Preferably, the meta-learning sub-model includes an embedding layer, a feature migration fusion layer, a meta-learning layer and a target domain task prediction layer;
[0016] The domain-shared features and domain-private features from the transfer learning submodule are fine-tuned in two stages, and the output features of the embedding layer of the meta-learning submodel include the shared features and private features after fine-tuning.
[0017] The meta-learning layer calculates the similarity features between labels based on the prototype network, and calculates the dependency features between labels based on the attention mechanism, and obtains the meta-features through the linear combination of the similarity features between labels and the dependency features between labels.
[0018] Preferably, the similarity features between labels are calculated based on the prototype network, specifically, the prototype network calculates the prototype of each label based on the support set, and then calculates the similarity features between labels of the words in the query set according to the dot product function between the words and the prototype;
[0019] The method of calculating the inter-label dependency features based on the attention mechanism is specifically to enhance the dependency relationship between prototypes based on the cross-attention feature extractor, calculate the cross-attention score of each prototype with other prototypes, and then calculate the inter-label dependency features of the word of the query set based on the cross-attention score.
[0020] Another aspect of the present invention provides an event detection method of the above event detection model, comprising the following steps:
[0021] S100, multi-domain dataset D source It is divided into two parts according to different fields, namely D source ={D trans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model; D meta ={D meta1 ,D meta2 ,…} construct a small sample N-class K-sample dataset D for subsequent meta-learning sub-model training meta-train The support set S and query set Q in the code; the remaining data constructs D oo Fine-tune the dataset;
[0022] Target domain imbalanced dataset D target ={Dtrain ,D test} training data set D train It will be divided into two parts, including: constructing a small sample N-class K-sample dataset D for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0023] S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0024] S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channel and the private feature channel to obtain the fusion shared features and domain private features on a regular number of samples to obtain the representation of the emission and conversion scores in the CRF of the domain;
[0025] Using data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0026] S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation;
[0027] The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0028] S500: Detect events in the text using the best annotation sequence output by the model.
[0029] Preferably, all data sets obtained in step S100 are subjected to text preprocessing, including sentence segmentation, word segmentation, punctuation removal, and Gdep parsing tool to obtain dependency tree parsing results and part-of-speech tagging results to obtain corresponding text feature representations.
[0030] Another aspect of the present invention provides an event detection system of the above event detection model, comprising:
[0031] Data collection module, used to collect multi-domain datasets D source It is divided into two parts according to different fields, namely D source ={Dtrans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta ={D meta1 ,D meta2 ,…} construct a small sample N-class K-sample dataset D for subsequent meta-learning sub-model training meta-train The support set S and query set Q in the code; the remaining data constructs D oo Fine-tune the dataset;
[0032] The target domain imbalanced dataset D target ={D train ,D test} training data set D train It is divided into two parts, including: constructing a small sample N-class K-sample dataset D used for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0033] Transfer learning training module for using dataset D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0034] Two-stage transfer learning module for D oo The fine-tuning dataset performs the first-stage fine-tuning on the parameters of the shared feature channels and private feature channels for obtaining domain shared features and domain private features, and obtains the fused shared features and domain private features on a regular number of samples to obtain the representation of the emission and conversion scores in the CRF of the domain;
[0035] Take data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0036] Meta-learning training module for dataset D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on the enhanced attention mechanism and CRF parameter representation; the dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0037] The event detection module is used to detect events in text using the optimal annotation sequence.
[0038] The present invention also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the above-mentioned event detection method.
[0039] The present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the above-mentioned event detection method.
[0040] Beneficial effects: The present invention proposes a small sample meta-learning event detection model, method and system based on two-stage migration for highly unbalanced mixed sample data sets. It is mainly aimed at highly unbalanced mixed sample data sets, which contain some small sample categories (a few categories with very small number of samples) and others are multi-sample categories (containing sufficient number of samples). The purpose of the present invention is to utilize the available related field (source field) and target field data resources to achieve collaborative learning of the two types of data under such highly unbalanced samples.
[0041] In this regard, the present invention introduces transfer learning into small sample meta-learning, establishes a two-stage pre-training method, and supplements the lack of data resources. Specifically, the present invention designs the first stage pre-training based on inter-domain transfer to improve the model's feature expression ability in the target neighborhood and help the subsequent learning of small samples and multi-sample categories. Among them, through the adversarial network module, the shared features between domains are extracted to eliminate the influence of domain private features in the transfer; the present invention designs the second stage pre-training based on intra-domain transfer, and provides richer feature representation for multi-sample categories through the superposition of private transfer features; the present invention designs a meta-learning framework based on the attention prototype network to improve the model's adaptability to the small sample environment, and at the same time, constructs meta-features based on similarity and dependency fusion to improve the learning ability of small sample categories; finally, the present invention integrates the transfer features from the multi-sample category and the meta-features from the small sample category, and the unbalanced category learning coordinates with each other, so that the learning of multi-sample and small sample categories can achieve good performance in a mixed highly unbalanced data set. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a framework diagram of the event detection model of the present invention;
[0043] Figure 2 is a flow chart of the event detection method of the present invention;
[0044] Figure 3 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0046] In order to illustrate all the embodiments of the present application, the problems to be solved by the present application and the related technologies are first described.
[0047] (1) Highly Imbalanced Mixed Sample Event Detection Task
[0048] Event detection is a sequence labeling task. Sentence x = (t1, t2, …, t n ) is defined as a sequence of words, and each word t i is assigned a corresponding label e i , the tag e i is one of the triggered event categories, or a negative category (if it does not trigger any event). Then, the label sequence of sentence x can be defined as y = (e1, e2, …, e n ). A domain is defined as D = {(x j y j )}, where j = 1,…,N D , including N D Group sentence and label sequence pairs (x j y j ). The event detection task in domain D has a corresponding domain-specific label set L D = {l m}, where m = 1,…,N LD , a total of N LD different event categories, then there are e i ∈L D .
[0049] In the target domain D target In the case of extremely unbalanced data {(x j y j )} event detection task, which means that the data label set L D = {lm Some categories in the dataset have very few samples, usually less than 20 samples, which we call small sample categories and have insufficient learning resources. Other categories have several or even dozens of times the number of small samples, which we call multi-sample categories and usually contain sufficient learning resources.
[0050] (2) Small sample event detection task under the meta-learning framework
[0051] N-way K-shot learning with multi-classification as the target task is the main research object of small sample learning. The N-way K-shot problem usually assumes that there are N new categories in the target task, and each new category contains only K labeled samples (K is usually a small value), and the model learns from these samples to identify N new target categories. Specifically, a domain D = (D train ,D test ) is an N-class K-sample small-sample learning task T D From the support set S = D support ={(x s ,y s )} and query set Q = D query ={(x q ,y q )}, where S comes from D train , Q comes from D test The support set contains labeled samples for model meta-training, which is equivalent to the training set; the query set contains unlabeled samples for model meta-testing, which is equivalent to the test set. The support set and query set come from the same target domain D, and have
[0052] N-class K-sample learning is very challenging for deep learning. Due to the scarcity of training data, it is difficult to achieve good results in this scenario, whether it is direct model optimization or transfer learning. Meta-learning abandons the traditional model learning strategy of optimizing the model based only on the current task training data, but allows the model to learn how to deal with this small sample learning problem from a large number of similar small sample tasks in other fields.
[0053] We assume that in the target domain D target In addition, there are multiple other related source domain datasets D source ={D source1 , D source2 , ...}={D trans ,D meta}, contains datasets from different fields, D trans For transfer learning, D meta For meta-learning. In the meta-learning framework, the model usually first metaMedium sampling small sample training task data D meta-train ={D1,D2,…,D k ,…}, these datasets are called meta-training datasets, and these small sample tasks are used for model training.
[0054] Then, from the target domain D target Construct the meta-test dataset D meta-test ={D1',D2',…,D k ',...}, they are new category data that have not appeared in the meta-training dataset. i The event detection task T i ∈D meta-train and from D j 'T j ∈D meta-test is a similar N-type K-sample learning task, and D i and D j 'are divided into a support set S and a query set Q.
[0055] Combine the following Figure 1-Figure 3 The present invention describes an event detection model, an event detection method, a system, a device and a medium.
[0056] Event Detection Model
[0057] This embodiment is based on a very unbalanced dataset D in a given target domain. target and available global annotation dataset D source ={D source1 , D source2 , …} event detection task T D , proposed a two-stage transfer small sample meta-learning event detection model, whose framework is as follows Figure 1 As shown in the figure, it includes a transfer learning sub-model and a meta-learning sub-model built using the Bert-BiLSTM-CRF framework.
[0058] 1. Bert-BiLSTM-CRF model:
[0059] It includes embedding layer (Bert), feature representation layer (BiLSTM) and task prediction layer (CRF).
[0060] (1) In the embedding layer, in order to express the input sentence x = (t1, t2, ..., t n ) in addition to the syntactic and semantic information of each word t k In addition to the word embeddings, we also extract four other feature vectors from part-of-speech embeddings, named entity type embeddings, and dependency tree based word embeddings.
[0061] ①Word embedding vector E w: The pre-trained language representation model Bert is used to map each word in the input sentence to a word embedding vector, which contains semantic information from its linear context.
[0062] ② Part-of-speech embedding vector E p : This vector extracts grammatical information about the part of speech in the sentence. Use the Gdeep parsing tool to extract the part of speech (POS) tag for each word in the sentence.
[0063] ③Named entity type embedding vector E e : It maps the entity type of each word in the input sentence to an embedding vector to extract domain-related information. In some cases, the authority of a named entity spans multiple words. To simplify the generation of word embedding vectors, each word spanned by the named entity is designed to be the same entity type.
[0064] ④Dependency tree embedding vector E d : To extend the features of linear context to non-linear syntactic context, each word in the input sentence is mapped to its dependency tree-based word embedding vector, which contains rich syntactic information. In this paper, we use pre-trained dependency-based word embedding vectors learned from English Wikipedia, trained using the skip gram model.
[0065] (2) The feature representation layer is constructed using bidirectional long short-term memory, and the output of the previous embedding layer is concatenated as the input vector E = [E w ; E p ; E e ; E d ]. The long short-term memory network takes the output vector E of the previous embedding layer as input to extract more advanced abstract features. Then, the bidirectional LSTM effectively captures the forward and backward features of the entire sentence for the sequence labeling task to produce the output feature representation The output of the BiLSTM is mapped through linear and fully connected network layers to obtain the final feature vector F.
[0066] (3) On top of the fully connected layer, the task prediction layer builds the final event trigger word recognizer to generate a label sequence for the corresponding word. For the obtained feature vector F, the probability of generating a label prediction sequence y = (e1, e2, ..., en) is:
[0067]
[0068] Among them, y is the true label sequence, y X is the set of all labeled data, Score(F,y) is the score of predicting the correct label from CRF, is the set of all possible labels and y X Each element in is the score of each possible label. That is, the most likely label y is standardized.
[0069] Therefore, for a given training set (x, y), the model L ED The loss function is defined as follows:
[0070] L ED =-logP(y|x)=-logP(y|F) (2).
[0071] 2. Transfer learning sub-model:
[0072] First, on the labeled multi-domain dataset D source A part of the domain is divided out for transfer learning, namely D trans ={D trans1 , D trans2 , ...}, the remaining domain data constructs D meta For subsequent meta-learning sub-model training, that is, D source ={D trans , D meta Through this transfer learning module, the model is pre-trained, and the model learns the transfer feature representation between different fields, providing a pre-trained feature space for meta-learning, making the subsequent learning process more efficient in convergence and obtaining better recognition performance for small sample categories and multiple sample categories.
[0073] In order to further improve the feature expression ability of the transfer module, a generative adversarial network is constructed in the transfer learning sub-model to achieve adversarial transfer learning. The generative adversarial network is used to distinguish between domain-independent shared features and domain-dependent private features, eliminating the noise impact of non-transferable features in different domain data. Domain-independent shared features are also called domain-invariant features (F c ), provided by the shared feature channel; private features (F p ) is provided by the private feature channel.
[0074] The main idea of constructing pre-trained feature channels is to use domain-invariant feature channels (i.e., shared features F) across multiple domains that are beneficial to the prediction task (event detection). c ) and domain-specific feature channels that mainly contribute to its own prediction task (private features F p ) for explicit modeling.
[0075] (1) Private feature channel
[0076] The private feature channel is the feature representation (BiLSTM) network in the basic Bert-BiLSTM-CRF model, which extracts domain-specific private features from the embedded representation of the input sentence.
[0077] (2) Shared feature channels
[0078] The shared feature channel extracts common features between domains through a generative adversarial network. The generative adversarial network mainly consists of two parts: the shared feature channel and the domain discriminator (DC) layer. The shared feature channel uses the feature representation network in the basic Bert-BiLSTM-CRF model, which produces domain-invariant features. The domain discriminator DC takes the F of the input sentence x c The feature vector is used as input and the Softmax layer is used to classify the field to which the sentence belongs, which can be expressed as follows:
[0079] DC(F c )=softmax(W DC F g +b DC ) (3);
[0080] Where W DC and b DC are the weights and biases of the DC network, which can be expressed as the trainable parameters θ of the network DC . Therefore, the loss function of the adversarial network can be expressed as follows:
[0081]
[0082] where θc is a trainable parameter of the BiLSTM network representing the shared feature channels. Tk is the number of training samples for domain k, is the i-th sentence from domain k. Indicates the domain label corresponding to the current input sentence. The purpose of adversarial training is to make DC unable to effectively recognize the input sentence From which domain task. Therefore, during training, DC is driven to be unable to be based on F under the min-max optimization c The points in the domain of the predicted input, i.e., the private features of the domain, are prevented from entering the shared feature channel. Therefore, those features F obtained through training c Essentially domain invariant.
[0083] (3) Feature Representation Fusion Layer
[0084] In the transfer learning sub-model, the features used for event detection task label prediction are provided through the private feature channel in this field and the cross-domain shared feature channel. In the feature representation fusion layer, all these features are fused through cascading, that is, F = [F c ; F p]. Similar to the basic Bert-BiLSTM-CRF model, the fused feature F is mapped through the fully connected network and the CRF layer to generate the label sequence corresponding to the input sentence. Therefore, its loss function expression L ED That is formula (2).
[0085] (4) Adversarial Transfer Learning
[0086] The training of adversarial learning requires joint training of private feature channels and domain-invariant shared feature channels: private feature channels will learn specific features in their domain; the learning of shared feature channels helps DC generate common feature distributions across all domains and provides these common features for higher performance in event detection tasks. Therefore, the overall loss function L of the adversarial transfer learning module is trans It can be calculated as follows:
[0087] L trans =L ED +λL Adv (5);
[0088] Here, λ is a hyperparameter that balances domain discriminator learning and event detection learning.
[0089] 3. Meta-learning sub-model:
[0090] Subsequently, in order to enable the model pre-trained using adversarial transfer to quickly adapt to the learning of small categories, the present invention is inspired by the meta-learning framework when fine-tuning in the target domain and constructs a meta-learning sub-model.
[0091] The model is trained from the dataset D meta Many samples related to the target task T are sampled D Similar few-shot learning task dataset D meta-train =(S,Q). From these tasks, the model learns how to cope with the need for fast convergence in small sample learning. In order to avoid the significant reduction of feature expression caused by using only small sample data in the meta-learning process, the present invention integrates and selects features from transfer learning and small sample meta-features from prototype networks and cross-attention networks on the basis of obtaining network parameters for transfer pre-training to complete hybrid learning of small sample categories and multi-sample categories. These main components of the meta-learning sub-model will be introduced below.
[0092] (1) Feature Migration and Fusion Representation Layer
[0093] In order to make full use of the data to achieve better mixed training effects of small sample categories and multi-sample categories: ①D meta Construct from domain D i The event detection task T iThe small sample N-class K-sample dataset D used for subsequent meta-learning sub-model training meta-train The support set S and query set Q in the code; the remaining data constructs D oo Fine-tuning dataset; ② Target domain imbalanced dataset D target ={D train ,D test} training data set D train It will be divided into two parts: constructing an event detection task T from the target domain D Meta-learning of a small sample N-class K-sample dataset D meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset. target The test data set D test Structure formation D meta-test Q in.
[0094] Different from general transfer learning, this paper proposes a two-stage transfer learning model to counter the network parameters of the transfer learning unit, including Bert, shared feature channels and private feature channels, which are set in D oo and D meta-train ① In the first stage of migration, the embedded features E and shared features F obtained by pre-training are used. c and private feature F p Using dataset D oo Fine-tune and transfer from the adversarial transfer learning network to the meta-learning network. ② In the second stage of transfer, these features are transferred using the small sample dataset D meta-train The feature representation E obtained after fine-tuning M 、F c M and F p M , which will supplement the problem of insufficient feature learning using only a small sample dataset in the meta-learning process. i N-class K-sample learning task T i From the support set S = {(x s ,y s )} and the query set Q = {(x q ,y q )}, so these features are represented as E of the support set and query set respectively. Ms ,F c Ms ,F p Ms and E Mq ,F c Mq ,F p Mq .
[0095] Finally, the feature transfer fusion layer connects the shared and private features of the two fine-tunings to construct features of different capacities of the samples, F s =[F c Ms ,F p Ms ] and F q =[F c Mq ,F p Mq ]. s and F q At the same time, it provides shared functions among multiple source domains and private functions in the target domain. Through migration and fusion, it greatly enriches the characteristics of small sample data in the target domain.
[0096] (2) Meta-learning layer
[0097] Few-shot learning poses unique challenges to event detection tasks: event detection is a sequence labeling problem, which requires modeling the dependencies between labels based on few-shot data to achieve better labeling results. Therefore, this meta-learning layer is constructed to extract meta-features: including inter-label similarity features based on prototype networks and inter-label dependency features based on attention mechanisms.
[0098] ① Prototype network
[0099] The prototype network first calculates the prototype of each label based on the support set S. For each category k, use S k to denote the set of all words in the support set S that contain label k. These sets are used to compute prototypes by averaging all representations with that label as follows:
[0100]
[0101] Where M is the total number of prototypes. Since our event trigger annotation adopts BIO mode, N event types can contain 2N+1 class labels, including negative labels O. k Represents the set S k The prototype on label k, |S k | represents the number of tags in the set, F s Represents the migration and fusion features of word t from the previous layer.
[0102] The label similarity feature is calculated based on the similarity between the word and the prototype. The similarity feature of the label of the word from the query set Q is calculated as follows:
[0103] F s (y i ,t m,Q)=Sim(c i ,F q (t m )) (7);
[0104] Among them, Sim(,) is a similarity function based on dot product operation, F q is the migration and fusion feature from the previous layer. Therefore, the similarity feature of sentence x is represented by F s (x)=[F s (y i ,t m ,Q)].
[0105] ② Dependence enhancement mechanism
[0106] The lack of dependency information will make it difficult to detect events, so the features of dependencies between prototypes (labels) are important for event detection. Traditionally, this dependency can be learned from a large amount of training data, but in small sample learning, it is difficult for network parameters to be fully learned. To overcome this difficulty, we propose a cross-attention-based feature extractor to enhance the dependencies between prototypes. The attention mechanism is a fast memory network composed of associative matrix units that store attention scores. The unit is sparse and each unit needs to be learned. Each prototype c i The cross-attention score with other prototypes is calculated as follows:
[0107]
[0108] Based on the cross attention score, the word t from the query set Q m Label y i The dependency characteristics of are calculated as follows:
[0109]
[0110] Therefore, the dependency feature of sentence x is represented as F d (x)=[F d (y i ,t m ,Q)].
[0111] ③Meta-features
[0112] Finally, using a fully connected network, meta-features are obtained by linear combination of similarity and dependency features as follows:
[0113] F m (x) = F s (x)+w m F d (x)+b m (10);
[0114] Among them, w m is a scaling parameter that balances the weights of the two features, b m are the network biases learned during training.
[0115] (3) Task prediction layer
[0116] In the target domain task prediction layer, one challenge of CRF learning is that it is difficult to learn the emission and conversion scores in CRF based on small sample data. oo This problem is jointly addressed by the pre-trained CRF and meta-features from the previous layer, which provide a basis for fine-tuning as well as a combinatorial representation of label similarities and dependencies to help quickly learn the emission and conversion scores of the CRF in the target domain.
[0117] Therefore, the target domain loss function in the meta-learning unit is defined as follows:
[0118] L meta = -logP(y|x) = -logP(y|F m (x)) (11).
[0119] Event Detection Methods
[0120] This embodiment provides an event detection method. In order to explain this embodiment in detail, this embodiment takes an actual biomedical text application event detection method as an example.
[0121] S100, Dataset Preparation
[0122] (1)DataMLEE
[0123] This embodiment uses the corpus DataMLEE as the target domain dataset. The DataMLEE corpus (2012) is taken from 262 PubMed abstracts. In DataMLEE, 19 event types are selected from the GENIA ontology, which can be divided into four major categories: anatomical, molecular, general and planned. Table 1 lists the detailed size of the event trigger category under each major category of DataMLEE. It can be found from Table 1 that the category with the largest number of samples (Positive regulation) has more than 600 training samples, while the category with the smallest sample size (Dephosphorylation) has only 2 samples, and the data imbalance is very serious. Among the 19 categories, 9 categories have less than 100 training samples, which is theoretically insufficient to obtain a fully trained neural network model. Therefore, this meets the definition of a typical learning of highly uneven and mixed sample data in the present invention.
[0124] Table 1 List of event trigger word types and sample numbers in DataMLEE
[0125]
[0126]
[0127] In addition, this embodiment also uses the prediction libraries DataST09, DataEPI, DataDNAm and DataID as source domain datasets, all of which are from the biomedical field related to DataMLEE. They will be briefly introduced below.
[0128] DataST09: This corpus is taken from the shared task (ST) of the BioNLP Challenge 2009 and contains 950 abstracts from PubMed. In this corpus, 9 event types are selected from the GENIA ontology, each with a minimum of 118 and a maximum of 2611 training samples.
[0129] DataEPI,: This corpus is taken from the Epigenetics and Post-translational Modification (EPI) task of the BioNLP challenge 2011 and contains 800 abstracts from PubMed. In this corpus, there are 15 event types. The number of annotated samples in DataEPI is less than DataST09, but more event types are annotated.
[0130] DataDNAm: This corpus consists of event extraction summaries related to the BioNLP shared task. In this corpus, there are 15 event types.
[0131] (5) DataID: This corpus is taken from the infectious disease (ID) task of the BioNLP Challenge 2011 and is collected from the 30 most recent full-text PMC open access documents. In this corpus, 10 event types were selected.
[0132] During the training and testing of the model, three types of datasets will be used. They can be constructed from the above data sources. ① The first two datasets D used to build the adversarial transfer learning module trans and D oo It can be directly inherited from the source domain prediction library and the target domain prediction library respectively. ② The dataset D used to build the meta-learning sub-model meta-train and D meta-test : It needs to be constructed in the form of N-class K samples in the typical meta-training and meta-testing settings. Whether in the meta-training or meta-testing phase, the dataset consists of a support set S and a query set Q, that is, D meta-train ={(x s ,y s ), (x q,y q )} and D meta-test ={(x s ,y s ), (x q ,y q )}. These four sets can be obtained by calling Algorithm 1 four times with parameters N and K respectively represented by D meta and D target Build.
[0133] S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0134] S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channel and the private feature channel to obtain the fusion shared features and domain private features on a regular number of samples to obtain the representation of the emission and conversion scores in the CRF of the domain;
[0135] Using data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0136] S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation;
[0137] The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0138] S500: Detect events in the text using the best annotation sequence output by the model.
[0139] Comparison of test results
[0140] (1) Comparison of performance of biological event detection models
[0141] First, based on the same dataset DataMLEE, the detection method of the present invention is compared with other detection methods. Table 2 lists the performance comparison of the two in detail, using the following three metrics: P (precision), R (recall) and F1 (F1 value, which is the weighted geometric mean of recall and precision).
[0142] Table 2 Performance comparison of event detection models
[0143]
[0144]
[0145] In Table 2, CNN-based System is a window-based convolutional neural network classifier. RNN-based System uses recurrent neural networks to extract high-level sentence features in trigger recognition. Fine-grained and attention-based Neural Network System proposes a fine-grained bidirectional long short-term memory and multi-level attention for biomedical event extraction. Attention-based Neural Network System is built based on a novel contextual label-sensitive gating network for biomedical event trigger extraction, and an attention mechanism for obtaining a more concentrated representation of dependency-based semantic information. Convolutional Highway Neural Network System is a neural network model with an end-to-end architecture for detecting biomedical event triggers. Multi-layer residual BiLSTM Neural Network System is built based on the proposed language model for dynamically computing contextualized word representations and a multi-layer residual bidirectional long short-term memory (BiLSTM) architecture. Child-Sum Tree-LSTM Neural Network System aims to deeply mine semantic features for trigger detection. The system utilizes two new gating mechanism variants to combine peephole connections and coupling mechanisms into a tree structure model. Joint-GATE-Sentence Neural Network System builds a model in which latent topics are learned at the sentence level. BioBERT-basedNeural NetworkSystem is built using the Bio BERT model source code (https: / / github.com / dmis-lab / biobert), which has almost the same architecture as BERT and is pre-trained on biological datasets. Child-Sum EATree-LSTMsNeural Network System improves the detection ability of event trigger words by introducing an attention mechanism.
[0146] The results in Table 2 show that compared with the existing advanced models, the detection method of the small sample meta-learning event detection model using two-stage transfer in the present invention can achieve the best overall performance.
[0147] (2) Migration performance analysis
[0148] The following compares the performance impact of transfer learning on event detection models. Among these models, the basic Bert-BiLSTM-CRF model is a non-transfer event detection model that does not use any additional data and is trained only on the target domain data DataMLEE. The single-source one-stage transfer event detection model uses a single source domain data for transfer learning and is trained on the target domain data DataMLEE. meta-train The event detection model of multi-source one-stage transfer uses multiple source domain data for adversarial transfer learning and D meta-train The two-stage transfer small sample meta-learning event detection model proposed in this invention uses multiple source domain data for transfer learning and uses the D oo and D meta-train The two-stage fine-tuning is performed on the target domain data, and the meta-learning model is used to perform small sample learning. The model performance comparison is shown in Table 3.
[0149] Table 3 Migration performance comparison
[0150]
[0151]
[0152] The results in Table 3 show that the detection method of the small sample meta-learning event detection model based on two-stage migration proposed in the present invention has higher performance than the detection methods of the model without migration, the single-source one-stage migration and the multi-source one-stage migration. This shows that migration can effectively obtain feature information of other related neighborhoods. The more source domains can bring more pre-trained feature information, which is achieved by the adversarial module of our model, filtering private feature information and retaining shared feature information. Furthermore, through the second stage migration, richer target domain features are provided for the subsequent small sample learning.
[0153] (3) Small Sample Learning Performance Analysis
[0154] The following is a comparison of the performance of small sample meta-learning on event detection models under highly imbalanced datasets. In these models, the basic Bert-BiLSTM-CRF model is consistent with the settings of the previous experiment, and meta-learning for small samples is not used.
[0155] Table 4 Comparison of small sample learning performance
[0156]
[0157]
[0158]
[0159] The results in Table 4 show that compared with the model without small sample meta-learning, the small sample meta-learning event detection model with two-stage migration proposed in the present invention can better identify the categories with very little training data (up to 20 samples) in the data set, including Synthesis, Transcription, Protein catabolism and Dephosphorylation, whose training data are 13, 16, 20 and 2 respectively. In particular, for Protein catabolism and Dephosphorylation, the recognition F1 value of the basic Bert-BiLSTM-CRF model is 0, and it has no recognition ability for small sample data. The model proposed in the present invention improves the recognition F1 value of these two categories to 88.89 and 100, which strongly proves that our model can effectively identify small sample categories. Furthermore, the recognition performance of multi-sample categories has also been improved, which can effectively improve the recognition performance of mixed extremely unbalanced data at the same time.
[0160] Event Detection System
[0161] This embodiment provides an event detection system, including:
[0162] Data collection module, used to collect multi-domain datasets D source It is divided into two parts according to different fields, namely D source ={D trans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta ={D meta1 ,D meta2 ,…} construct D for subsequent meta-learning sub-model training meta-train The support set S, query set Q and fine-tuning dataset D oo ;
[0163] The target domain imbalanced dataset D target ={D train ,D test} training data set D train It is divided into two parts, including: constructing a small sample N-class K-sample dataset D used for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0164] Transfer learning training module for using dataset D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0165] Two-stage transfer learning module for D oo The fine-tuning dataset performs the first stage fine-tuning on the parameters of the shared feature channels and private feature channels for obtaining the shared features between domains and the private features in the domain, so as to form the migration features on the conventional number of samples and obtain the representation of the emission and conversion scores in the CRF of the domain;
[0166] Take data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0167] Meta-learning training module for dataset D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on the enhanced attention mechanism and CRF parameter representation; the dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0168] The event detection module is used to detect events in text using the optimal annotation sequence.
[0169] Non-transitory computer readable storage medium
[0170] This embodiment provides a non-transitory computer-readable storage medium having computer instructions stored thereon, the computer instructions causing a computer to execute an event detection method, the method comprising the following steps:
[0171] S100, multi-domain dataset D source It is divided into two parts according to different fields, namely D source ={D trans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta Construct D for subsequent meta-learning sub-model training meta-train The support set S and query set Q and fine-tuning dataset D in oo ;
[0172] Target domain imbalanced dataset D target ={D train ,Dtest} training data set D train It will be divided into two parts, including: constructing a small sample N-class K-sample dataset D for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0173] S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0174] S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channels and private feature channels that obtain the shared features between domains and the private features in this field, which are used to form the migration features on the conventional number of samples and obtain the representation of the emission and conversion scores in the target domain CRF;
[0175] Using data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0176] S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation;
[0177] The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0178] S500: Detect events in the text using the best annotation sequence output by the model.
[0179] Electronic devices
[0180] This embodiment provides an electronic device, Figure 3An example of a physical structure diagram of an electronic device is shown, and the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the event detection method, and the method includes the following steps:
[0181] S100, multi-domain dataset D source It is divided into two parts according to different fields, namely D source ={D trans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta Construct D for subsequent meta-learning sub-model training meta-train The support set S and query set Q and fine-tuning dataset D in oo ;
[0182] Target domain imbalanced dataset D target ={D train ,D test} training data set D train It will be divided into two parts, including: constructing a small sample N-class K-sample dataset D for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0183] S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0184] S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channels and private feature channels that obtain the shared features between domains and the private features in this field, which are used to form the migration features on the conventional number of samples and obtain the representation of the emission and conversion scores in the target domain CRF;
[0185] Using data set D meta-trainThe parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0186] S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation;
[0187] The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0188] S500: Detect events in the text using the best annotation sequence output by the model.
[0189] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0190] Computer program product
[0191] This embodiment provides a computer program product, which includes a computer program. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform an event detection method. The method includes the following steps:
[0192] S100, multi-domain dataset D source It is divided into two parts according to different fields, namely D source ={D trans , D meta}, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta Construct D for subsequent meta-learning sub-model training meta-trainThe support set S and query set Q and fine-tuning dataset D in oo ;
[0193] Target domain imbalanced dataset D target ={D train ,D test} training data set D train It will be divided into two parts, including: constructing a small sample N-class K-sample dataset D for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in
[0194] S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels;
[0195] S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channels and private feature channels that obtain the shared features between domains and the private features in this field, which are used to form the migration features on the conventional number of samples and obtain the representation of the emission and conversion scores in the target domain CRF;
[0196] Using data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample;
[0197] S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation;
[0198] The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence;
[0199] S500: Detect events in the text using the best annotation sequence output by the model.
[0200] The algorithm for constructing an N-class K-sample dataset can be expressed as follows:
[0201] Input: Dataset D (from source domain dataset D source Or target domain dataset D target )
[0202] The number of sentences in the dataset M
[0203] Number of categories N
[0204] The number of samples K for each category
[0205] The upper limit kU of the number of samples for each category
[0206] The event label set LN = {1, 2, ..., N}, contains N different category labels, that is, N categories
[0207] Episode, that is, the number of batches of all N types and K samples
[0208] Output: D meta (By D source Constructed D meta-train Or by D target Constructed D meta-test ) of S or Q, containing N types of K sample data
[0209]
[0210]
[0211] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0212] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0213] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An event detection model, characterized in that: include: The transfer learning sub-model and meta-learning sub-model are constructed using the Bert-BiLSTM-CRF framework respectively; The transfer learning sub-model uses a portion of the labeled datasets of other related source domains for pre-training to learn shared feature representations between different domains and provide a pre-trained feature space for the meta-learning sub-model. The meta-learning sub-model uses another part of the labeled multiple other related source domain datasets and the target domain dataset to build the meta-training set and meta-test set of the model; based on the network parameters of the pre-trained transfer learning sub-model, it integrates and selects features from the transfer learning sub-model, combines the small sample meta-features from the prototype network and the cross-attention network, and performs hybrid learning on the small sample categories and multi-sample categories in the target domain.
2. The event detection model according to claim 1, characterized in that: The transfer learning sub-model also constructs a generative adversarial network, which distinguishes the features output by the embedding layer of the transfer learning sub-model into domain-independent shared features and domain-dependent private features.
3. The event detection model according to claim 2, characterized in that: The meta-learning sub-model includes an embedding layer, a feature transfer fusion layer, a meta-learning layer, and a target domain task prediction layer; The domain-shared features and domain-private features from the transfer learning submodule are fine-tuned in two stages, and the output features of the embedding layer of the meta-learning submodel include the shared features and private features after fine-tuning. The meta-learning layer calculates the similarity features between labels based on the prototype network, and calculates the dependency features between labels based on the attention mechanism, and obtains the meta-features through the linear combination of the similarity features between labels and the dependency features between labels.
4. The event detection model according to claim 3, characterized in that: The similarity feature between labels is calculated based on the prototype network, specifically, the prototype network calculates the prototype of each label based on the support set, and then calculates the similarity feature between labels of the words in the query set according to the dot product function between the words and the prototype; The method of calculating the inter-label dependency features based on the attention mechanism is specifically to enhance the dependency relationship between prototypes based on the cross-attention feature extractor, calculate the cross-attention score of each prototype with other prototypes, and then calculate the inter-label dependency features of the word of the query set based on the cross-attention score.
5. An event detection method based on any one of the event detection models of claims 1-4, characterized in that: The steps include: S100, multi-domain dataset D source It is divided into two parts according to different fields, namely D source ={D trans , D meta }, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model; D meta ={D meta1 ,D meta2 ,…} construct a small sample N-class K-sample dataset D for subsequent meta-learning sub-model training meta-train The support set S and query set Q in the code; the remaining data constructs D oo Fine-tune the dataset; Target domain imbalanced dataset D target ={D train ,D test } training data set D train It will be divided into two parts, including: constructing a small sample N-class K-sample dataset D for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in S200, using data set D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels; S300, use D oo The fine-tuning dataset performs the first stage of fine-tuning on the parameters of the shared feature channel and the private feature channel to obtain the fusion shared features and domain private features on a regular number of samples to obtain the representation of the emission and conversion scores in the CRF of the domain; Using data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample; S400, using data set D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on enhanced attention mechanism and CRF parameter representation; The dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence; S500: Detect events in the text using the best annotation sequence output by the model.
6. The event detection method according to claim 5, characterized in that: All data sets obtained in step S100 are subjected to text preprocessing, including sentence segmentation, word segmentation, punctuation removal, and the Gdep parsing tool to obtain dependency tree parsing results and part-of-speech tagging results, and obtain corresponding text feature representations.
7. An event detection system based on any one of the event detection models of claims 1-4, characterized in that: include: Data collection module, used to collect multi-domain datasets D source It is divided into two parts according to different fields, namely D source ={D trans , D meta }, D trans ={D trans1 , D trans2 , …} is the pre-training dataset for transfer learning sub-model, D meta ={D meta1 ,D meta2 ,…} construct a small sample N-class K-sample dataset D for subsequent meta-learning sub-model training meta-train The support set S and query set Q in the code; the remaining data constructs D oo Fine-tune the dataset; The target domain imbalanced dataset D target ={D train ,D test } training data set D train It is divided into two parts, including: constructing a small sample N-class K-sample dataset D used for meta-learning meta-test The support set S in the , and the remaining data is constructed as D oo Fine-tune the dataset; D target The test data set D test Structure formation D meta-test The query set Q in Transfer learning training module for using dataset D trans Train the transfer learning sub-model and the adversarial generation network of the transfer learning sub-model by optimizing the loss function L trans , optimize the parameter representation of shared feature channels and private feature channels; Two-stage transfer learning module for D oo The fine-tuning dataset performs the first-stage fine-tuning on the parameters of the shared feature channels and private feature channels for obtaining domain shared features and domain private features, and obtains the fused shared features and domain private features on a regular number of samples to obtain the representation of the emission and conversion scores in the CRF of the domain; Take data set D meta-train The parameters of the shared feature channel and the private feature channel are fine-tuned in the second stage to form the migration features on the small sample; Meta-learning training module for dataset D meta-train Train the meta-learning sub-model by optimizing the loss function L meta , train the prototype network, rely on the enhanced attention mechanism and CRF parameter representation; the dataset D meta-test Input the trained meta-learning sub-model to obtain the best labeling sequence for the input sequence; The event detection module is used to detect events in text using the optimal annotation sequence. 8 . A non-transitory computer-readable storage medium having computer instructions stored thereon, the computer instructions causing a computer to execute the event detection method according to claim 5 .
9. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the event detection method described in claim 5.
10. A computer program product, comprising a computer program, wherein the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the event detection method according to claim 5.
Citation Information
Cited By
Data node adaptive optimization method based on causal reasoning and prototype learning
CN119179580A
A Data Node Adaptive Optimization Method Based on Causal Reasoning and Prototype Learning
CN119179580B
Locomotive air source compressor fault detection method and device, storage medium and electronic equipment
CN119984886A
Coating surface defect real-time detection system and method based on deep learning
CN120766012A
