Electronic text event extraction method, device, equipment and storage medium

The context-integrated multi-task joint electronic text event extraction network solves the problem of being unable to obtain deep semantic connections between entity tasks and other tasks in the joint model, and improves the accuracy and overall effect of event extraction.

CN113886601BActive Publication Date: 2024-08-27WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111161308.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-08-27
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

Most joint models at this stage extract entity type information as known information, resulting in the inability to obtain the inherent deep semantic connection between the entity task and the other two tasks, affecting the accuracy of event extraction.

Method used

A context-integrated multi-task joint electronic text event extraction network is adopted, including an input module, a context representation module, a multi-task interaction module and an output module. The interaction between tasks is enhanced through shared feature representation and context representation to generate multi-task joint electronic text events. Extraction model for identifying entities, trigger words, and argument role relationships.

Benefits of technology

By introducing context-related information, the interaction between multiple subtasks is enhanced, the accuracy of event extraction is improved, the model's ability to identify easily confused events and roles is improved, and the overall effect of event extraction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886601B
    Figure CN113886601B
Patent Text Reader

Abstract

The present application discloses an electronic text event extraction method, device, equipment and storage medium, comprising: preprocessing an original data set, and dividing the preprocessed original data set into a training set, a verification set and a test set; training a context-integrated multi-task joint electronic text event extraction network according to the training set and the verification set to generate a multi-task joint electronic text event extraction model; predicting the test set according to the multi-task joint electronic text event extraction model, extracting the test results of each word in the test set, introducing context-related text information, using the text representation related to the extracted sentence in the context as an auxiliary representation, helping the model to distinguish easily confused events and roles, and allowing the context representation to serve as a feature bridge between multiple tasks to help tasks interact and improve the accuracy of extraction, and enhancing the interaction between multiple subtasks through the context representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an electronic text event extraction method, device, computer equipment and computer-readable storage medium. Background Art

[0002] With the continuous development of science and technology and the popularization of the Internet, the Internet has become an indispensable tool in people's lives and work. Countless information is presented to us in an explosive manner and is flooded in our current lives without any effective filtering. Efficiently obtaining effective information has encountered unprecedented challenges. Event extraction (EE) is of great practical significance because it can quickly and accurately mine information from a large amount of unstructured text and extract the information required by users. The event extraction task can be divided into three subtasks, including entity recognition task, trigger word recognition task and argument role prediction task.

[0003] Initial event extraction tasks usually use a pipeline model based on feature engineering technology. This model is less complex and simple to implement, but has significant flaws. First, feature engineering technology requires domain experts to manually design key features and rules, and will rely on external natural language processing tools; second, the pipeline model will have cascading errors, that is, the errors of upstream subtasks will be passed to downstream subtasks.

[0004] In the related research on event extraction tasks, due to the easy implementation of pipeline models and low model complexity, most of the early work used pipeline models to implement them. The specific approach is to first implement the two subtasks mentioned above, namely the entity recognition task and the trigger word task, extract the entities and the trigger words, then concatenate the entity results and the trigger word results, and finally perform the argument role prediction task. Although this approach is simple and easy to understand, it ignores the interaction between tasks during the implementation process. When the next task obtains the result of the previous task, there will be a problem of error propagation. In addition, the results of the subsequent tasks have no effect on the previous predictions, making it impossible for the results of the subsequent tasks to correct the previous tasks.

[0005] In order to solve the defects of pipeline models, people began to use joint models for event extraction. By using joint models to share representations, the problem of independence between tasks is solved, the interaction between different tasks is strengthened, and representation error correction can be performed between different tasks. At present, most joint models extract entity type information as known information. In the joint extraction process, only the trigger word extraction task and the argument role prediction task are combined, making it impossible for the model to obtain the inherent deep semantic connection between the entity task and the other two tasks. Summary of the invention

[0006] The main purpose of this application is to provide an electronic text event extraction method, apparatus, computer equipment and computer-readable storage medium, aiming to solve the technical problem that most of the current joint models extract entity type information as known information, and only combine the trigger word extraction task and the argument role prediction task in the joint extraction process, making it impossible for the model to obtain the inherent deep semantic connection between the entity task and the other two tasks.

