A pipelined multi-event extraction method

By employing a pipeline-based multi-event extraction method, and utilizing event feature datasets and T5 model training, trigger words and event elements are gradually identified. This solves the problems of identification omissions and matching in the extraction of multiple events and overlapping events, thereby improving the extraction accuracy.

CN116304017BActive Publication Date: 2025-12-16BEIJING ZHONGKE ZHIJIA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211735183.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-12-16
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing event extraction methods are prone to problems such as missing identification and mismatch of event elements in multi-event and overlapping multi-event extraction tasks, resulting in low extraction accuracy.

Method used

A pipeline-based multi-event extraction method is adopted. By constructing an event feature data set and a training dataset, and training the model with a T5 model, events are extracted in a progressive manner using prompt information. Trigger words and event elements are identified step by step, and a separate extraction path is provided to improve accuracy.

Benefits of technology

It greatly improves the accuracy of extracting multiple events and overlapping events, effectively identifies the inherent relationships between event types, event roles and event elements, and achieves high-recognition-rate event extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304017B_ABST
    Figure CN116304017B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of pipeline type multi-event extraction method, belong to natural language processing technical field, solve the existing event extraction method in the corpus There are more events or multi-event overlap conditions prone to identification missing, event elements cannot match, leading to low accuracy problem. By using prompt information (prompt) in a step-by-step manner to extract events, all event types are used as prompt information to extract corresponding trigger words, and then trigger words and the elements to be extracted are sequentially added to the prompt to extract event elements. After all event elements contained in the event type are extracted, the prompt information of the last step is combined with the extraction result to obtain a complete event. This pipeline extraction method provides a separate extraction path for each possible event, focusing on solving the problem of multi-event, overlapping multi-event extraction, recognition missing, event elements cannot match, greatly improving the extraction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and particularly relates to a pipeline multi-event extraction method. BACKGROUND

[0002] Event extraction (EE) is one of the important tasks in the field of natural language processing (NLP), and the purpose of event extraction is to identify the event type, event trigger, event element and element role contained in the given corpus. At present, the application scenarios of event extraction technology are very wide, which can efficiently extract useful information in a large amount of text and provide strong data support for the construction of a knowledge graph.

[0003] The existing mainstream event extraction methods include sequence labeling method, pointer classification method and generative method. The sequence labeling method is essentially a multi-label multi-classification method, which predicts the possible labels for each token; the pointer classification method extracts events by predicting the start and end positions of the text corresponding to each label; the generative method is an end-to-end method, which extracts context information through a deeper network and directly outputs event information in text format. The above three methods have good performance in single event or non-overlapping multi-event corpus containing a small number of events, but when there are more events in the corpus, especially when one or more elements overlap, it is very easy to have recognition omissions, recognition errors and event element matching problems, resulting in very low accuracy. Since overlapping multi-events are common in actual corpus, there is an urgent need for a more optimized multi-event extraction method to solve the problem of low extraction accuracy caused by recognition omissions and event element matching in the existing event extraction method in multi-event and overlapping multi-event extraction tasks. SUMMARY

[0004] In view of the above analysis, the embodiments of the present application aim to provide a training method of a pipeline multi-event extraction model to solve the problem of low extraction accuracy caused by recognition omissions and event element matching in the existing event extraction method in multi-event and overlapping multi-event extraction tasks.

[0005] In one aspect, the embodiments of the present application provide a pipeline multi-event extraction method, comprising the following steps:

[0006] obtaining a text to be extracted text;

[0007] constructing a first-step prediction sample set D based on the text to be extracted text and an event feature data set step_1 , D step_1Input model M trained , to obtain a first-step prediction result; wherein the model M trained is trained based on a model training data set D +1 including an event type positive sample data set D +2 , an event element positive sample data set D -1 , an event type full negative sample data set D -2 and an event element random negative sample data set D all constructed from an original data set;

[0008] Based on the text to be extracted, the event feature data set and the prediction result of the previous step model M trained , a prompt information prompt is constructed, and a prediction sample set of the next step model is constructed in the text+prompt structure, realizing the construction of the 2~n+1 step prediction sample set D step_2 ~D step_(n+1) in turn; D step_2 ~D step_(n+1) are input into the model M trained in turn to obtain the prediction result of the 2~n+1 step model M train ; n is the number of event roles of the event type corresponding to the first-step prediction result;

