Event extraction method, electronic equipment, storage medium and program product
Through feature encoding and virtual event type embedding combined with convolutional network and dual affine attention prediction strategy, the recognition and extraction problem of event extraction in the absence of predefined event mode is solved, and effective recognition and extraction of event trigger words and arguments in the text is achieved.
Patent Information
- Application Number
- CN202510914969.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-03
AI Technical Summary
The existing deep learning-based event extraction method cannot effectively identify and extract event trigger words and arguments in text without predefined event mode.
The input data is characterized by using a preset feature encoding strategy, trigger word embedding and structural embedding are obtained, and feature fusion is performed through virtual event type embedding, probability prediction is performed by combining the preset convolutional network and dual affine attention prediction strategy, and finally the fused output event extraction result is extracted.
It improves the generalization of the model in the absence of predefined event mode, and can effectively identify and extract event trigger words and arguments in text.
Smart Images

Figure CN120408540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer processing technologies, and in particular, to an event extraction method, an electronic device, a storage medium, and a program product. Background Art
[0002] With the rapid development of information technologies, special equipment such as elevators, lifting machinery, and industrial vehicles have all established and connected to various Internet of Things platforms. These platforms accumulate and store a large amount of unstructured or semi-structured device operation data every day. In view of this, extracting structured information from unstructured information and organizing it into an effective information knowledge system has become a hot topic of current concern.
[0003] Currently, the event extraction method based on deep learning is the mainstream technical means for realizing event extraction. However, the current event extraction method has the problem of being unable to effectively identify and extract event trigger words and arguments in the text under the condition of no predefined event pattern. Summary of the Invention
[0004] In view of this, the purpose of the embodiments of the present application is to provide an event extraction method, an electronic device, a storage medium, and a program product, which can improve the problem that the traditional event extraction method cannot effectively identify and extract event trigger words and arguments in the text under the condition of no predefined event pattern.
[0005] To achieve the above technical purpose, the technical solution adopted by the present application is as follows:
[0006] In a first aspect, an event extraction method is provided in an embodiment of the present application, and the method includes:
[0007] Obtain input data including an event to be extracted;
[0008] Based on a preset feature encoding strategy, perform feature encoding on the input data to obtain a trigger word embedding representing the semantic feature of the input data and a structure embedding representing the structural feature of the input data;
[0009] Obtain a preset virtual event type embedding representing the event type feature;
[0010] Perform feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data;
[0011] Based on the first feature vector, perform probability prediction on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result;
[0012] Based on the first feature vector, perform probability prediction on the input data according to a preset bi-affine attention prediction strategy to obtain a second prediction result;
[0013] Fuse and output the first prediction result and the second prediction result to obtain an event extraction result.
[0014] In combination with the first aspect, in some alternative embodiments, obtaining input data including an event to be extracted includes:
[0015] Obtain text data including the event to be extracted;
[0016] Split the text data into token representations;
[0017] Perform vector transformation on the token representations to obtain token embedding vectors corresponding to the token representations;
[0018] Convert the token representations into AMR graph representations through a preset AMR parsing strategy to obtain trigger word node information;
[0019] Use the token embedding vectors and the trigger word node information as the input data.
[0020] In combination with the first aspect, in some alternative embodiments, perform feature encoding on the input data based on a preset feature encoding strategy to obtain a trigger word embedding representing the semantic features of the input data and a structure embedding representing the structural features of the input data, including:
[0021] Perform first feature encoding on the input data through a preset BERT pre-trained model to obtain the trigger word embedding;
[0022] Perform second feature encoding on the input data through a preset AGGCN pre-trained model to obtain the structure embedding.
[0023] In combination with the first aspect, in some alternative embodiments, perform feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data, including:
[0024] For a target trigger word embedding in the trigger word embedding, determine an attention score between the target trigger word embedding and the preset virtual event type embedding through the following formula, where the target trigger word embedding represents a second feature vector corresponding to a trigger word with an overlapping situation in the trigger word embedding:
[0025]
[0026] In the formula, represents an inner product operation, represents the target trigger word embedding and the th virtual event type embedding's attention score, , represents the total number of virtual event type embeddings in the preset virtual event type embedding;
[0027] Sort the multiple virtual event type embeddings in the preset virtual event type embedding based on the attention scores, and select the top m virtual event type embeddings with the largest attention scores as the target virtual event type embeddings, where m is equal to the maximum value in the number of the target trigger word embeddings;
[0028] Perform feature encoding on the target virtual event type embedding through a first preset multi-layer perceptron to obtain virtual event embedding features;
[0029] Perform a first gated conditional normalization operation on the trigger word embedding and the virtual event embedding features to obtain a first fusion feature vector, which is expressed as follows:
[0030]
[0031]
[0032]
[0033] In the formula, and respectively represent the element-wise multiplication of vectors and the vector concatenation operation, , , , are learnable parameters, represents the feature vector in the structure embedding in the feature vector perform gated conditional normalization on the condition, represents the feature vector in the trigger word embedding, represents the corresponding virtual event embedding feature, represents the first gated unit, and are the feature vectors in the structure embedding the mean and standard deviation among the dimensions, which are expressed as follows:
[0034]
[0035]
[0036] In the formula, represents the th dimensional eigenvalue of the
[0037] Perform a feature concatenation operation on the first fusion feature vector and the structure embedding to obtain a second fusion feature vector, which is used as the first feature vector and is expressed as follows:
[0038]
[0039] In the formula, represents the first fusion feature vector between word and word , represents the structure embedding, , and [[ID=2)) are learnable parameters, represents the sigmoid activation function.
[0040] Combined with the first aspect, in some alternative embodiments, based on the first feature vector, perform a probability prediction on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result, including:
[0041] Perform a second gated conditional normalization operation on the first feature vectors corresponding to any two token representations in the input data to obtain the pair-wise relationship feature between the any two token representations, which is expressed as follows:
[0042]
[0043]
[0044]
[0045]
[0046] In the formula, and respectively represent the first feature vectors corresponding to the token representations and , , , , and are learnable parameters, represents the second gated unit, and respectively represent the average value and the standard deviation between the dimensions in the first feature vector corresponding to the token representation , which are expressed as follows:
[0047]
[0048]
[0049] In the formula, represents the token representation the corresponding first eigenvector of the dimensional eigenvalue;
[0050] Obtain a preset first index matrix and a preset second index matrix;
[0051] Through the preset first index matrix and the preset second index matrix, respectively determine the relative distance embedding of word pairs and the regional embedding of word pairs;
[0052] Encode the concatenated features of the word pair relationship feature, the relative distance embedding of the word pair, and the regional embedding of the word pair through a second preset multi-layer perceptron to obtain a grid feature representation, which is expressed as follows:
[0053]
[0054] In the formula, represents the grid feature representation, represents the span prediction or relationship prediction in probability prediction, represents the word pair relationship feature, represents the relative distance embedding of word pairs, represents the regional embedding of word pairs, represents the second preset multi-layer perceptron;
[0055] Extract features from the grid feature representation through a dilated convolutional network to obtain a third fused feature vector, which is expressed as follows:
[0056]
[0057] In the formula, represents the dilation rate as of the dilated convolutional network for the grid feature representation after feature extraction to obtain the third fused feature vector, represents the ReLU activation function, represents the dilation rate as of the dilated convolution;
[0058] For any word pair representation in the input data, respectively encode the span prediction feature vector and the relationship prediction feature vector in the third fused feature vector corresponding to the any word pair representation through a third preset multi-layer perceptron and a fourth preset multi-layer perceptron to obtain the first span prediction score vector and the first relationship prediction score vector corresponding to the any word pair representation, as the first prediction result, which is expressed as follows:
[0059]
[0060]
[0061] Wherein, represents the first span prediction score vector of the word pair ; represents the first relationship prediction score vector of the word pair ; represents the span prediction feature vector in the third fusion feature vector corresponding to the word pair ; represents the relationship prediction feature vector in the third fusion feature vector corresponding to the word pair ; represents the third preset multi-layer perceptron, represents the fourth preset multi-layer perceptron.
[0062] Combined with the first aspect, in some alternative embodiments, according to the first feature vector, a probability prediction is performed on the input data based on a preset bi-affine attention prediction strategy to obtain a second prediction result, including:
[0063] The first feature vector is respectively encoded by a fifth preset multi-layer perceptron and a sixth preset multi-layer perceptron to obtain the head feature representation and the tail feature representation of the token in the input data, as the token feature representation, which is expressed as follows:
[0064]
[0065]
[0066] Wherein, and respectively represent the head feature representation and the tail feature representation of the token, represents the fifth preset multi-layer perceptron, represents the sixth preset multi-layer perceptron;
[0067] The token feature representation is concatenated with the first feature vector, and the concatenated token feature representation is respectively encoded by a seventh preset multi-layer perceptron and an eighth preset multi-layer perceptron to perform feature fusion on the first feature vector and the head feature representation, and the first feature vector and the tail feature representation respectively, to obtain a fourth fusion feature vector and a fifth fusion feature vector, which is expressed as follows:
[0068]
[0069]
[0070] Wherein, represents the seventh preset multi-layer perceptron, Denotes the eighth preset multi-layer perceptron, Denotes the vector concatenation operation, Denotes the first feature vector after concatenation through the seventh preset multi-layer perceptron And the head feature representation After encoding, the obtained fourth fusion feature vector, Denotes the first feature vector after concatenation through the eighth preset multi-layer perceptron And the tail feature representation After encoding, the obtained fifth fusion feature vector;
[0071] According to the fourth fusion feature vector and the fifth fusion feature vector, through the first bi-affine attention prediction strategy, perform span prediction on the probability prediction of any word pair representation in the input data, and obtain the second span prediction score vector corresponding to the any word pair representation, which is expressed as follows:
[0072]
[0073] In the formula, Denotes the second span prediction score vector of the word pair And And Respectively denote the i-th feature vector in the fourth fusion feature vector And the j-th feature vector in the fifth fusion feature vector , , And Are respectively learnable parameters, Denotes the vector concatenation operation;
[0074] Perform a bilinear transformation operation on the first feature vector to obtain the relationship feature matrix between the tokens in the input data, which is expressed as follows:
[0075]
[0076] In the formula, Denotes the relationship feature matrix between the tokens, Denotes the activation function, Denotes the learnable bilinear transformation matrix;
[0077] Encode the concatenated features of the first feature vector, the fourth fusion feature vector, and the fifth fusion feature vector through the ninth preset multi-layer perceptron to obtain the boundary constraint feature vector, which is expressed as follows:
[0078]
[0079] In the formula, Denote the boundary constraint feature vector, denote the ninth preset multi-layer perceptron;
[0080] Encode the relationship feature matrix through the tenth preset multi-layer perceptron to obtain the sixth fusion feature vector, which is expressed as follows:
[0081]
[0082] where, denote the sixth fusion feature vector, denote the tenth preset multi-layer perceptron;
[0083] Through the second bi-affine attention prediction strategy, perform relationship prediction on the probability prediction of the arbitrary word pair representation in the input data to obtain the second relationship prediction score vector corresponding to the arbitrary word pair representation, which is expressed as follows:
[0084]
[0085] where, denote the word pair 's second relationship prediction score vector, and respectively denote the i-th feature vector in the boundary constraint feature vector and the j-th feature vector in the sixth fusion feature vector , <e , and are respectively learnable parameters, denote the vector concatenation operation;
[0086] Take the second span prediction score vector and the second relationship prediction score vector as the second prediction result.
[0087] Combined with the first aspect, in some optional implementation manners, fuse and output the first prediction result and the second prediction result to obtain the event extraction result, including:
[0088] Through [[ID=5�]] the activation function, respectively integrate the first span prediction score vector in the first prediction result and the second span prediction score vector in the second prediction result, and the first relationship prediction score vector in the first prediction result and the second relationship prediction score vector in the second prediction result, to obtain the event extraction result, which is expressed as follows:
[0089]
[0090]
[0091] Wherein, represents the word pair in the input data corresponding first span prediction score vector, represents the word pair corresponding second span prediction score vector, represents the word pair corresponding first relation prediction score vector, represents the word pair corresponding second relation prediction score vector, represents the comprehensive span prediction score vector, represents the comprehensive relation prediction score vector, and uses the comprehensive span prediction score vector and the comprehensive relation prediction score vector as the event extraction result.
[0092] In a second aspect, an embodiment of the present application further provides an electronic device, which includes a processor and a memory coupled to each other. The memory stores a computer program. When the computer program is executed by the processor, the electronic device executes the above method.
[0093] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the above method.
[0094] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program, and the computer program realizes the above method when executed by a processor.
[0095] The invention adopting the above technical solution has the following advantages:
[0096] In the technical solution provided by the present application, first, input data including the event to be extracted is obtained. Then, based on a preset feature encoding strategy, the input data is feature-encoded to obtain a trigger word embedding and a structure embedding. Then, a preset virtual event type embedding representing the event type feature is obtained, and the trigger word embedding, the structure embedding, and the preset virtual event type embedding are feature-fused to obtain a first feature vector. Then, based on the first feature vector, probability prediction is performed on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result. Then, based on the first feature vector, probability prediction is performed on the input data according to a preset bi-affine attention prediction strategy to obtain a second prediction result. Finally, the first prediction result and the second prediction result are fused and output to obtain the event extraction result. In this way, through the virtual event type embedding, the event extraction model can learn event types in different fields and constrain the trigger words, improving the generalization of the model and improving the problem that traditional event extraction methods cannot effectively identify and extract event trigger words and arguments in the text under the condition of no predefined event patterns. Brief Description of the Drawings
[0097] This application can be further illustrated by non-limiting embodiments shown in the drawings. It should be understood that the following drawings only show some embodiments of this application, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0098] Figure 1 It is a schematic structural diagram of an electronic device provided by an embodiment of this application.
[0099] Figure 2 It is a schematic flowchart of an event extraction method provided by an embodiment of this application.
[0100] Figure 3 It is a schematic structural diagram of an event extraction model provided by an embodiment of this application.
[0101] Icons: 100 - Electronic device; 101 - Processor; 102 - Memory. Detailed Embodiments
[0102] The following will describe this application in detail with reference to the drawings and specific embodiments. It should be noted that in the drawings or the description, similar or identical parts are denoted by the same reference numerals, and the implementation manners not shown or described in the drawings are forms known to those of ordinary skill in the art. In the description of this application, terms such as "first", "second", etc. are only used for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0103] Please refer to Figure 1 , an electronic device 100 provided by an embodiment of this application may include a processor 101 and a memory 102. A computer program is stored in the memory 102. When the computer program is executed by the processor 101, the electronic device 100 can perform corresponding steps in the following event extraction method.
[0104] In this embodiment, the processor 101 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 101 can be a general-purpose processor. For example, the processor 101 can be a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
[0105] The memory 102 can be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc. In this embodiment, the memory 102 can be used to store input data, a preset feature encoding strategy, trigger word embeddings, structure embeddings, preset virtual event type embeddings, a first feature vector, a preset convolutional network prediction strategy, a first prediction result, a preset bi-affine attention prediction strategy, a second prediction result, an event extraction result, etc. Of course, the memory 102 can also be used to store a program, and the processor 101 executes the program after receiving an execution instruction.
[0106] It can be understood that Figure 1 the structure of the electronic device 100 shown in Figure 1 is only a schematic structural diagram, and the electronic device 100 can also include more Figure 1 components than those shown.
[0107] In this embodiment, the electronic device 100 can be a personal computer, a laptop computer, a cloud server, etc., and is used to obtain input data containing events to be extracted. Then, based on a preset feature encoding strategy, the input data is feature-encoded to obtain trigger word embeddings and structure embeddings. Then, a preset virtual event type embedding representing the event type feature is obtained, and feature fusion is performed on the trigger word embeddings, structure embeddings, and preset virtual event type embeddings to obtain a first feature vector. Then, based on the first feature vector, probability prediction is performed on the input data based on a preset convolutional network prediction strategy to obtain a first prediction result. Then, based on the first feature vector, probability prediction is performed on the input data based on a preset bi-affine attention prediction strategy to obtain a second prediction result. Finally, the first prediction result and the second prediction result are fused and output to obtain an event extraction result.
[0108] Please refer to Figure 2 , this application also provides an event extraction method, which can be applied to the above-mentioned electronic device 100 and executed or implemented by the electronic device 100 for each step in the method. Among them, the event extraction method may include the following steps:
[0109] Step 110, obtain input data containing the event to be extracted;
[0110] Step 120, based on a preset feature encoding strategy, perform feature encoding on the input data to obtain a trigger word embedding representing the semantic features of the input data and a structure embedding representing the structural features of the input data;
[0111] Step 130, obtain a preset virtual event type embedding representing event type features;
[0112] Step 140, perform feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data;
[0113] Step 150, according to the first feature vector, perform probability prediction on the input data based on a preset convolutional network prediction strategy to obtain a first prediction result;
[0114] Step 160, according to the first feature vector, perform probability prediction on the input data based on a preset bi-affine attention prediction strategy to obtain a second prediction result;
[0115] Step 170, perform fusion output on the first prediction result and the second prediction result to obtain an event extraction result.
[0116] In the above embodiment, first, input data containing the event to be extracted is obtained. Then, based on a preset feature encoding strategy, the input data is feature-encoded to obtain a trigger word embedding and a structure embedding. Then, a preset virtual event type embedding representing event type features is obtained, and feature fusion is performed on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector. Then, according to the first feature vector, probability prediction is performed on the input data based on a preset convolutional network prediction strategy to obtain a first prediction result. Then, according to the first feature vector, probability prediction is performed on the input data based on a preset bi-affine attention prediction strategy to obtain a second prediction result. Finally, fusion output is performed on the first prediction result and the second prediction result to obtain an event extraction result. In this way, through the virtual event type embedding, the event extraction model can learn event types in different domains and constrain the trigger words, improving the generalization of the model and solving the problem that traditional event extraction methods cannot effectively identify and extract event trigger words and arguments in the text under the condition of no predefined event patterns.
[0117] The following will elaborate on each step of the event extraction method as follows:
[0118] In step 110, obtain the input data containing the event to be extracted, which may include:
[0119] Obtain the text data containing the event to be extracted;
[0120] Split the text data into token representations;
[0121] Perform vector transformation on the token representations to obtain the token embedding vectors corresponding to the token representations;
[0122] Through a preset AMR parsing strategy, convert the token representations into AMR graph representations to obtain trigger word node information;
[0123] Use the token embedding vectors and the trigger word node information as the input data.
[0124] In this embodiment, the acquisition of the text data can be pre-stored in the memory 102 of the above-mentioned electronic device 100 during the event extraction model development stage and called based on computer instructions during subsequent event extraction processes; alternatively, the acquisition of the text data can also be input into the model in real time by the user during the model application stage and directly participate in subsequent event extraction. The specific method for acquiring the text data is not limited here.
[0125] In this embodiment, after obtaining the text data, split the text data into token representations (which can also be simply referred to as tokens), and convert each token into a vector to obtain the token embedding vector corresponding to each token.
[0126] Exemplarily, if the text data is "Shenzhou telecom acquired 100% equity of Guangzhou Security", then the text data is split into eight token representations, namely Shenzhou, telecom, acquired, 100%, equity, of, Guangzhou, Security, and then the eight token representations are converted into vectors to obtain token embedding vectors.
[0127] In this embodiment, it is also possible to perform AMR (Abstract Meaning Representation) parsing on the tokens to obtain trigger word node information, and then jointly use the token embedding vectors and the trigger word node information as the above-mentioned input data. Among them, AMR parsing is a linguistic framework that represents the semantics of a sentence as a directed acyclic graph with concepts as nodes, which is a conventional technical means in the field of natural language processing technology and will not be elaborated here.
[0128] In step 120, based on a preset feature encoding strategy, feature encoding is performed on the input data to obtain a trigger word embedding representing the semantic features of the input data and a structure embedding representing the structural features of the input data, which may include:
[0129] Performing first feature encoding on the input data through a preset BERT pre-trained model to obtain the trigger word embedding;
[0130] Performing second feature encoding on the input data through a preset AGGCN pre-trained model to obtain the structure embedding.
[0131] In this embodiment, after determining the input data, a sentence containing N word token embedding vectors is sequentially input into a BERT (Bidirectional Encoder Representations from Transformer) pre-trained model and an AGGCN (Attention Guided Graph Convolutional Networks) pre-trained model in combination with its AMR parsing result (i.e., the input data), and the trigger word embedding and the structure embedding are obtained respectively.
[0132] In step 130, obtaining a preset virtual event type embedding as where represents the number of virtual event type embeddings in the preset virtual event type embedding.
[0133] In step 140, an abstract event type feature (i.e., virtual event type embedding) is obtained through an attention mechanism and P-Tuning technology, and the virtual event type embedding, trigger word embedding, and structure embedding are conditionally fused using a gate conditional normalization operation. Among them, the attention mechanism can help the event extraction model focus on the key information related to event trigger words and arguments in the text. And the P-Tuning technology can further improve the model's ability to obtain event type features.
[0134] Among them, the P-Tuning technology is a fine-tuning technology based on parameter pruning, aiming to improve the model's ability to capture the dependence relationship between event elements (i.e., event type features) through differentiable virtual event type embeddings and accelerate the model convergence speed.
[0135] In this embodiment, to solve the situation where there is no overlap in the predefined event pattern trigger words and to enable the model to obtain a richer event representation, the model needs to fuse the information of the event types and use it to constrain the trigger words. However, to improve the generalization of the model, the model cannot use specific event types to constrain the trigger words, but instead let the model learn the event type embeddings in different domains. This application is based on the P-Tuning technology and uses virtual event type embeddings. Referring to Figure 3 , to make the virtual event type embeddings continuously differentiable, an event type encoder is used to encode these virtual event type embeddings. When performing fine-tuning in different domains, the weights of the event type encoder and the virtual event type embeddings will be loaded instead of being randomly initialized. Doing so can not only accelerate the convergence speed of the model, but also, for event extraction in different domains, different weight parameters can be loaded to enable the model to adapt to the event types in different domains, improving the generalization and transferability of the model.
[0136] Specifically, in this embodiment, by performing feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding, a first feature vector corresponding to the input data is obtained;
[0137] Among them, performing feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data may include:
[0138] For the target trigger word embedding in the trigger word embedding , the attention score between the target trigger word embedding and the preset virtual event type embedding is determined by the following formula, where the target trigger word embedding represents the second feature vector corresponding to the trigger word with an overlapping situation in the trigger word embedding:
[0139]
[0140] In the formula, represents the inner product operation, represents the target trigger word embedding and the th attention score of the virtual event type embedding, , represents the total number of virtual event type embeddings in the preset virtual event type embedding;
[0141] Sort the multiple virtual event type embeddings in the preset virtual event type embedding based on the attention scores, and select the top m virtual event type embeddings with the largest attention scores as the target virtual event type embeddings. m is equal to the maximum value among the numbers in the target trigger word embedding (the target trigger word embedding refers to the trigger word vectors with overlaps in the trigger word embedding. Any overlapping trigger word vectors are regarded as a vector group, and m is the maximum number of trigger word vectors in the vector group, which can be 2, 3, 4, etc. In this embodiment, 2 is taken as an example);
[0142] Perform feature encoding on the target virtual event type embedding through a first preset multi-layer perceptron (MLP, Multilayer Perceptron) to obtain virtual event embedding features ;
[0143] Perform a first gated conditional normalization operation on the trigger word embedding and the virtual event embedding features to obtain a first fusion feature vector, which is expressed as follows:
[0144]
[0145]
[0146]
[0147] In the formula, and respectively represent the element-wise multiplication of vectors and the vector concatenation operation, , , , are learnable parameters, represents the feature vector in the structure embedding under the condition of the feature vector perform gated conditional normalization, represents the feature vector in the trigger word embedding, represents the corresponding virtual event embedding feature, represents the first gated unit, which is used to filter unnecessary feature information, and are the mean and standard deviation among the dimensions of the feature vector in the structure embedding, which are expressed as follows:
[0148]
[0149]
[0150] In the formula, represents the The -dimensional eigenvalue of a feature vector;
[0151] Perform a feature concatenation operation on the first fusion feature vector and the structure embedding to obtain a second fusion feature vector, which is used as the first feature vector and is expressed as follows:
[0152]
[0153]
[0154] In the formula, represents the word to the word the first fusion feature vector in between, represents the structure embedding, , and are learnable parameters, represents the sigmoid activation function.
[0155] In this way, the feature vector of each token fuses the event type feature information, the trigger word (word level) feature information, and the structure feature information.
[0156] Finally, referring to Figure 3 again, in the embodiment of the present application, the trigger word and argument extraction tasks are regarded as the span and relationship discrimination tasks between word pairs through the span-relationship joint prediction layer. On the one hand, a convolutional neural network is used to capture the local and global information between word pairs, obtain the dependency relationship between words, improve the richness of the word pair feature representation, and make a probability prediction for it; on the other hand, a span and relationship extractor is used to capture the head and tail feature information of the argument and the trigger word and the dependency relationship information between the two, and then a deep bi-affine transformation network is used to make a probability prediction for the word pair. Finally, the model combines the two probability prediction results, thereby improving the effectiveness of the model in identifying and extracting trigger words and arguments.
[0157] Specifically, the embodiment of the present application implements the extraction task of the above span-relationship joint prediction layer through steps 150 to 160. As follows:
[0158] In step 150, in order to predict the relationship between word pairs, it is important to generate a high-quality word pair grid representation. The word pair grid representation can be regarded as a 3D feature matrix denoted as , where represents the relationship feature representation of the word pair and can be considered as the feature vector of the word and the feature vector of the word Combination. Since the word pair is a partial order relation, that is The feature vector of and the feature vector of are different. Therefore, gated conditional normalization operation is used to represent the feature vector of is a feature combination performed on the condition of the feature vector . Specifically, The calculation process of
[0159] In step 150, based on the first feature vector, probability prediction is performed on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result, which may include:
[0160] Perform a second gated conditional normalization operation on the first feature vectors corresponding to any two token representations in the input data to obtain the word pair relationship feature between the any two token representations, which is expressed as follows:
[0161]
[0162]
[0163]
[0164]
[0165] In the formula, and respectively represent the first feature vectors corresponding to the token representations and , , , , and are learnable parameters, represents the second gated unit, and respectively represent the average value and standard deviation between the dimensions of the first feature vector corresponding to the token representation , which are expressed as follows:
[0166]
[0167]
[0168] In the formula, represents the -th dimensional eigenvalue of the first feature vector corresponding to the token representation
[0169] Obtain a preset first index matrix and a preset second index matrix;
[0170] Determine a word pair relative distance embedding and a word pair region embedding respectively through the preset first index matrix and the preset second index matrix;
[0171] After determining the relative distance embedding and the word pair region embedding between the token representations and the model fuses the two with the output of the gated conditional normalization operation and uses a multi-layer perceptron to reduce their dimensions, thereby obtaining a grid feature representation with relative position and region awareness. As follows:
[0172] Encode the concatenated features of the word pair relationship feature, the word pair relative distance embedding, and the word pair region embedding through a second preset multi-layer perceptron to obtain a grid feature representation, which is expressed as follows:
[0173]
[0174] In the formula, represents the grid feature representation, represents the span prediction or relationship prediction in probability prediction, represents the word pair relationship feature, represents the word pair relative distance embedding, represents the word pair region embedding, represents the second preset multi-layer perceptron;
[0175] In this embodiment, for span prediction and relationship prediction, the model uses different multiple two-dimensional convolutions (DConv) with different dilation rates to capture information between word pairs (which can be understood as two tokens) with different distances. Compared with the standard convolution kernel, convolution kernels with different dilation rates can capture multi-scale context information, so as to be competent in predicting the span and relationship of word pairs at different levels. Among them, when the dilation rate (i.e., the expansion rate) is 1, the dilated convolution can be regarded as an ordinary convolution.
[0176] Specifically, in this embodiment, a dilated convolution network is used to extract features from the grid feature representation to obtain a third fused feature vector, which is expressed as follows:
[0177]
[0178] In the formula, represents the third fused feature vector obtained by the dilated convolution network with a dilation rate of extracting features from the grid feature representation and represents the ReLU activation function, Denote the dilation rate as of the dilated convolution;
[0179] Among them, the number of layers and the dilation rate of the dilated convolution network can be flexibly set according to user needs. For example, in the embodiments of this application, a three-layer dilated convolution network is taken as an example. The dilation rates of the convolution kernels of the three-layer dilated convolution neural network are 1, 2, and 3 respectively, that is , then the output of the dilated convolution network can be expressed as .
[0180] After obtaining the fused feature vector corresponding to the span information of the word pair and the fused feature vector corresponding to the relationship information through two dilated convolution networks respectively, the model uses two multi-layer perceptrons to obtain the span prediction score vector and the relationship prediction score vector based on the dilated convolution network. As follows:
[0181] For any word pair representation in the input data, the span prediction feature vector and the relationship prediction feature vector in the third fused feature vector corresponding to the any word pair representation are encoded through the third preset multi-layer perceptron and the fourth preset multi-layer perceptron respectively to obtain the first span prediction score vector and the first relationship prediction score vector corresponding to the any word pair representation, as the first prediction result, which is expressed as follows:
[0182]
[0183]
[0184] In the formula, represents the first span prediction score vector of the word pair , represents the first relationship prediction score vector of the word pair , represents the span prediction feature vector in the third fused feature vector corresponding to the word pair , represents the relationship prediction feature vector in the third fused feature vector corresponding to the word pair , represents the third preset multi-layer perceptron, represents the fourth preset multi-layer perceptron.
[0185] It can be understood that referring to again Figure 3, in order to comprehensively capture the local information of all word pairs, this embodiment uses two convolutional neural network layers to separately predict the span information and relationship information of word pairs, and their network structures are the same. A convolutional neural network consists of three components, a gated conditional normalization layer, two word pair grid embeddings (i.e., relative distance embedding and region embedding), and a multi-scale dilated convolutional layer. Among them, only the gated conditional normalization layer is shared by span and relationship predictions. In this embodiment, a multi-scale dilated convolutional layer combines dilated convolutions with different dilation rates for superposition. By combining dilated convolutions with different dilation rates, although the network has a relatively small perception range, the density of information capture has been significantly improved. Therefore, the model of this application uses two convolutional neural networks with the same structure to extract features from the grid feature representation, and respectively obtains the first span prediction score vector and the first relationship prediction score vector.
[0186] In this embodiment, regarding the above-mentioned relative distance embedding and region embedding, after obtaining the relative distance position of the word pair, the model can use the value of the relative distance position as an index to obtain the word pair relative distance embedding. When performing span prediction and relationship prediction, their relative distance embeddings are the same, and the word pair relative distance embedding is uniformly denoted as , where represents span prediction or relationship prediction. The other word pair grid embedding is the word pair region embedding. For span prediction, the model aims to locate the prediction label in the upper triangular part of the word pair span matrix, while relationship prediction focuses on the region where the trigger word is located. To achieve the prediction task, the word pair region indices for both span and relationship need to obtain their respective region embeddings through matrix indexing. For span prediction, the values in the lower triangular region of the word pair region index matrix are set to 1, the upper triangular region is set to 2, and the region filled with [PAD] is set to 0; for relationship prediction, the word pair region index matrix considers the region where the trigger word and the corresponding argument are located based on the previous design, and its value is set to 3. Finally, the model obtains the word pair region embeddings required for span prediction and relationship prediction through these two index matrices. The size of the word pair region embedding for span prediction is 3, while the size of the word pair region embedding for relationship prediction is 4. For the sake of simplicity of description, the word pair region embedding is uniformly denoted as .
[0187] In step 160, referring to Figure 3 again, in order to enable the head token information and tail token information of the trigger word or argument to interact, the model uses a Deep Biaffine attention mechanism to form a span extractor and a relationship extractor.
[0188] Among them, according to the first feature vector, performing probability prediction on the input data based on a preset biaffine attention prediction strategy to obtain a second prediction result may include:
[0189] The first feature vector is encoded by a fifth preset multi-layer perceptron and a sixth preset multi-layer perceptron respectively to obtain the head feature representation and the tail feature representation of the token in the input data, which are used as the token feature representation, as shown below:
[0190]
[0191]
[0192] In the formula, and represent the head feature representation and the tail feature representation of the token respectively, represents the fifth preset multi-layer perceptron, represents the sixth preset multi-layer perceptron;
[0193] Since the traditional deep bilinear attention mechanism only uses the head feature representation and the tail feature representation of words, while ignoring the information inside each trigger word or argument, the following feature fusion is performed on the head feature representation and the tail feature representation of words.
[0194] The token feature representation is concatenated with the first feature vector, and the concatenated token feature representation is encoded by a seventh preset multi-layer perceptron and an eighth preset multi-layer perceptron respectively, so as to perform feature fusion on the first feature vector and the head feature representation, and the first feature vector and the tail feature representation respectively, to obtain a fourth fusion feature vector and a fifth fusion feature vector, as shown below:
[0195]
[0196]
[0197] In the formula, represents the seventh preset multi-layer perceptron, represents the eighth preset multi-layer perceptron, represents the vector concatenation operation, represents the fourth fusion feature vector obtained by encoding the concatenated first feature vector and the head feature representation through the seventh preset multi-layer perceptron, represents the fifth fusion feature vector obtained by encoding the concatenated first feature vector and the tail feature representation through the eighth preset multi-layer perceptron;
[0198] Then the model uses the following bilinear attention mechanism to predict a span prediction score vector for a trigger word or an argument.
[0199] According to the fourth fusion feature vector and the fifth fusion feature vector, through the first bi-affine attention prediction strategy, span prediction in probability prediction is performed on any word pair representation in the input data, and a second span prediction score vector corresponding to the any word pair representation is obtained, which is expressed as follows:
[0200]
[0201] In the formula, represents the second span prediction score vector of the word pair , and respectively represent the i-th feature vector in the fourth fusion feature vector and the j-th feature vector in the fifth fusion feature vector , , and are learnable parameters respectively, represents the vector concatenation operation;
[0202] In order to capture the relationship between the trigger word and the argument, a bilinear transformation operation is performed on the first feature vector to obtain a relationship feature matrix between the word tokens in the input data, which is expressed as follows:
[0203]
[0204] In the formula, represents the relationship feature matrix between the word tokens, represents the activation function, represents the first feature vector, represents the learnable bilinear transformation matrix;
[0205] In this embodiment, although represents the relationship feature matrix between the word tokens, there is no word boundary information for constraint. In order to effectively utilize the word boundary information, the model uses the following calculation method to fuse the head feature representation and the tail feature representation of the word into the feature representation of the word.
[0206] The concatenated features of the first feature vector, the fourth fusion feature vector and the fifth fusion feature vector are encoded through the ninth preset multi-layer perceptron to obtain a boundary constraint feature vector, which is expressed as follows:
[0207]
[0208] In the formula, s represents the boundary constraint feature vector, represents the ninth preset multi-layer perceptron;
[0209] Then, encode the relationship feature matrix through the tenth preset multi-layer perceptron to obtain a sixth fusion feature vector, which is expressed as follows:
[0210]
[0211] In the formula, represents the sixth fusion feature vector, represents the tenth preset multi-layer perceptron;
[0212] Then, through the second bi-affine attention prediction strategy, perform relationship prediction in the probability prediction of the representation of any word pair in the input data to obtain a second relationship prediction score vector corresponding to the representation of the word pair, which is expressed as follows:
[0213]
[0214] In the formula, represents the word pair 's second relationship prediction score vector, and respectively represent the i-th feature vector in the boundary constraint feature vector and the j-th feature vector in the sixth fusion feature vector , , and are learnable parameters respectively, represents the vector concatenation operation;
[0215] Take the second span prediction score vector and the second relationship prediction score vector as the second prediction result.
[0216] Finally, in step 170, the model integrates the span and relationship prediction score vectors based on the convolutional neural network with the span and relationship prediction score vectors based on the deep bi-affine attention mechanism, and then uses the Softmax activation function to obtain the final span and relationship prediction probability results of the word pair , that is, the event extraction result.
[0217] Specifically, in step 170, fusing and outputting the first prediction result and the second prediction result to obtain the event extraction result may include:
[0218] Through The activation function integrates the first span prediction score vector in the first prediction result and the second span prediction score vector in the second prediction result, as well as the first relationship prediction score vector in the first prediction result and the second relationship prediction score vector in the second prediction result respectively to obtain the event extraction result, which is expressed as follows:
[0219]
[0220]
[0221] In the formula, represents the first span prediction score vector corresponding to the word pair in the input data ; represents the second span prediction score vector corresponding to the word pair ; represents the first relationship prediction score vector corresponding to the word pair ; represents the second relationship prediction score vector corresponding to the word pair ; represents the comprehensive span prediction score vector represents the comprehensive relationship prediction score vector. The comprehensive span prediction score vector and the comprehensive relationship prediction score vector are used as the event extraction result.
[0222] For ease of understanding, please refer to Figure 3 again. The embodiment of the present application also provides an event extraction model as the implementation environment of the above event extraction method. The event extraction model includes an input layer, an encoding layer, an information fusion layer, a span-relationship joint prediction layer, and an output layer. Combining Figure 3 with the event extraction model shown, the overall implementation process of the above event extraction method is described again as follows:
[0223] ① The input layer receives text data and converts it into a token representation;
[0224] ② The encoding layer uses BERT and AGGCN to extract the trigger word embedding that represents the semantic features of the event in the text and the structural embedding that represents the structural features;
[0225] ③ The information fusion layer adopts an attention mechanism and P-Tuning technology to obtain the virtual event type embedding, and conditionally fuses the event type features (i.e., the virtual event type embedding), the event semantic features (trigger word embedding), and the event structural features (structural embedding) through a gated conditional layer normalization (GCLN) layer to obtain the first feature vector;
[0226] ④ The span-relation joint prediction layer regards the trigger word and argument extraction tasks as a span and relation discrimination task between word pairs. On the one hand, it uses a convolutional neural network to capture the local and global information between word pairs, obtain the dependency relationship between words and perform probability estimation to get the first prediction result (i.e., the first span prediction score vector and the first relation prediction score vector); on the other hand, it uses a span and relation extractor to capture the head and tail feature information of the argument and the trigger word and the dependency relationship information between them, and then uses a deep bi-affine transformation network to perform probability prediction on the word pair to get the second prediction result (i.e., the second span prediction score vector and the second relation prediction score vector).
[0227] ⑤ The output layer integrates the span and relation prediction score vectors based on the convolutional neural network and the span and relation prediction score vectors based on the deep bi-affine attention mechanism, and then uses the Softmax activation function to obtain the final span and relation prediction probability results of the word pair as the event extraction result.
[0228] It should be noted that those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-mentioned electronic device 100 can refer to the corresponding processes of each step in the foregoing event extraction method, and will not be elaborated here.
[0229] The embodiment of the present application also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, it causes the computer to execute the event extraction method described in the above embodiment.
[0230] The embodiment of the present application also provides a computer program product, including a computer program, and the computer program implements the above-mentioned event extraction method when executed by the processor 101.
[0231] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by hardware or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation scenarios of the present application.
[0232] In summary, the embodiments of the present application provide an event extraction method, an electronic device, a storage medium, and a program product. In this technical solution, first, input data including events to be extracted is obtained. Then, based on a preset feature encoding strategy, the input data is feature-encoded to obtain trigger word embeddings and structural embeddings. Then, a preset virtual event type embedding representing event type features is obtained, and the trigger word embeddings, structural embeddings, and the preset virtual event type embedding are feature-fused to obtain a first feature vector. Then, based on the first feature vector, probability prediction is performed on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result. Then, based on the first feature vector, probability prediction is performed on the input data according to a preset bi-affine attention prediction strategy to obtain a second prediction result. Finally, the first prediction result and the second prediction result are fused and output to obtain an event extraction result. In this way, through the virtual event type embedding, the event extraction model can learn event types in different fields and constrain the trigger words, improving the generalization of the model and solving the problem that traditional event extraction methods cannot effectively identify and extract event trigger words and arguments in the text under the condition of no predefined event patterns.
[0233] In the embodiments provided in the present application, it should be understood that the disclosed method can also be implemented in other ways. The method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of methods and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0234] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An event extraction method, characterized in that, The method includes: Obtaining input data containing the event to be extracted; Based on a preset feature encoding strategy, performing feature encoding on the input data to obtain a trigger word embedding representing the semantic features of the input data and a structure embedding representing the structural features of the input data; Obtaining a preset virtual event type embedding representing event type features; Performing feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data; Based on the first feature vector, performing probability prediction on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result; Based on the first feature vector, performing probability prediction on the input data according to a preset bi-affine attention prediction strategy to obtain a second prediction result; Performing fusion output on the first prediction result and the second prediction result to obtain an event extraction result.
2. The method according to claim 1, wherein Obtaining input data containing the event to be extracted includes: Obtaining text data containing the event to be extracted; Splitting the text data into token representations; Performing vector conversion on the token representations to obtain token embedding vectors corresponding to the token representations; Converting the token representations into an AMR graph representation through a preset AMR parsing strategy to obtain trigger word node information; Using the token embedding vectors and the trigger word node information as the input data.
3. The method according to claim 1, characterized in that, Based on a preset feature encoding strategy, performing feature encoding on the input data to obtain a trigger word embedding representing the semantic features of the input data and a structure embedding representing the structural features of the input data, including: Performing first feature encoding on the input data through a preset BERT pre-trained model to obtain the trigger word embedding; Performing second feature encoding on the input data through a preset AGGCN pre-trained model to obtain the structure embedding.
4. The method according to claim 1, characterized in that, Performing feature fusion on the trigger word embedding, the structure embedding, and the preset virtual event type embedding to obtain a first feature vector corresponding to the input data, including: For the target trigger word embedding in the trigger word embedding, determining the attention score between the target trigger word embedding and the preset virtual event type embedding through the following formula, where the target trigger word embedding represents the second feature vector corresponding to the trigger word with an overlapping situation in the trigger word embedding: ; In the formula, represents the inner product operation, represents the target trigger word embedding and the attention score of the th virtual event type embedding, , represents the total number of virtual event type embeddings in the preset virtual event type embedding; Sorting the multiple virtual event type embeddings in the preset virtual event type embedding based on the attention score, and selecting the top m virtual event type embeddings with the largest attention score as the target virtual event type embeddings, where m is equal to the maximum value of the number in the target trigger word embedding; Performing feature encoding on the target virtual event type embedding through a first preset multi-layer perceptron to obtain virtual event embedding features; Performing a first gated conditional normalization operation on the trigger word embedding and the virtual event embedding features to obtain a first fusion feature vector, expressed as follows: ; ; ; In the formula, and represent the element-wise multiplication of vectors and the vector concatenation operation respectively, , , , are learnable parameters, represents the feature vector in the structure embedding performs gated conditional normalization on the condition of the feature vector , represents the feature vector in the trigger word embedding, represents the corresponding virtual event embedding feature, represents the first gated unit, and are the feature vectors in the structure embedding The mean and standard deviation between each dimension are expressed as follows: ; ; In the formula, represents the -th eigenvalue of the -th eigenvector in the structure embedding; Performing a feature concatenation operation on the first fusion feature vector and the structure embedding to obtain a second fusion feature vector as the first feature vector, expressed as follows: ; In the formula, represents the first fusion feature vector between the word and the word , represents the structure embedding, , and are learnable parameters, represents the sigmoid activation function.
5. The method according to claim 1, characterized in that Based on the first feature vector, perform probability prediction on the input data according to a preset convolutional network prediction strategy to obtain a first prediction result, including: Perform a second gated conditional normalization operation on the first feature vectors corresponding to any two token representations in the input data to obtain the pair relationship features between the any two token representations, expressed as follows: ; ; ; ; In the formula, and respectively represent the first feature vectors corresponding to the token representations and ; , , , and are learnable parameters; represents the second gating unit; and respectively represent the first feature vectors corresponding to the token representations ; the mean and standard deviation among the dimensions in are expressed as follows: ; ; In the formula, represents the token representation corresponding first feature vector of the dimensional eigenvalue; Obtain a preset first index matrix and a preset second index matrix; Determine a pair relative distance embedding and a pair region embedding respectively through the preset first index matrix and the preset second index matrix; Encode the concatenated features of the pair relationship features, the pair relative distance embedding, and the pair region embedding through a second preset multi-layer perceptron to obtain a grid feature representation, expressed as follows: ; In the formula, represents the grid feature representation, represents the span prediction or relationship prediction in probability prediction, represents the word pair relationship feature, represents the word pair relative distance embedding, represents the word pair region embedding, represents the second preset multi-layer perceptron; Extract features from the grid feature representation through a dilated convolutional network to obtain a third fused feature vector, expressed as follows: ; In the formula, represents the third fusion feature vector obtained after the dilated convolutional network with a dilation rate of performs feature extraction on the grid feature representation , represents the ReLU activation function, represents a dilated convolution with a dilation rate of ; For any pair representation in the input data, respectively encode the span prediction feature vector and the relationship prediction feature vector in the third fused feature vector corresponding to the any pair representation through a third preset multi-layer perceptron and a fourth preset multi-layer perceptron to obtain a first span prediction score vector and a first relationship prediction score vector corresponding to the any pair representation, as the first prediction result, expressed as follows: ; ; In the formula, represents the first span prediction score vector of the word pair , represents the first relationship prediction score vector of the word pair , represents the span prediction feature vector in the third fusion feature vector corresponding to the word pair , represents the relationship prediction feature vector in the third fusion feature vector corresponding to the word pair , represents the third preset multi-layer perceptron, represents the fourth preset multi-layer perceptron.
6. The method according to claim 1, characterized in that Based on the first feature vector, perform probability prediction on the input data according to a preset bi-affine attention prediction strategy to obtain a second prediction result, including: Encode the first feature vector through a fifth preset multi-layer perceptron and a sixth preset multi-layer perceptron respectively to obtain a head feature representation and a tail feature representation of the tokens in the input data, as token feature representations, expressed as follows: ; ; In the formula, and respectively represent the head feature representation and the tail feature representation of the token, represents the fifth preset multi-layer perceptron, represents the sixth preset multi-layer perceptron; Concatenate the token feature representations with the first feature vector, and encode the concatenated token feature representations through a seventh preset multi-layer perceptron and an eighth preset multi-layer perceptron respectively to perform feature fusion between the first feature vector and the head feature representation, and between the first feature vector and the tail feature representation respectively, to obtain a fourth fused feature vector and a fifth fused feature vector, expressed as follows: ; ; In the formula, represents the seventh preset multi-layer perceptron, represents the eighth preset multi-layer perceptron, represents the vector concatenation operation, represents the fourth fused feature vector obtained by encoding the concatenated first feature vector and the head feature representation through the seventh preset multi-layer perceptron, represents the fifth fused feature vector obtained by encoding the concatenated first feature vector and the tail feature representation through the eighth preset multi-layer perceptron; According to the fourth fused feature vector and the fifth fused feature vector, perform span prediction in the probability prediction of any pair representation in the input data through a first bi-affine attention prediction strategy to obtain a second span prediction score vector corresponding to the any pair representation, expressed as follows: ; In the formula, represents the second-span prediction score vector of the word pair , and respectively represent the i-th feature vector in the fourth fusion feature vector and the j-th feature vector in the fifth fusion feature vector .[[ID=((13))]] [[ID=((14))]],[[ID=((15))]] [[ID=((16))]]and[[ID=((17))]] [[ID=((18))]]are learnable parameters respectively,[[ID=((19))]] [[ID=((20))]]represents the vector concatenation operation; Perform a bilinear transformation operation on the first feature vector to obtain a relationship feature matrix between the tokens in the input data, expressed as follows: ; In the formula, represents the relationship feature matrix between tokens, represents the activation function, represents the learnable bilinear transformation matrix; Encode the concatenated features of the first feature vector, the fourth fused feature vector, and the fifth fused feature vector through a ninth preset multi-layer perceptron to obtain a boundary constraint feature vector, expressed as follows: ; In the formula, represents the boundary constraint eigenvector, represents the ninth preset multi-layer perceptron; Encode the relationship feature matrix through a tenth preset multi-layer perceptron to obtain a sixth fused feature vector, expressed as follows: ; In the formula, represents the sixth fusion feature vector, represents the tenth preset multi-layer perceptron; Performing relationship prediction in the probability prediction of any word pair representation in the input data through a second double affine attention prediction strategy, obtaining a second relationship prediction score vector corresponding to the any word pair representation, which is expressed as follows: ; In the formula, represents the second relationship prediction score vector of the word pair , and represent the i-th feature vector and the sixth fusion feature vector in the boundary constraint feature vector respectively, where the j-th feature vector in , and are learnable parameters respectively, represents the vector concatenation operation; Taking the second span prediction score vector and the second relationship prediction score vector as the second prediction result.
7. The method according to claim 1, wherein Performing fusion output on the first prediction result and the second prediction result to obtain an event extraction result, including: Through The activation function integrates the first span prediction score vector in the first prediction result, the second span prediction score vector in the second prediction result, the first relation prediction score vector in the first prediction result, and the second relation prediction score vector in the second prediction result respectively to obtain the event extraction result, which is expressed as follows: ; ; Wherein, represents the word pair in the input data and the corresponding first span prediction score vector, represents the word pair and the corresponding second span prediction score vector, represents the word pair and the corresponding first relationship prediction score vector, represents the word pair and the corresponding second relationship prediction score vector, represents the comprehensive span prediction score vector, represents the comprehensive relationship prediction score vector, and the comprehensive span prediction score vector and the comprehensive relationship prediction score vector are used as the event extraction result.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory coupled to each other, and a computer program is stored in the memory. When the computer program is executed by the processor, the electronic device executes the method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer executes the method according to any one of claims 1-7.
10. A computer program product, characterized in that, Including a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Script event prediction method based on action scene enhancement
CN113919319A
Feature and attention mechanism fusion-based event joint extraction system
CN114298053A
Event extraction method, system and equipment for legal decision document and medium
CN117371485A
Triple extraction method based on double-gating mechanism and dependence-oriented attention network
CN117787253A
Software function point identification method and system based on named entity identification model
CN118819474A