[0007] In a first aspect, the present application provides a method for extracting electronic text events, the method comprising the following steps:

[0008] Preprocessing an original data set, and dividing the preprocessed original data set into a training set, a validation set, and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words, and relationships between entities and trigger words that appear in sentences in the text;

[0009] Training a context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module;

[0010] The test set is predicted according to the multi-task joint electronic text event extraction model, and test results of each word in the test set are extracted, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words.

[0011] Preferably, the context-integrated multi-task joint electronic text event extraction network includes:

[0012] Input module, context representation module, multi-task interaction module and output module;

[0013] The input module is used to obtain a shared feature representation, which is used to convert each word into a corresponding vector representation, and use the vector representation corresponding to each word as an upstream shared word vector layer of multiple subtasks;

[0014] The output module is used to obtain a loss function according to the entity recognition task, the event sentence task, the trigger word task and the argument role classification task, and perform joint training based on the preset weights of different tasks. Preferably, the context representation module includes a private sequence information feature representation and a context representation;

[0015] The private sequence information feature representation is used to model the sequence information of each sentence;

[0016] The context representation is used to encode the sequence of preceding and following sentences of the currently extracted sentence.

[0017] Preferably, the multi-task interaction module includes an entity recognition task, an event sentence task, a trigger word task and an argument role classification task;

[0018] The entity recognition task is used to identify each entity boundary and entity type in a sentence;

[0019] The event sentence task is used to determine whether each sentence contains an event, so that the information at the sentence level assists the trigger word task at the word level;

[0020] The trigger word task is used to identify each trigger word in each sentence and the time type represented by the trigger word;

[0021] The argument role classification task is used to predict the relationship between the identified entity and the trigger word.

[0022] Preferably, the training of the context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model includes:

[0023] Randomly inputting the samples in the training set and the validation set into a multi-task joint electronic text event extraction network in batches;

[0024] Obtain loss functions corresponding to the entity recognition task, event sentence task, trigger word task, and argument role classification task respectively;

[0025] Using a stochastic gradient descent method, the multi-task joint electronic text event extraction network gradually learns the optimal parameter values ​​in the loss functions corresponding to the entity recognition task, the event sentence task, the trigger word task, and the argument role classification task, and simultaneously calculates the evaluation index on the validation set;

[0026] If the evaluation index on the verification set no longer increases or the network training stops after a certain number of iterations, the context-integrated joint event extraction model with the best performance on the verification set is saved as the task-joint electronic text event extraction model.

[0027] Preferably, predicting the test set according to the multi-task joint electronic text event extraction model and extracting the test results of each word in the test set includes:

[0028] Inputting each short sentence to be tested in the test set into the multi-task joint electronic text event extraction model, and predicting each short sentence to be tested by the multi-task joint electronic text event extraction model;

[0029] The multi-task joint electronic text event extraction model is extracted to output the entity type of each word in each of the short sentences to be tested, the trigger word type, and the argument role relationship between any two subwords.

[0030] Preferably, the preprocessing of the original data set and dividing the preprocessed original data set into a training set, a validation set and a test set includes:

[0031] Determine the text in the original data set, and segment the text into sentences and words based on a natural language processing tool to obtain part-of-speech information of each word, wherein the text includes a news text, and the news text is at least one;

[0032] Marking the words based on the part-of-speech information of each word, and determining a label for each word, wherein the label includes an initial entity label, a trigger word label, and an argument role relationship label between the entity and the trigger word;

[0033] The labeled words are combined into labeled short sentences, and the labeled short sentences are divided into a training set, a verification set and a test set according to a preset ratio.

[0034] In a second aspect, the present application further provides an electronic text event extraction device, the device comprising:

[0035] A partitioning module is used to preprocess the original data set and divide the preprocessed original data set into a training set, a validation set and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words and relationships between entities and trigger words appearing in sentences in the text;

[0036] A generation module is used to train a multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module;

[0037] An extraction module is used to predict the test set according to the multi-task joint electronic text event extraction model, and extract the test results of each word in the test set, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words.

[0038] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the electronic text event extraction method as described above are implemented.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the electronic text event extraction method as described above are implemented.