[0009] Based on the n+1 step prediction sample set D step_(n+1) and the prediction result of the n+1 step model M train , the final extraction result is integrated.

[0010] Further, the model M trained is trained by the following steps:

[0011] Obtain the labeled text data as the original data set;

[0012] Based on the original data set, obtain the event feature data set, and further construct the event type positive sample data set D +1 , the event element positive sample data set D +2 , the event type full negative sample data set D -1 and the event element random negative sample data set D -2 , and finally obtain the model training data set D all ;

[0013] Use the training data set D all to train the T5 model, to obtain the trained model M trained ;

[0014] Further, the event feature data set includes:

[0015] event type and all event role correspondence schema, event type and single event role correspondence set S type_role , all event type set S type , all trigger word set S trigger and all event element set S argument ; wherein the schema records all event types in the original data set and their respective all event roles; S type_role According to the schema, the two-way combination of the event type of each event in the schema and all event roles, and the event role belongs to the first event role in the schema are obtained; S type Records all event types; S trigger Records all trigger words appearing in the original data set; S argument Records all event elements contained in the original data set.

[0016] Further, the model training data set D all , is constructed by the following steps:

[0017] The annotation information of the original data set is summarized and arranged to obtain the event type and all event role correspondence schema, the event type and single event role correspondence set S type_role and all event type set S type Three event feature data sets;

[0018] Use the original data set and the data set schema to construct the event type positive sample data set D +1 and the event element positive sample data set D +2 , all trigger words appearing in the original data set set S trigger and all event element set S argument Two event feature data sets;

[0019] Use the event type positive sample data set D +1 and the event type data set S type Construct the event type full negative sample data set D -1 ;

[0020] Use the event element positive sample data set D +2 , trigger word set S trigger , event element set S argument and event type and single event role correspondence set S type_role Build event element random negative sample data set D -2 ;

[0021] D +1 , D +2 , D-1 , D -2 Mix up, finally get the model training data set D all .

[0022] Further, the event type positive sample data set D +1 and the event element positive sample data set D +2 , are obtained by the following steps:

[0023] (1) Extract the event type e type , trigger word w trigger , event role e role_1 ~e role_n , corresponding event element w arg_1 ~w arg_n (n is the number of event roles contained in the event, also equal to the number of event elements) corresponding to an event in the original data set text_p; the input of the event type positive sample of the event is text_p+e type +“trigger word”, and the output is w trigger ; the input of the event element positive sample of the event is text_p+prompt arg , and the output is w arg_1 ~w arg_n ; wherein the event element prompt prompt arg can be obtained as follows:

[0024]

[0025] (2) Use the method in (1) to construct event type positive samples and event element positive samples for each event in the text data text_p, to obtain the event type positive sample data set D +1 and the event element positive sample data set D +2 ;

[0026] Further, the event type full negative sample data set D -1 is obtained by the following steps:

[0027] (1) Replace the e type of a certain event type positive sample with other event types of the event in the event type data set S type in turn, and the target output is empty, to obtain the event type full negative sample of the event;

[0028] (2) Use the method in (1) for all events in the event type positive sample data set D +1 to construct the event type full negative sample data set D -1 .

[0029] Further, the event element random negative sample data set D -2 is constructed by the following steps:

[0030] (1) Find all event element positive samples of an event in D +2 , find all event element prompts prompt from the event element positive samples arg , and form a set S prompt ;

[0031] (2) Randomly select a trigger word from S trigger to obtain w trigger_random ; randomly select an element from S type_role to obtain an event type e type_random , an event role e role_random and the position p of the event role;

[0032] (3) Randomly select p event elements from the event element set S argument to obtain w arg_r_1 ~ w arg_r_p , and combine them in the following format to obtain the event element random prompt prompt arg_random ;

[0033] prompt arg_random = e type_random + w trigger_random + w arg_r_1 + … + w arg_r_p + e role_random

