An event segmentation and extraction method and system in a text extraction task
Patent Information
- Application Number
- CN202211366417.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-10-31
AI Technical Summary
但是依靠人工去划分事件之间的边界往往会耗费大量的人力资源
[0044](1)本发明中模型在进行事件抽取之前先进行事件分割,将粗粒度数据转化为细粒度数据,进而使得抽取模型一次处理较少的事件数目,避免抽取模型解码过于复杂,相比其他现有的一次性处理多事件文本的方法能大大提升文本事件抽取的正确率,减少抽取错误。
Smart Images

Figure CN115630304B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of deep learning and artificial intelligence technology, and relates to a method and system for text event segmentation and information extraction, specifically to a pipeline technology in text extraction tasks that first segments events and then extracts them. Background Technology
[0002] Event extraction is one of the most important and common problems in the field of information extraction, with wide applications in text summarization, automatic question answering, and information retrieval. An "event" refers to a series of activities centered around a specific theme, involving one or more actors (event subjects) within a specific time and space. The elements constituting an event include: trigger words, event type, event arguments, and argument roles. The goal of event extraction is to extract key information (the elements constituting the event) from text, transforming unstructured data into structured data. Depending on the event's location, event extraction can be categorized as sentence-level or document-level. A common approach to solving this type of problem using deep learning is to construct an end-to-end neural network model. Currently, mainstream methods in event extraction involve four steps: trigger word detection, event / trigger word type identification, event argument detection, and argument role identification. Although these methods have achieved good results on multiple datasets, for some texts with multiple events and little overlap, the model performance will be severely affected as the number of events in the text increases. Furthermore, most existing methods can only handle the case where the argument role and event argument are one-to-one in a single event.
[0003] The accuracy of event extraction is greatly affected by the number of events in the text. Therefore, reducing the number of text events processed is crucial to improving the accuracy of event extraction in the model. However, relying on manual delineation of the boundaries between events often consumes a lot of human resources. Summary of the Invention
[0004] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a method and system for event segmentation and extraction in text extraction tasks. By adopting a segmentation and extraction pipeline approach, the accuracy of text event extraction is greatly improved.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] Firstly, this invention provides an event segmentation and extraction method for text extraction tasks. In text extraction tasks, events are segmented first and then extracted. The purpose of segmentation is to identify the boundaries between events as much as possible, so that the model can process a smaller number of events at a time. The purpose of extraction is to identify the elements that make up the events as much as possible. The segmentation and extraction pipeline method greatly improves the accuracy of text event extraction.
[0007] The above method includes the following steps:
[0008] Step 1: Perform beginning and end annotations on several events in each document to generate a sample dataset of segmentation annotations; the beginning and end annotations adopt the Span segment annotation strategy.
[0009] Step 2: Build a neural network segmentation algorithm model based on a pre-trained model, and train it on the segmentation-annotated sample dataset obtained in Step 1;
[0010] Step 3: Using the trained segmentation algorithm model, segment the events on the external test set to obtain the event segmentation results;
[0011] Step 4: Based on the events that have been segmented in the event segmentation results, label the elements that make up the events to generate a sample dataset for extraction and labeling.
[0012] Step 5: Build a neural network extraction algorithm model based on the pre-trained model, and train it on the sample dataset with extraction labels obtained in Step 4.
[0013] Step 6: Using the trained extraction algorithm model, extract event elements from the external test set to obtain the event extraction results from the text.
[0014] Furthermore, in step 2, the neural network segmentation algorithm model based on the pre-trained model is implemented as follows:
[0015] (1) In the feature extraction part of the pre-trained model, the vector sequence is obtained after token-level feature representation using the Chinese pre-trained model. For vector sequences Perform a linear transformation to obtain the transformed result, i.e., a vector sequence. and The linear transformation formula is as follows: and ,Will and As a vector sequence for identifying the location of an event, ,
[0016] (2) Based on vector sequences, using =
[0017] Calculation from arrive Event score, , All are event location indices. Add positional coding to the score. , satisfy Relative position encoding;
[0018] (3) The improved multi-label classification loss function is used to obtain the final optimization objective. for:
[0019]
[0020] in, It is the first and last set of all events for all samples in the segmented and labeled sample dataset. It is the set of the first and last non-event samples in the segmented and labeled sample dataset;
[0021]
[0022]
[0023] .
[0024] Furthermore, in step 4, the neural network extraction algorithm model based on the pre-trained model is implemented as follows:
[0025] The event extraction task is transformed into three sub-tasks: argument identification, event partitioning, and graph search. These three tasks are progressive. First, argument identification is performed to find all arguments. After finding all arguments, events are partitioned to construct an event graph. Each argument is a node on the event graph. If two arguments belong to the same event, an edge is connected between the two nodes. Finally, graph search is performed recursively on the constructed event graph to identify the event set in the event graph.
[0026] For argument recognition, trigger words are treated as argument roles of an event, unifying the situation where there are no trigger words in an event. Event types and argument roles are combined, and argument recognition is transformed into an entity recognition task, thereby identifying all arguments present in the event.
[0027] The division of events is accomplished by constructing an event graph. Each argument in an event is considered a node on the event graph. This node possesses information about the event type, argument role, and position index. If any two arguments in the same event are related, an edge is drawn on the event graph to make them adjacent nodes. If two arguments never appear in the same event, the corresponding nodes have no edge, meaning they are not adjacent on the event graph. For two related nodes on the event graph, i.e., two arguments in the same event, a definition is defined... As a scoring function where two nodes are related;
[0028] in, and These are used to identify the corresponding nodes. and They are used to match the following relationships: The first and last token positions are characteristic pairs; This refers to the first token position of the two arguments. The last token position of the two arguments. As an argument relation, there is only one type of association relation here;
[0029] Graph search is used for the identification of event sets. The identification of event sets is solved using an improved recursive search-based algorithm, which is implemented as follows:
[0030] (1) Traverse any pair of nodes in the event graph. If all pairs of nodes have an associated edge, then all nodes in the event graph constitute an event and return. If there is a pair of nodes without an associated edge, execute step (2).
[0031] (2) For a pair of nodes that do not have an associated edge, traverse each node to find all its adjacent nodes to form a subgraph, and execute step (1) for each subgraph.
[0032] (3) Remove duplicates from all the obtained subgraph sets to obtain the final event set.
[0033] Secondly, the present invention provides an event segmentation and extraction system for text extraction tasks, comprising:
[0034] The module for building a sample dataset for segmentation annotation: It annotates the beginning and end of several events in each document to generate a sample dataset for segmentation annotation;
[0035] The neural network segmentation algorithm model module based on the pre-trained model: Build a neural network segmentation algorithm model based on the pre-trained model, and train it on the sample dataset with segmentation labels obtained in step 1; use the trained segmentation algorithm model to segment events on the external test set to obtain event segmentation results;
[0036] The neural network segmentation algorithm based on the pre-trained model is implemented as follows:
[0037] The module for creating a sample dataset for extracting annotations: Based on the events that have been segmented in the event segmentation results, the elements that make up the events are labeled to generate a sample dataset for extracting annotations.
[0038] The neural network extraction algorithm model module based on the pre-trained model: Build a neural network extraction algorithm model based on the pre-trained model and train it on the obtained sample dataset with extraction annotations; use the trained extraction algorithm model to extract event elements from the external test set to obtain the event extraction results in the text.
[0039] Thirdly, the present invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0040] Memory, used to store computer programs;
[0041] The processor, when executing the program stored in memory, implements the event segmentation and extraction method in the above text extraction task.
[0042] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the event segmentation and extraction method in the above-mentioned text extraction task.
[0043] The advantages of this invention compared to the prior art are:
[0044] (1) In this invention, the model performs event segmentation before event extraction, transforming coarse-grained data into fine-grained data, thereby enabling the extraction model to process a smaller number of events at a time, avoiding overly complex decoding of the extraction model. Compared with other existing methods for processing multiple event texts at once, this method can greatly improve the accuracy of text event extraction and reduce extraction errors.
[0045] (2) The segmentation model of this invention adopts a scoring function based on Span fragments and uses relative position encoding Q, which can extend the sequence length more than absolute position encoding. At the same time, for the loss function, event set score and non-event set score are introduced, which can better solve the class imbalance problem.
[0046] (3) The extraction model of this invention adopts the methods of event partitioning and graph search, and introduces a scoring function to determine whether arguments belong to the same event. It uses a recursive method to solve for the event set. Compared with other methods, our model is simple to decode, easy to implement, and highly efficient. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 A flowchart of an event segmentation and extraction method in a text extraction task provided by an embodiment of the present invention;
[0049] Figure 2 This is an example diagram of a graph search structure provided in an embodiment of the present invention;
[0050] Figure 3 Experimental data for the segmentation and extraction method provided in the embodiments of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0052] This invention provides an event segmentation and extraction method for text extraction tasks, such as... Figure 1 As shown, it mainly includes the following steps:
[0053] Step 1: In this embodiment of the invention, several events in each document are annotated at the beginning and end to generate a sample dataset of segmentation annotations; the beginning and end annotations adopt the Span segment annotation strategy.
[0054] Step 2: In this embodiment of the invention, a neural network segmentation algorithm model based on a pre-trained model is built, and the sample dataset with segmentation annotations obtained in Step 1 is trained.
[0055] (1) In this embodiment of the invention, the event segmentation framework is a mainstream network framework in the field of natural language processing: Transformer + global pointer decoding. In the feature extraction part, a vector sequence is obtained after token-level feature representation using a Chinese pre-trained model. For vector sequences Perform a linear transformation to obtain the transformed result, i.e., a vector sequence. and The linear transformation formula is as follows: and ,Will and As a vector sequence for identifying the location of an event, ,
[0056] (2) In this embodiment of the invention, based on vector sequences, the following is adopted: = ;
[0057] Calculation from arrive Event score, , All are event location indices. Add positional coding to the score. , satisfy Relative position encoding;
[0058] (3) In this embodiment of the invention, an improved multi-label classification loss function is used to obtain the final optimization objective. for:
[0059]
[0060] in, It is the first and last set of all events for all samples in the segmented and labeled sample dataset. It is the set of the first and last non-event samples in the segmented and labeled sample dataset;
[0061]
[0062] .
[0063] Step 3: In this embodiment of the invention, the trained segmentation algorithm model is used to segment events on the external test set to obtain event segmentation results;
[0064] In this embodiment of the invention, a network framework of Transformer + global pointer decoding is constructed. Training parameters and strategies are selected in a conventional manner, and the dataset constructed in step 1 is used as training data. The model is trained based on the final optimization objective. Using the trained model, event segmentation is performed on an external test set to obtain the event segmentation results.
[0065] Step 4: In this embodiment of the invention, based on the events that have been segmented in the event segmentation results, the elements that make up the events are labeled to generate a sample dataset for extraction and labeling.
[0066] Step 5: In this embodiment of the invention, a neural network extraction algorithm model based on a pre-trained model is built, and the event extraction task is transformed into three sub-tasks: argument recognition, event segmentation, and graph search. The sample dataset with extraction annotations obtained in Step 4 is then used for training.
[0067] In this embodiment of the invention, trigger words are treated as argument roles for events to unify the presence or absence of trigger words in an event. During the argument recognition stage, event types and argument roles are combined to transform the task into entity recognition, thereby identifying as many arguments as possible within the event.
[0068] In this embodiment of the invention, the division of events is mainly accomplished by constructing an event graph. Each argument in an event can be regarded as a node on the event graph. This node has relevant information such as event type, argument role, and position index. If any two arguments in the same event are related, an edge can be connected to them on the event graph to make them adjacent nodes. If two arguments never appear in the same event, then the corresponding nodes have no edge (not adjacent on the event graph).
[0069] In this embodiment of the invention, for two related nodes (two arguments in the same event) on the event graph, a definition is defined. A scoring function that represents a relationship between two nodes.
[0070] in, and These are used to identify the corresponding nodes. and They are used to match the following relationships: The first and last token positions are characteristic pairs; This refers to the first token position of the two arguments. The last token position of the two arguments. As an argument relation, there is only one type of association relation here;
[0071] In embodiments of the present invention, such as Figure 2 As shown, a recursive search-based algorithm was used to solve for the event set in the event graph.
[0072] (1) Traverse any pair of nodes in the event graph. If all pairs of nodes have an associated edge, then all nodes in the event graph constitute an event and return. If there is a pair of nodes without an associated edge, execute step (2).
[0073] (2) For a pair of nodes that do not have an associated edge, traverse each node to find all its adjacent nodes to form a subgraph, and execute step (1) for each subgraph.
[0074] (3) Remove duplicates from all the obtained subgraph sets to obtain the final event set.
[0075] Step 6: In this embodiment of the invention, the trained extraction algorithm model is used to extract event elements from the external test set to obtain the event extraction results in the text.
[0076] To illustrate the effects of the above-described solutions in the embodiments of the present invention, specific examples are provided below.
[0077] like Figure 3 As shown, this example uses a dataset from the corporate financial announcement domain for training and validation testing. On average, each sample contains 7 events, and each event exhibits a one-to-many relationship between argument roles and event arguments. The event segmentation algorithm achieves an accuracy of 0.98, indicating that the event segmentation model has good recognition capabilities in event boundary identification. In the event extraction algorithm, to compare the impact of the number of samples on event extraction, a dataset without event segmentation is included in the baseline. Experiments compare the baseline method with the segmentation-extraction combined algorithm, displaying the F1 score, precision, and recall. Experimental results show that after introducing the event segmentation algorithm, the document-level event extraction accuracy is significantly improved, with an F1 score of 0.90, indicating that this invention has a significant effect on samples with multiple events and little event overlap.
[0078] In summary, this invention employs a Span segmentation and annotation strategy to build a neural network segmentation algorithm model based on a pre-trained model. This model enables the network to learn the positions of the first and last tokens of an event, thus segmenting the event and reducing the number of events processed per extraction cycle. A neural network extraction algorithm model based on a pre-trained model is also built, transforming the event extraction task into three sub-tasks: argument recognition, event segmentation, and graph search. This method avoids overly complex decoding in the extraction model, improves the accuracy of text event extraction, and reduces extraction errors. Furthermore, this method is simple to implement, has high extraction efficiency, and theoretically avoids the exposure bias problem of traditional autoregressive models.
[0079] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of the above embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.), including several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0080] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An event segmentation and extraction method for text extraction tasks, characterized in that, Includes the following steps: Step 1: Annotate the beginning and end of several events in each document to generate a sample dataset of segmentation annotations; Step 2: Build a neural network segmentation algorithm model based on a pre-trained model, and train it on the segmentation-annotated sample dataset obtained in Step 1; Step 3: Using the trained segmentation algorithm model, segment the events on the external test set to obtain the event segmentation results; Step 4: Based on the events that have been segmented in the event segmentation results, label the elements that make up the events to generate a sample dataset for extraction and labeling. Step 5: Build a neural network extraction algorithm model based on the pre-trained model, and train it on the sample dataset with extraction labels obtained in Step 4. Step 6: Using the trained extraction algorithm model, extract event elements from the external test set to obtain the event extraction results in the text; The beginning and end annotations adopt the Span segment annotation strategy; The segmentation algorithm model employs a scoring function based on Span segments and uses relative position encoding Q; The neural network extraction algorithm based on the pre-trained model transforms the event extraction task into three sub-tasks: argument recognition, event segmentation, and graph search. It also introduces a scoring function to determine whether arguments belong to the same event and uses a recursive method to solve for the event set.
2. The event segmentation and extraction method in the text extraction task according to claim 1, characterized in that: In step 2, the neural network segmentation algorithm based on the pre-trained model is implemented as follows: (1) In the feature extraction part of the pre-trained model, the vector sequence is obtained after token-level feature representation using the Chinese pre-trained model. For vector sequences Perform a linear transformation to obtain the transformed result, i.e., a vector sequence. and The linear transformation formula is as follows: and ,Will and As a vector sequence for identifying the location of an event, , (2) Based on vector sequences, using = Calculation from arrive Event score, , All are event location indices. ; For position encoding, satisfy Relative position encoding; (3) The improved multi-label classification loss function is used to obtain the final optimization objective. for: ; in, It is the set of the first and last events of all samples in the segmented and labeled sample dataset. It is the set of the first and last non-event samples in the segmented and labeled sample dataset; ; ; 。 3. The event segmentation and extraction method in the text extraction task according to claim 1, characterized in that: In step 5, the neural network extraction algorithm based on the pre-trained model is implemented as follows: The event extraction task is transformed into three sub-tasks: argument identification, event partitioning, and graph search. These three tasks are progressive. First, argument identification is performed to find all arguments. After finding all arguments, events are partitioned to construct an event graph. Each argument is a node on the event graph. If two arguments belong to the same event, an edge is connected between the two nodes. Finally, graph search is performed recursively in the constructed event graph to identify the event set in the graph. For argument recognition, trigger words are treated as argument roles of an event, unifying the situation where there are no trigger words in an event. Event types and argument roles are combined, and argument recognition is transformed into an entity recognition task, thereby identifying all arguments present in the event. The division of events is accomplished by constructing a graph. Each argument in an event is regarded as a node on the graph. This node has information related to event type, argument role, and position index. For any two arguments in the same event, an edge is connected on the graph to make them adjacent nodes. If two arguments never appear in the same event, then the corresponding nodes have no edge, meaning they are not adjacent in the graph; for two related nodes in the graph, i.e., two arguments in the same event, define... As a scoring function where two nodes are related; in, and These are used to identify the corresponding nodes. and They are used to match the following relationships: The first token position and the last token position feature pair; The first token position of the two arguments. The last token position of the two arguments. As an argument relation, there is only one type of association relation here; When graph search is used for identifying event sets, an improved recursive search-based algorithm is employed.
4. The event segmentation and extraction method in the text extraction task according to claim 3, characterized in that: The identification of the event set is solved using an improved recursive search-based algorithm, specifically implemented as follows: (1) Traverse any pair of nodes in the graph. If all pairs of nodes have an associated edge, then all nodes in the graph constitute an event and return. If there is a pair of nodes without an associated edge, execute step (2). (2) For a pair of nodes that do not have an associated edge, traverse each node to find all its adjacent nodes to form a subgraph, and execute step (1) for each subgraph. (3) Remove duplicates from all the obtained subgraph sets to obtain the final event set.
5. A system for implementing the event segmentation and extraction method in the text extraction task according to any one of claims 1-4, characterized in that, include: The module for building a sample dataset for segmentation annotation: It annotates the beginning and end of several events in each document to generate a sample dataset for segmentation annotation; The neural network segmentation algorithm model module based on the pre-trained model: Build a neural network segmentation algorithm model based on the pre-trained model, and train it on the sample dataset with segmentation labels obtained in step 1; use the trained segmentation algorithm model to segment events on the external test set to obtain event segmentation results; The neural network extraction algorithm based on the pre-trained model is implemented as follows: The module for creating a sample dataset for extracting annotations: Based on the events that have been segmented in the event segmentation results, the elements that make up the events are labeled to generate a sample dataset for extracting annotations. The neural network extraction algorithm model module based on the pre-trained model: Build a neural network extraction algorithm model based on the pre-trained model and train it on the obtained sample dataset with extraction annotations; use the trained extraction algorithm model to extract event elements from the external test set to obtain the event extraction results in the text.
6. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-4.
Citation Information
Patent Citations
Document-level Chinese event extraction method
CN114880437A