[0040] The present application provides an electronic text event extraction method, device, computer equipment and computer-readable storage medium, which preprocesses an original data set and divides the preprocessed original data set into a training set, a verification set and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words and the relationship between entities and trigger words that appear in sentences in the text; a context-integrated multi-task joint electronic text event extraction network is trained according to the training set and the verification set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: input An input module, a context representation module, a multi-task interaction module and an output module; predicting the test set according to the multi-task joint electronic text event extraction model, extracting the test results of each word in the test set, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words, so as to introduce context-related text information, use the text representation related to the extracted sentence in the context as an auxiliary representation, help the model distinguish easily confused events and roles, and let the context representation serve as a feature bridge between multiple tasks to help tasks interact and improve the accuracy of extraction, and enhance the interaction between multiple subtasks through context representation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 A flowchart of an electronic text event extraction method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a network framework provided for an embodiment of the present application;

[0044] Figure 3 A schematic block diagram of an electronic text event extraction device provided in an embodiment of the present application;

[0045] Figure 4 The present invention is a block diagram showing the structure of a computer device according to an embodiment of the present application.

[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0049] The embodiment of the present application provides an electronic text event extraction method, device, computer equipment and computer readable storage medium. The electronic text event extraction method can be applied to a computer equipment, which can be an electronic device such as a laptop computer, a desktop computer, etc.

[0050] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0051] Please refer to Figure 1 , Figure 1 A flowchart of an electronic text event extraction method provided in an embodiment of the present application.

[0052] like Figure 1 As shown, the method includes steps S101 to S103.

[0053] Step S101 , preprocessing the original data set, and dividing the preprocessed original data set into a training set, a validation set and a test set.

[0054] For example, this application selects the English corpus in the commonly used ACE2005 data set in the field as the original data set, which contains a predefined event system structure. In the ACE2005 system, the event extraction task includes three subtasks: entity recognition task, trigger word recognition task and argument role prediction task. The entity is the specific thing in the sentence, the trigger word is the verb or noun that best reflects the current event, and the argument role relationship is the relationship between the entity and the trigger word. For the original news text, it is first necessary to segment it into sentences and words, and then match it with the annotations one by one, and process it into the symbolic representation required by the model.

[0055] For an original news sentence, the Stanford CoreNLP natural language processing tool is used to segment it and obtain the part of speech of each word. Then, the initial entity label, trigger word label and argument role relationship label of each word in the sentence are obtained. After preprocessing, according to the general training, validation and test division method, for the ACE2005 English dataset containing a total of six news texts {bc, bn, cts, nw, un, wl}, 40 news articles are randomly selected from nw as the test set D test , randomly select 30 news articles as the validation set D dev , the remaining news texts are all used as training set D train For example, a news text with m sentences can be represented as: D = {W1, W2, W3, ... W m}, where W = {W1, W2, W3, ... W N} means each sentence contains n words.

[0056] Step S102: training a context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module.

[0057] For example, some sample sentences are randomly selected as input each time. Figure 2 As shown, for example, using financial news D train A sentence W in , explains the implementation process of the entire network.

[0058] Shared feature representation: This application uses the BERT model proposed by Google to encode the sentence sequence in Google News and finally obtains the shared BERT sentence feature representation: H B =H B1 ,H B2 ,H B3,......,H Bn After obtaining the sentence feature representation, the part-of-speech feature of the current word is also used. Assuming there are M types of part-of-speech tagging results, a dimension of M*d is randomly initialized pos For the i-th part-of-speech tagging result (1≤i≤M), the i-th row of the matrix is ​​selected to obtain a vector matrix with a dimension of 1*d pos The vector representation of the part-of-speech tagging is represented by X. p =X p1 ,X p2 ,......,X pn , whose size is n*d pos , where d pos The dimension of the part-of-speech tag vector is set.

[0059] Finally, the vector representation matrices obtained from the two are concatenated in the column direction to obtain a preliminary matrix vector representation of the sentence sequence. Its dimension is N*(d w +d pos ). The matrix X is the shared feature layer of the entire model, which can be used and updated by any subtask.