[0034] (4) Determine whether prompt arg_random exists in S prompt , if it exists, repeat steps 2, 3 and 4, if it does not exist, use prompt arg_random to construct a negative sample, and add prompt arg_random to S prompt ;

[0035] (5) Repeat steps (1) to (4) until 5n event element random negative samples are obtained.

[0036] (6) Use the method in (1) to (5) to construct an event element random negative sample data set D +2 for all event samples in D -2 .

[0037] Further, the method for training the T5 model comprises the following steps:

[0038] Divide the model training data set D all into a training set D trainValidation set D eval and test set D test ;

[0039] Using training set D train The T5 model is fine-tuned and trained N times, with the validation set D used at the end of each training round. eval Validate the model, select the best model from the validation set as the final model, and use the test set D. test The training model M was eventually obtained through testing. trained ;

[0040] During training, the model loss is calculated and parameters are updated using the following formula:

[0041] Loss = CrossEntropy(x pred ,x gold )

[0042] Where, x pred For the prediction result, x gold Output the target.

[0043] 11. Furthermore, the first step of predicting the sample set D step_1 The prediction results from the first step and the prediction sample set D from the second to the (n+1)th steps. step_2 ~D step_(n+1) and the model M in steps 2 to n+1 train The prediction results are obtained through the following steps:

[0044] (1) Iterate through the S in the event feature data set sequentially. type All event types e type For any event type To predict the sample set D in the first step step1 Add samples to: "Trigger word"; after the traversal is complete, D step1 The number of samples in the sample is m, where m is the number of event types, and k∈[1,m];

[0045] (2) The first step prediction sample set D step1 Enter M trained When a sample has an output, the output is the event type in the text to be extracted. Trigger words Recorded as Search the schema in the event feature data set. Corresponding first event role In the format text+prompt _2 Add the output to the next prediction sample set D. step2 ;in

[0046] (3) D step2 Enter M trained Predict each trigger word Corresponding first event role The event elements are denoted as Determine the event type by checking the schema. Are there other event actors? If not, proceed with the integration and identification results step.

[0047] If this event type Other event roles exist in the schema. Then for this event type Other event roles Construct the next prediction sample set D step by step. step_3 ~D step_(n+1) and D step_3 ~D step_(n+1) Enter the model M step by step. trained Perform event elements The extraction, until All event elements corresponding to the event roles included are included in model M trained The steps involve extracting and integrating the identification results.

[0048] Furthermore, the next step is to predict the sample set D. step_3 ~D step_(n+1) It is constructed through the following steps:

[0049] In the format text+prompt _X Construct samples to be added to the next prediction sample set D step_(x) ;in For prompt _(x-1) Based on Replace with And add at the end Where x∈[3,n+1], and n is the number of event roles included in this event type in the schema;

[0050] The event elements used in the prompt message include The method for determining it is as follows:

[0051]

[0052] Where j∈[1,n-1], and n is the number of event roles included in this event type in the schema; if The result contains multiple prediction results, and these results need to be separated and used to construct prediction samples according to the format in this step.

[0053] Compared with the prior art, the present application can achieve at least one of the following beneficial effects:

[0054] 1. By using prompt information to extract events in a step-by-step manner, all event types are extracted as trigger words, and then the trigger words and the element roles to be extracted are added to the prompt extraction event elements in steps, after all event elements of the event type are extracted, the last step of the prompt information and the extraction result are combined to obtain the complete event; this pipeline extraction method provides a separate extraction path for each possible event, and focuses on solving the problems of missing recognition and event element matching in multi-event and overlapping multi-event extraction, greatly improving the extraction accuracy;

[0055] 2. By constructing an event feature data set, and further constructing a training set containing positive and negative samples of event types and event elements, the T5 model is trained using the training set, so that the model effectively learns the internal relationship between each event type, event role, event element and trigger word, and an event extraction model with high recognition rate for event text is obtained.

[0056] In the present application, the above technical solutions can be combined with each other to achieve more preferred combination schemes. Other features and advantages of the present application will be described in the subsequent specification, and some advantages will become apparent from the specification or by implementing the present application. The purpose and other advantages of the present application can be achieved and obtained from the specific embodiments described in the specification and the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0057] The accompanying drawings are included to provide a further understanding of the present application and are incorporated herein and constitute a part of the specification. The drawings illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application. In the drawings:

[0058] Figure 1 The schematic diagram of the overall flow of the pipeline multi-event extraction method of the embodiment of the present application is shown in the figure.

[0059] Figure 2 The schematic diagram of the overall implementation flow of the embodiment of the present application containing the model training process is shown in the figure.

[0060] Figure 3 The schematic diagram of the training data construction process provided by the embodiment of the present application is shown in the figure.

[0061] Figure 4 The schematic diagram of the process of obtaining the prediction result provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0062] Preferred embodiments of the present application will be described in detail below with reference to the drawings, wherein the drawings constitute a part of this application, and are used to explain principles of the present application, and are not intended to limit the scope of the present application.

[0063] One specific embodiment of the present application discloses a pipeline multi-event extraction method, as shown in the following steps: Figure 1

[0064] Step S110, obtaining a text to be extracted; wherein the text to be extracted can be news text data crawled from a website;

[0065] Step S120, constructing a first-step prediction sample set D step_1 based on the text to be extracted and an event feature data set; step_1 inputting the D trained into a model M trained to obtain a first-step prediction result; wherein the model M +1 is trained based on a model training data set T5 including an event type positive sample data set D +2 , an event element positive sample data set D -1 , an event type all-negative sample data set D -2 and an event element random negative sample data set D

[0066] Step S130, constructing a prompt information prompt based on the text to be extracted, the event feature data set and the prediction result of the model M trained of the previous step, and constructing a prediction sample set of a next-step model in a text+prompt structure to realize step-by-step construction of second to n+1-step prediction sample sets D step_2 to D step_(n+1) ; inputting the D step_2 to D step_(n+1) into the model M trained respectively to obtain prediction results of second to n+1-step models M train ; n is the number of event roles of the event type corresponding to the first-step prediction result;

[0067] Step S140, integrating a final extraction result based on the n+1-step prediction sample set D step_(n+1) and the prediction result of the n+1-step model M train .

[0068] ​The embodiment of the present application uses prompt information to extract events in a step-by-step manner. For a given corpus, first, all event types are used as prompt information to extract corresponding trigger words, then trigger words and element roles to be extracted are added to the prompt to extract event elements, and finally, the last step of the prompt information and the extraction result are combined to obtain complete events. Since this pipeline extraction method provides a separate extraction path for each possible event, it focuses on solving the problems of missing recognition and event element matching in multi-event and overlapping multi-event extraction, greatly improving the extraction accuracy.

[0069] On the basis of the above embodiment, specifically, in the step S120, the model M trained The model is trained by the following steps:

[0070] In step S210, labeled text data is obtained as an original data set;

[0071] More specifically, the labeled text data is obtained by the following method:

[0072] Obtain the original text data, which can be directly used as the event extraction data set of Baidu;

[0073] Annotate the original text data by yourself, wherein the annotation method is: determine the event type contained in the sentence of the text data; extract the trigger word, event element and its position according to the event type; and label the event element with appropriate event role;

[0074] In step S220, event feature data sets are obtained based on the original data set, and further, event type positive sample data set D +1 , event element positive sample data set D +2 , event type full negative sample data set D -1 and event element random negative sample data set D -2 , and finally obtain the model training data set D all ;

[0075] Further, the model training data set D all includes:

[0076] (A) The annotation information of the original data set is summarized and arranged to obtain the corresponding relationship set schema of the event type and all event roles, the corresponding set S type_role of the event type and a single event role, and the set S type of all event types;

[0077] Specifically, all event types and event roles in the original data set are summarized and arranged to construct a data set schema S type_role and S type ; wherein the schema records all event types in the original data set and all event roles corresponding to each event type respectively; S type_role According to the schema, the two-way combination of the event type of each event in the schema and all event roles, and the event role belongs to the first event role in the schema are obtained; S type Records all event types; preferably, the schema is stored in a file json, S type_role and S type Both use set to store.

[0078] Exemplarily, for an event type of "acquisition", the event roles include "acquisition time, acquirer, and acquired party", and the records in the schema, S type_role and S type are shown in Table 1.