[0060] Context representation module: For private feature sequence representation, this application chooses to use a bidirectional gated recurrent unit (Bi-GRU) to capture the specific sequence information of each sentence. Specifically, the word vector matrix X is fed into the bidirectional GRU network to obtain the forward representation: And the backward representation: Then the forward representation and the backward representation are concatenated to obtain the feature representation of the sequence information: Its dimension is N*(2d gru ), where d gru is the number of hidden units of the set bidirectional GRU.

[0061] This application considers the differences in training trends between subtasks and trains a set of bidirectional GRUs for the entity recognition task and the trigger word recognition task, that is, for the same input vector matrix Finally, we can get h emd With h ed In order to add the context information of surrounding words, this application also chooses to use the word vectors of the C words before and after the current word as context information. The surrounding context vector of the current word can be expressed as: [X i-c ,......,X i ,......,X i+c ], whose size is 1*(2c*d w ). Finally, we can get the context vector sequence: X c =X c1 ,Xc2 ,......,X cn , whose size is n*(2c*d w ).

[0062] After obtaining the context vector sequence, the sequence vector representation matrix h obtained by the bidirectional GRU network is combined with the context vector representation matrix X c By splicing in the column direction, we get and As input for subsequent subtasks.

[0063] Context representation: For context representation, the input sentence is encoded by BERT and represented as S = S1, S2, ..., S8. For one of the sentences S t The bidirectional gated recurrent unit encoding is also used, and the final representation is H c =H1,H2,......,H8.

[0064] Multi-task interaction module: The entity recognition task and context interaction part, this application uses the "BIO" annotation method in sequence annotation to jointly annotate the boundaries and types of entities. Specifically, "B" or "Begin" represents the beginning of an entity type label, "I" or "Inside" represents the non-beginning part of an entity type label, and "O" or "Outside" represents a non-entity label. Specifically, if there are p entity types in the entire training set, then the label set using the BIO annotation method will be: L EMD ={B-l1,I-l1,B-l2,I-l2,......,Bl p ,Il p ,0}, whose size is 2*p+1, where the “O” label represents that the current word does not belong to any entity type.

[0065] In the entity recognition task, the input vector matrix X is used EMD , and context sentence representation, and obtain context feature representation through attention

[0066] For sentences with shorter text length, contextual representation can provide auxiliary information to help the model extract. For sentences that already have sufficient information, the introduction of contextual representation will only add noise, which will reduce the model effect. This paper adds a gating mechanism to allow the model to learn the contextual representation and the weight of the current extracted sentence representation. When the contextual representation promotes the extraction of event elements for the current extracted sentence, the weight of the contextual representation will increase. When the contextual representation does not promote the extraction of event elements for the current extracted sentence, it will introduce noise and the weight of the contextual representation will be smaller. Where W eE is a randomly initialized parameter matrix, is the bias parameter.

[0067] The context representation is fused with the current extracted sentence representation through the gating unit to obtain the sentence fusion representation: Finally, the fusion representation Through a feedforward neural network, FF is used in the entity recognition task. EMD , and get the marked result: E=e1,e2,e3,......,e n , where e i (1≤i≤n) is the label set L EMD The elements in .

[0068] Two-class event sentence recognition task and context interaction part: In order to capture sentence-level information that is easier to learn and let the trainer focus more on event sentences, this application proposes to add a two-class event sentence recognition task, whose label set is L two ={with event, without event}. In this application, if a sentence contains a trigger word, its binary classification label is set as "with event".

[0069] In order to obtain a sentence-level vector representation, this application uses the attention mechanism to obtain a vector representation that is more suitable for the purpose of the new event sentence recognition task. Specifically, it is first passed through a hidden layer to compress the vector dimension to d ff , and then the model performs an affine transformation on it to obtain deeper semantic information: u t =W w X ED +b w , where X ED is of size N*d ff The matrix, W w W w is of size d ff *d attention The randomly initialized matrix finally has a size of N*d attention The matrix u t . Then a layer of softmax is used to obtain the normalized weight representation: Add the vectors of each word by weight to obtain the vector representation at the sentence level: Its size is 1*2*d gru .