[0079] Table 1 Records of events of type "acquisition" in the schema, S type_role and S type

[0080]

[0081] (B) Using the original data set and the data set schema to construct an event type positive sample data set D +1 and an event element positive sample data set D +2 , a set of all trigger words S trigger and a set of all event elements S argument occurring in the original data set, and two kinds of event feature data sets;

[0082] Specifically, the construction of the event type positive sample data set D +1 and the event element positive sample data set D +2 , and the set of all trigger words S trigger and the set of all event elements S argument occurring in the original data set includes:

[0083] (a) Extracting the event type e type , trigger word w trigger , event role e role_1 ~e role_n , and corresponding event element w arg_1 ~w arg_n ​(n is the number of event roles contained in the event, which is also equal to the number of event elements); the input for constructing the event type positive sample of the event is text_p+e type + "trigger word", the output is w trigger ; the input for constructing the event element positive sample of the event is text_p+prompt arg , the output is w arg_1 ~w arg_n ; wherein the event element prompt prompt arg can be obtained by the following formula:

[0084]

[0085] (b) using the method in (a) to construct the event type positive sample and the event element positive sample for each event in the text data text_p, obtaining the event type positive sample data set D +1 and the event element

[0086] positive sample data set D +2 ;

[0087] (c) saving the trigger word w trigger of all events in the text data text_p in the trigger word set S trigger , saving all event elements w arg_1 ~w arg_n in the event element set S argument , obtaining the trigger word data set S trigger and the event element data set S argument .

[0088] Exemplarily, for an event of type "acquisition", the constructed event type positive sample and event element positive sample and the saving example in S trigger and S argument are shown in Table 2.

[0089] Table 2 Event type positive sample and event element positive sample of an event of type "acquisition"

[0090] and the saving example in S trigger and S argument

[0091]

[0092]

[0093] It should be noted that in this example, the elements of the prompt information are separated by "-", and other symbols or spaces can also be used for separation. When constructing the event element positive sample, the event elements are in prompt arg ​The order of appearance in the schema record must be kept consistent.

[0094] For complex case events, the output can be multiple event elements, and when constructing the input, event element prompts need to be constructed respectively. For example, Table 3 shows a positive sample example of event elements of a multi-event with a shared trigger word:

[0095] Table 3 Positive sample example of event elements of a multi-event with a shared trigger word

[0096]

[0097] (C) Using event type positive sample dataset D +1 and event type dataset S type Constructing event type full negative sample dataset D -1 ;

[0098] Specifically, the construction of event type full negative sample dataset D -1 includes:

[0099] (a) Replace the e type of a certain event type positive sample with other event types of the event in event type dataset S type in turn, and the target output is empty, obtaining the event type full negative sample of the event;

[0100] (b) Use the method of (a) for all events in event type positive sample dataset D +1 to construct event type full negative sample dataset D -1 .

[0101] For example, there are m event types in event type dataset S type , so there are m-1 event type full negative samples for each event;

[0102] For model training, positive samples are samples with target output results, and negative samples are samples without output results. Adding negative samples during training can effectively improve the model recognition accuracy.

[0103] (D) Using event element positive sample dataset D +2 , trigger word set S trigger , event element set S argument , and event type and single event role correspondence set S type_role Constructing event element random negative sample dataset D -2 ;

[0104] The input format of the event element random negative sample is consistent with the event element positive sample, and the difference is that the prompt information of the event element random negative sample is different, and the output result is empty. For a certain event, the number of event element random negative samples is generally recommended to be 5 times the number of event element positive samples;

[0105] Specifically, the step of constructing the event element random negative sample data set D -2 is as follows:

[0106] (a) Find all event element positive samples of a certain event in D +2 , find all event element prompts prompt arg from the event element positive samples, and form a set S prompt ;

[0107] (b) Randomly select a trigger word from S trigger to obtain w trigger_random ; randomly select an element from S type_role to obtain an event type e type_random , an event role e role_random and the position p of the event role;

[0108] (c) Randomly select p event elements from the event element set S argument to obtain w arg_r_1 ~ w arg_r_p , and combine them according to the following format to obtain the event element random prompt prompt arg_random ;