[0070] After obtaining the sentence-level vector representation, we use a method similar to the entity recognition task to pay attention to the context representation and fuse the obtained representation with the sentence representation to finally obtain Finally, it is sent to a softmax layer to determine whether it contains an event and obtain the classification result T sentence .

[0071] For the trigger word recognition task, this application still uses the sequence labeling method. If there are S types of events, then the label set of the trigger word recognition task is: L ED ={l1,l2,......,l s ,0}, whose size is s+1, where the “O” label represents that the current word is not a trigger word of any event type.

[0072] Specifically, this application will input the sequence vector matrix: X ED =x ed1 ,x ed2 ,......,x edn , according to the method similar to the previous entity recognition task, we get The binary sentence prediction results obtained previously are concatenated with it and then sent to the feedforward neural network FF ED In the example, the size of the hidden layer is set to d ff , the output layer is a softmax layer, whose dimension is the label set L ED The size of the labeling result is: T = t1, t2, t3, ..., t n ,Through the softmax layer, we can get the probability that each word belongs to each event type label, and finally select the one with the highest probability as its label.

[0073] For the argument role prediction task, in the event extraction model that combines the three subtasks, since it is assumed that the entity extraction result is unknown, it is necessary to perform a relationship prediction for every two words in the sentence. In this application, in order to obtain a more intuitive display, the entity vector representation and the trigger word vector representation are constructed into a matrix R with a size of n*n, and by default each row represents a trigger word and each column represents an entity. So each element r in the matrix ij (1≤i≤n,1≤j≤n) means the role relationship label between the trigger word represented by the corresponding row i and the entity represented by the corresponding column j. In order to reduce the complexity of the argument role prediction task, this application sets that for each entity in the sentence, only the first word of the entity, that is, the word with a label of type BX, is used. This is feasible because in the first subtask entity recognition task, the boundaries of the predicted entity can be obtained. In particular, during the training process, in order to obtain better recognition effects, real entity labels are used.

[0074] In the argument role prediction task, if there are 0 argument role types, then the label set is: L RP={l1,l2,......,l0,0}, its size is 0+1, and the label "O" means that there is no role relationship between the current entity and the current trigger word.

[0075] Specifically, for the input sequence X EMD With X ED First, they are input into a hidden layer for linear transformation, and the vector dimension in the column direction is compressed to d ff Then, in order to utilize the information of the first two tasks and allow the context representation to interact with it, for the matrix element r ij Then concatenate the predicted entity type label e i and the predicted trigger word label t j , and the context representations corresponding to the two private feature sequence representations. Therefore, the matrix element r ij The vector can be expressed as: The onehot() function converts a real number into a one-hot vector.

[0076] Then, it is passed through a feedforward neural network FF ARP In the example, the size of the hidden layer is set to d ff , the output layer is a softmax layer, whose dimension is the label set L ARP The size of the label is obtained ij Through the softmax layer, we can get the probability that each pair of entities and trigger words belongs to each argument role type label, and finally use the argmax function to select the one with the highest probability as its label.

[0077] This application uses the Adam algorithm to propagate the gradient back and calculate the updated parameter values. After each round of training, the performance indicators of the model on the validation set Ddev are examined: Precision, Recall, and Macro Average F1 value. Finally, the model with the best performance on the validation set is saved as the final context-integrated multi-task joint event extraction model.

[0078] Step S103: predicting the test set according to the multi-task joint electronic text event extraction model, and extracting the test results of the test set.

[0079] For example, load the model that performs best on the validation set, input the test set Dtest, and obtain the event extraction results of the test set. For example, for the input sentence "The collision destroyed three nearby houses and killed at least two people.", the event types output by the model include "destruction" and "death". In the destruction event, the destruction forms a victim relationship with the house and the person, while in the death event, only the person plays the role of the victim.

[0080] In an embodiment of the present application, context-related text information is introduced, and the text representation related to the extracted sentence in the context is used as an auxiliary representation to help the model distinguish easily confused events and roles. At the same time, the context representation is used as a feature bridge between multiple tasks to help interact between tasks and improve the accuracy of extraction. In addition, through the context representation, the interaction between multiple subtasks is enhanced, which greatly improves the effect of the joint event extraction task.