[0109] prompt arg_random =e type_random +w trigger_random +w arg_r_1 +…+w arg_r_p +e role_random

[0110] (d) Determine whether prompt arg_random exists in S prompt , if it exists, repeat steps 2, 3 and 4, if it does not exist, use prompt arg_random to construct a negative sample, and add prompt arg_random to S prompt ;

[0111] (e) Repeat steps (a) to (d) until 5n event element random negative samples are obtained.

[0112] (f) Use the method in (a) to (e) to construct the event element random negative sample data set D +2 for all event samples in D -2 ;

[0113] (E) D +1 D +2 D -1 D -2 After mixing and shuffling, the final model training dataset D is obtained. all ;

[0114] Step S230: Use the training dataset D all The T5 model is trained to obtain the trained model M. trained ;

[0115] Specifically, the training of the T5 model includes:

[0116] The model training dataset D all The training set D is obtained by dividing the data according to a certain proportion. train Validation set D eval and test set D test Preferably, the ratio is 8:1:1; using training set D train The T5 model is fine-tuned and trained N times, with the validation set D used at the end of each training round. eval Validate the model, select the best model from the validation set as the final model, and use the test set D. test The training model M was eventually obtained through testing. trained Preferably, the number of training rounds N is 20.

[0117] Furthermore, during training, the model loss is calculated and the parameters are updated using the following formula:

[0118] Loss = CrossEntropy(x pred ,x g o ld )

[0119] Where, x pred For the prediction result, x gold For annotation.

[0120] Specifically, the above steps S120 to S130 can be further optimized into the following steps:

[0121] Step S310: Iterate through S sequentially type All event types e type For any event type To predict the sample set D in the first step step1 Add samples to: "Trigger word"; after the traversal is complete, D step1 The number of samples in the sample is m (m is the number of event types, k∈[1,m]);

[0122] Step S320: The sample set D predicted in the first step...step1 Enter M trained When a sample has an output, the output is the event type in the text to be extracted. Trigger words , recorded as Search from schema Corresponding first event role In the format text+prompt _2 Add the output to the next prediction sample set D. step2 ;in

[0123]

[0124] For samples with no output, this indicates that there is no input event type in the text. The trigger word, i.e., the text does not contain an event type of . The incident.

[0125] Step S330, D step2 Enter M trained Predict each trigger word Corresponding first event role The event elements are denoted as Determine the event type by checking the schema. Are there any other event roles? If not, proceed to step S140.

[0126] If this event type Other event roles exist in the schema. Then for this event type Other event roles Construct the next prediction sample set D step by step. step_3 ~D step_(n+1) and D step_3 ~D step_(n+1) Enter the model M step by step. trained Perform event elements The extraction, until All event elements corresponding to the event roles included are included in model M trained Extract and proceed to step S160;

[0127] Specifically, construct the next prediction sample set D. step_3 ~D step_(n+1) The method is as follows:

[0128] In the format text+prompt _x Construct samples to be added to the next prediction sample set D step_(x) ;in To prompt _(x-1) On the basis of Replace And finally add Wherein x∈[3,n+1], n is the number of event roles contained in the event type in the schema;

[0129] The event elements used in the prompt information prompt include The determination method is as follows:

[0130]

[0131] Wherein j∈[1,n-1], n is the number of event roles contained in the event type in the schema; if If multiple prediction results are contained in the prediction result, multiple results need to be separated according to the format in this step to construct the prediction sample.

[0132] Specifically, the final recognition result obtained by integrating in the above step S140 includes:

[0133] According to D step_n+1 And the n-th event element of the prediction result, the event extraction result is obtained as follows:

[0134] Event type:

[0135] Trigger word:

[0136] Event role / event element (role / argument):

[0137]

[0138] Exemplarily, the event extraction result can be integrated using the format of table 4.

[0139] Table 4 event extraction result integration example

[0140]

[0141] In summary, the beneficial effects of the embodiment are as follows:

[0142] Compared with the prior art, the present application can at least achieve one of the following beneficial effects:

[0143] 1. By using prompt information to extract events in a step-by-step manner, all event types are used as trigger words to extract corresponding prompt information, and then the trigger words and the element roles to be extracted are added to the prompt extraction event elements in steps, after all event elements of the event type are extracted, the last step of the prompt information and the extraction result are combined to obtain the complete event; this pipeline extraction method provides a separate extraction path for each possible event, focuses on solving the problem of missing recognition and event element matching in multi-event and overlapping multi-event extraction, and greatly improves the extraction accuracy;

[0144] 2. By constructing an event feature data set and further constructing a training set containing positive and negative samples of event types and event elements, the T5 model is trained using the training set, so that the model effectively learns the internal relationship between each event type, event role, event element and trigger word, and an event extraction model with high recognition rate for event text is obtained.

[0145] Those skilled in the art can understand that all or part of the processes of the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium. Among them, the computer readable storage medium is a disk, an optical disk, a read-only memory or a random access memory, etc.

[0146] The above is only a preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A pipelined multi-event extraction method, characterized by, The method comprises the following steps: Obtain a text to be extracted; Based on the text to be extracted, the event feature data set is used to construct the first step prediction sample set D step_1 , D step_1 is obtained trained , and the first step prediction result is obtained; wherein the model M trained is trained based on the model training data set D all including the event type positive sample data set D +1 , the event element positive sample data set D +2 , the event type full negative sample data set D -1 and the event element random negative sample data set D -2 constructed by the original data set, and T5 model is obtained Based on the text to be extracted, the event feature data set and the prediction result of the previous step model M trained , a prompt information prompt is constructed, and a prediction sample set of the next step model is constructed in the text+prompt structure, and the 2~n+1 step prediction sample set D is constructed step by step step_2 ~D step_(n+1) ; D step_2 ~D step_(n+1) is input into the model M trained step by step to obtain the prediction result of the 2~n+1 step model M train ; n is the number of event roles of the event type corresponding to the first step prediction result. based on the prediction sample set D of the (n+1)th step step_(n+1) and the model M of the (n+1)th step trained The final extraction result is obtained by integrating the prediction results. wherein the model M trained is trained by the following steps: Obtain labeled text data as an original data set; Obtaining an event feature data set based on the original data set, and further constructing an event type positive sample data set D +1 , an event element positive sample data set D +2 , an event type full negative sample data set D -1 , and an event element random negative sample data set D -2 , and finally obtaining a model training data set D all ; The model training data set D all is divided into a training set D train , a verification set D eval , and a test set D test in a certain proportion. using the training data set D all training the T5 model to obtain a trained model M trained ; The event feature data set comprises: Event type and all event role corresponding relationship schema, event type and single event role corresponding set S type_role , all event type set S type , all trigger word set S trigger and all event element set S argument ; wherein the schema records all event types in the original data set and all event roles corresponding to each event type respectively; S type_role According to the schema, the two-by-two combination of the event type of each event in the schema and all event roles, and the event role belongs to the first event role in the schema; S type Records all event types; S trigger Records all trigger words appearing in the original data set; S argument Records all event elements contained in the original data set; The model training dataset D all is built by the following steps: The annotation information of the original data set is summarized to obtain a corresponding relationship schema of an event type and all event roles, and a corresponding set S of an event type and a single event role type_role and all event type sets S type Three event feature data sets Constructing event type positive sample dataset D using the raw dataset and dataset schema +1 and event element positive sample dataset D +2 and all trigger word set S appearing in the raw dataset trigger and all event element set S argument two event feature data sets; Using the event type positive sample dataset D +1 and the event type dataset S type Constructing the event type full negative sample dataset D -1 ; using event element positive sample dataset D +2 , a trigger word set S trigger , an event element set S argument , and a corresponding set S of event types and single event roles type_role constructing an event element random negative sample dataset D -2 ; D +1 , D +2 , D -1 , D -2 mixing disorder, finally get the model training data set D all ; the event type positive sample dataset D +1 and the event element positive sample dataset D +2 is constructed by the following steps: A1. Extracting an event type e corresponding to a certain event contained in the original dataset text data text_p type , trigger word w trigger , event role e role_1 ~e role_n , corresponding event element w arg_1 ~w arg_n ; the input of the event type positive sample of the event is text_p+e type + "trigger word", and the output is w trigger ; the input of the event element positive sample of the event is text_p+prompt arg , and the output is w arg_1 ~w arg_n ; wherein the event element prompt arg is obtained by the following formula: ; A2. Constructing event type positive samples and event element positive samples using the method in A1 for each event in the text data text_p, obtaining an event type positive sample dataset D +1 and an event element positive sample dataset D +2 ; the event type all-negative sample dataset D -1 is constructed by the following steps: B1. e type B2. e type B3. e B2. A positive sample dataset D of event types +1 All events use the method of B1, and the event type full negative sample dataset D is constructed -1 ; the event element random negative sample dataset D -2 is constructed by the following steps: (1) In D +2 find all event element positive samples of a certain event, find all event element prompts from event element positive samples, and form a set S arg prompt ;​ (2) randomly select a trigger word from S trigger , get w trigger_random ; randomly select an element from S type_role , get an event type e type_random , an event role e role_random and the position p of the event role (3) Randomly select p event elements from the event element set S argument to obtain w arg_r_1 ~ w arg_r_p , and combine them in the following format to obtain the event element random prompt prompt arg_random ; prompt arg_random = e type_random + w trigger_random + w arg_r_1 + …+ w arg_r_p + e role_random (4) judge prompt arg_random whether exists in S prompt , if exists, repeat steps 2, 3, 4, if not exists, use prompt arg_random to construct negative sample, and add prompt arg_random to S prompt ; (5) Repeat steps (1) ~ (4) until 5n event element random negative samples are obtained; (6) For D +2 All event samples use (1) ~ (5) method to construct event element random negative sample data set D -2 ; The first step prediction sample set Dstep_1 and the first step prediction result and the second to n+1 step prediction sample set Dstep_2~Dstep_(n+1)and the prediction result of the second to n+1 step model Mtrain are obtained by the following steps: (1) sequentially traverse all event types e in the event feature data set S type type , and for any event type e , add a sample: text step1 + "trigger word" to the first-step prediction sample set D ; after the traversal, the number of samples in D step1 is m, m is the number of event types, and k ∈ [1, m];​ (2) The first step prediction sample set D step1 Enter M trained When a sample has an output, the output is the event type in the text to be extracted. Trigger words Search for the schema in the event feature data set. Corresponding first event role and in the format text + prompt _2 Add the output to the next prediction sample set D. step2 ;where prompt _2 = + + ; (3) D step2 input M trained , predict each trigger word corresponding to the first event role event elements, denoted as ; by looking at the schema to determine whether the event type has other event roles, if not, integrate the recognition results step; If the event type There are other event roles in the schema ~ Then The event type Other event roles ~ Step by step, the next step prediction sample set D is constructed step_3 ~D step_(n+1) , and D step_3 ~D step_(n+1) is input into the model M trained step by step, and the event element ~ is extracted until The event elements corresponding to all event roles contained are extracted by the model M trained , and the integration recognition result step is performed; The next step is to predict the sample set D step_3 ~D step_(n+1) is constructed by the following steps: In format text + prompt _X Constructing the sample set D for the next step of prediction step_(x) ; where prompt _x = + + + , for prompt _(x-1) , replace with , and add at the end; where x ∈ [3, n + 1], n is the number of event roles contained in the event type in the schema; The event elements used in the prompt information prompt include The determination method is as follows:​ ; wherein j∈[1,n-1], n is the number of event roles contained in the event type in the schema; if If the prediction result in the schema contains multiple prediction results, the multiple results need to be separated to construct the prediction sample according to the format in this step.

2. The method according to claim 1, characterized in that, The method comprises the following steps: Using the training set D train Fine-tuning the T5 model for N rounds, and using the validation set D at the end of each round of training eval Validation, taking the best one round model of the validation set result as the final model, and using the test set D test Testing, finally getting the trained model M trained ; In the training process, the model loss is calculated and the parameters are updated by using the following formula: ; wherein, is the predicted result, is the target output.

Citation Information

Patent Citations

  • Multilingual information extraction method adopting hierarchical pipeline filter system structure

    CN101751385A

  • Prompt-based event argument extraction method and system

    CN114880431A