[0081] Please refer to Figure 3 , Figure 3 A schematic block diagram of an electronic text event extraction device provided in an embodiment of the present application.

[0082] like Figure 3 As shown, the device 400 includes: a division module 401, a generation module 402, and an extraction module 403.

[0083] A division module 401 is used to preprocess the original data set and divide the preprocessed original data set into a training set, a validation set and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words and relationships between entities and trigger words appearing in sentences in the text;

[0084] A generation module 402 is used to train a multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module;

[0085] The extraction module 403 is used to predict the test set according to the multi-task joint electronic text event extraction model, and extract the test results of each word in the test set, wherein the test results include the entity type of each word, the trigger word type, and the argument role relationship between each two words.

[0086] The generating module 402 is further used for:

[0087] Input module, context representation module, multi-task interaction module and output module;

[0088] The input module is used to obtain a shared feature representation, which is used to convert each word into a corresponding vector representation, and use the vector representation corresponding to each word as an upstream shared word vector layer of multiple subtasks;

[0089] The output module is used to obtain a loss function according to an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task, and to perform joint training based on preset weights of different tasks.

[0090] The generating module 402 is further used for:

[0091] The private sequence information feature representation is used to model the sequence information of each sentence;

[0092] The context representation is used to encode the sequence of preceding and following sentences of the currently extracted sentence.

[0093] The generating module 402 is further used for:

[0094] The entity recognition task is used to identify each entity boundary and entity type in a sentence;

[0095] The event sentence task is used to determine whether each sentence contains an event, so that the information at the sentence level assists the trigger word task at the word level;

[0096] The trigger word task is used to identify each trigger word in each sentence and the time type represented by the trigger word;

[0097] The argument role classification task is used to predict the relationship between the identified entity and the trigger word.

[0098] The generating module 402 is further used for:

[0099] Randomly inputting the samples in the training set and the validation set into a multi-task joint electronic text event extraction network in batches;

[0100] Obtain loss functions corresponding to the entity recognition task, event sentence task, trigger word task, and argument role classification task respectively;

[0101] Using a stochastic gradient descent method, the multi-task joint electronic text event extraction network gradually learns the optimal parameter values ​​in the loss functions corresponding to the entity recognition task, the event sentence task, the trigger word task, and the argument role classification task, and simultaneously calculates the evaluation index on the validation set;

[0102] If the evaluation index on the verification set no longer increases or the network training stops after a certain number of iterations, the context-integrated joint event extraction model with the best performance on the verification set is saved as the task-joint electronic text event extraction model.

[0103] The extraction module 403 is further used for:

[0104] Inputting each short sentence to be tested in the test set into the multi-task joint electronic text event extraction model, and predicting each short sentence to be tested by the multi-task joint electronic text event extraction model;

[0105] The multi-task joint electronic text event extraction model is extracted to output the entity type of each word in each of the short sentences to be tested, the trigger word type, and the argument role relationship between any two subwords.

[0106] The division module 401 is further used for:

[0107] Determine the text in the original data set, and segment the text into sentences and words based on a natural language processing tool to obtain part-of-speech information of each word, wherein the text includes a news text, and the news text is at least one;

[0108] Marking the words based on the part-of-speech information of each word, and determining a label for each word, wherein the label includes an initial entity label, a trigger word label, and an argument role relationship label between the entity and the trigger word;

[0109] The labeled words are combined into labeled short sentences, and the labeled short sentences are divided into a training set, a verification set and a test set according to a preset ratio.

[0110] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described device and each module and unit can refer to the corresponding process in the aforementioned electronic text event extraction embodiment, and will not be repeated here.

[0111] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Figure 4 Runs on the computer device shown.

[0112] See also Figure 4 , Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a terminal.

[0113] like Figure 4 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0114] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any electronic text event extraction method.

[0115] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0116] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any electronic text event extraction method.

[0117] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0119] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0120] Preprocessing an original data set, and dividing the preprocessed original data set into a training set, a validation set, and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words, and relationships between entities and trigger words that appear in sentences in the text;

[0121] Training a context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module;

[0122] The test set is predicted according to the multi-task joint electronic text event extraction model, and test results of each word in the test set are extracted, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words.

[0123] In one embodiment, when the processor is implemented, it is used to implement:

[0124] The context-integrated multi-task joint electronic text event extraction network includes:

[0125] Input module, context representation module, multi-task interaction module and output module;

[0126] The input module is used to obtain a shared feature representation, which is used to convert each word into a corresponding vector representation, and use the vector representation corresponding to each word as an upstream shared word vector layer of multiple subtasks;

[0127] The output module is used to obtain a loss function according to an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task, and to perform joint training based on preset weights of different tasks.

[0128] In one embodiment, when the processor is implemented, it is used to implement:

[0129] The context representation module includes a private sequence information feature representation and a context representation;

[0130] The private sequence information feature representation is used to model the sequence information of each sentence;

[0131] The context representation is used to encode the sequence of preceding and following sentences of the currently extracted sentence.

[0132] In one embodiment, when the processor is implemented, it is used to implement:

[0133] The multi-task interaction module includes an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task;

[0134] The entity recognition task is used to identify each entity boundary and entity type in a sentence;

[0135] The event sentence task is used to determine whether each sentence contains an event, so that the information at the sentence level assists the trigger word task at the word level;

[0136] The trigger word task is used to identify each trigger word in each sentence and the time type represented by the trigger word;

[0137] The argument role classification task is used to predict the relationship between the identified entity and the trigger word.

[0138] In one embodiment, the processor implements training the context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, and is used to implement:

[0139] Randomly inputting the samples in the training set and the validation set into a multi-task joint electronic text event extraction network in batches;

[0140] Obtain loss functions corresponding to the entity recognition task, event sentence task, trigger word task, and argument role classification task respectively;

[0141] Using a stochastic gradient descent method, the multi-task joint electronic text event extraction network gradually learns the optimal parameter values ​​in the loss functions corresponding to the entity recognition task, the event sentence task, the trigger word task, and the argument role classification task, and simultaneously calculates the evaluation index on the validation set;

[0142] If the evaluation index on the verification set no longer increases or the network training stops after a certain number of iterations, the context-integrated joint event extraction model with the best performance on the verification set is saved as the task-joint electronic text event extraction model.

[0143] In one embodiment, the processor predicts the test set according to the multi-task joint electronic text event extraction model, and extracts the test results of each word in the test set, and is used to implement:

[0144] Inputting each short sentence to be tested in the test set into the multi-task joint electronic text event extraction model, and predicting each short sentence to be tested by the multi-task joint electronic text event extraction model;

[0145] The multi-task joint electronic text event extraction model is extracted to output the entity type of each word in each of the short sentences to be tested, the trigger word type, and the argument role relationship between any two subwords.

[0146] In one embodiment, when the processor implements preprocessing of the original data set and divides the preprocessed original data set into a training set, a validation set, and a test set, it is used to implement:

[0147] Determine the text in the original data set, and segment the text into sentences and words based on a natural language processing tool to obtain part-of-speech information of each word, wherein the text includes a news text, and the news text is at least one;

[0148] Marking the words based on the part-of-speech information of each word, and determining a label for each word, wherein the label includes an initial entity label, a trigger word label, and an argument role relationship label between the entity and the trigger word;

[0149] The labeled words are combined into labeled short sentences, and the labeled short sentences are divided into a training set, a verification set and a test set according to a preset ratio.

[0150] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of electronic text event extraction in the present application.

[0151] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0152] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0153] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for extracting events from electronic text, characterized in that: include: Preprocessing an original data set, and dividing the preprocessed original data set into a training set, a validation set, and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words, and relationships between entities and trigger words that appear in sentences in the text; Training a context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module; The input module is used to obtain a shared feature representation, which is used to convert each word into a corresponding vector representation, and use the vector representation corresponding to each word as an upstream shared word vector layer of multiple subtasks; The output module is used to obtain a loss function according to an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task, and perform joint training based on preset weights of different tasks; The context representation module includes a private sequence information feature representation and a context representation; The private sequence information feature representation is used to model the sequence information of each sentence; The context representation is used to encode the sequence of sentences before and after the currently extracted sentence; The multi-task interaction module includes an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task; The entity recognition task is used to identify each entity boundary and entity type in a sentence; The event sentence task is used to determine whether each sentence contains an event, so that the information at the sentence level assists the trigger word task at the word level; The trigger word task is used to identify each trigger word in each sentence and the time type represented by the trigger word; The argument role classification task is used to predict the relationship between the identified entity and the trigger word; The test set is predicted according to the multi-task joint electronic text event extraction model, and test results of each word in the test set are extracted, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words.

2. The electronic text event extraction method according to claim 1, characterized in that: The step of training the context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model includes: Randomly inputting the samples in the training set and the validation set into a multi-task joint electronic text event extraction network in batches; Obtain loss functions corresponding to the entity recognition task, event sentence task, trigger word task, and argument role classification task respectively; Using a stochastic gradient descent method, the multi-task joint electronic text event extraction network gradually learns the optimal parameter values ​​in the loss functions corresponding to the entity recognition task, the event sentence task, the trigger word task, and the argument role classification task, and simultaneously calculates the evaluation index on the validation set; If the evaluation index on the verification set no longer increases or the network training stops after a certain number of iterations, the context-integrated joint event extraction model with the best performance on the verification set is saved as the task-joint electronic text event extraction model.

3. The electronic text event extraction method according to claim 1, characterized in that: The step of predicting the test set according to the multi-task joint electronic text event extraction model and extracting the test results of each word in the test set includes: Inputting each short sentence to be tested in the test set into the multi-task joint electronic text event extraction model, and predicting each short sentence to be tested by the multi-task joint electronic text event extraction model; The multi-task joint electronic text event extraction model is extracted to output the entity type of each word in each of the short sentences to be tested, the trigger word type, and the argument role relationship between any two subwords.

4. The electronic text event extraction method according to claim 1, characterized in that: The preprocessing of the original data set and dividing the preprocessed original data set into a training set, a validation set and a test set includes: Determine the text in the original data set, and segment the text into sentences and words based on a natural language processing tool to obtain part-of-speech information of each word, wherein the text includes a news text, and the news text is at least one; Marking the words based on the part-of-speech information of each word, and determining a label for each word, wherein the label includes an initial entity label, a trigger word label, and an argument role relationship label between the entity and the trigger word; The labeled words are combined into labeled short sentences, and the labeled short sentences are divided into a training set, a verification set and a test set according to a preset ratio.

5. An electronic text event extraction device, characterized in that: include: A partitioning module is used to preprocess the original data set and divide the preprocessed original data set into a training set, a validation set and a test set, wherein the original data set includes text and annotation results corresponding to the text, and the annotation results at least include labels for entities, trigger words and relationships between entities and trigger words appearing in sentences in the text; A generation module is used to train a context-integrated multi-task joint electronic text event extraction network according to the training set and the validation set to generate a multi-task joint electronic text event extraction model, wherein the context-integrated multi-task joint electronic text event extraction network includes: an input module, a context representation module, a multi-task interaction module and an output module; The input module is used to obtain a shared feature representation, which is used to convert each word into a corresponding vector representation, and use the vector representation corresponding to each word as an upstream shared word vector layer of multiple subtasks; The output module is used to obtain a loss function according to an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task, and perform joint training based on preset weights of different tasks; The context representation module includes a private sequence information feature representation and a context representation; The private sequence information feature representation is used to model the sequence information of each sentence; The context representation is used to encode the sequence of sentences before and after the currently extracted sentence; The multi-task interaction module includes an entity recognition task, an event sentence task, a trigger word task, and an argument role classification task; The entity recognition task is used to identify each entity boundary and entity type in a sentence; The event sentence task is used to determine whether each sentence contains an event, so that the information at the sentence level assists the trigger word task at the word level; The trigger word task is used to identify each trigger word in each sentence and the time type represented by the trigger word; The argument role classification task is used to predict the relationship between the identified entity and the trigger word; An extraction module is used to predict the test set according to the multi-task joint electronic text event extraction model, and extract the test results of each word in the test set, wherein the test results include the entity type of each word, the trigger word type and the argument role relationship between every two words.

6. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the electronic text event extraction method as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the electronic text event extraction method according to any one of claims 1 to 4 are implemented.