Event relationship extraction method, device, electronic device and storage medium
By encoding and decoding the target text, the half-pointer matrix of event arguments and relationships is obtained, and the event roles and relationships are analysed, the problem of low accuracy of event roles and relationship extraction in the existing technology is solved, and high accuracy extraction under multiple relationship pairs is achieved.
Patent Information
- Application Number
- CN202210954746.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-08-10
AI Technical Summary
In the prior art, the accuracy of event roles and event relationship extraction is low, and there is mutual interference between multiple relationship pairs, resulting in inaccurate determination of roles and relationships.
By inputting the target text into the supervised learning model, obtaining the encoded timing sequence, decoding the half-pointer matrix of event arguments and event relationships, using these matrices to analyze event roles and relationships, eliminating mutual interference between multiple relationship pairs, and improving accuracy.
The accurate extraction of event roles and relationships in multiple relationship pairs is achieved, the accuracy of event roles and event relationship extraction is improved, and the correctness of event roles playing different roles in different relationship pairs is ensured.
Smart Images

Figure CN115358209B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of model technology, and in particular to a method, device, electronic device and storage medium for extracting event relationships. Background Art
[0002] People's social activities are driven by events, which serve as the carriers of social activities. In natural language processing, events, as a form of information representation, are becoming increasingly important. Events contain a large number of internal components (such as participants, time, and location) and external connections (such as semantic relationships such as causality, coreference, and temporal order). Extracting relationships from text containing a large number of events can achieve a deeper understanding of the text.
[0003] Events exist in texts and can exist in the form of relational pairs; but in real scenarios, there are often more than one event and relational pairs, and they appear in an overlapping manner. Even one event plays different roles in different relational pairs.
[0004] For example, causality represents a universal connection between objective events. Causal relationships primarily consist of two parts: the cause event and the result event. Events exist in text and can form causal pairs; however, in real-world scenarios, there are often multiple causal pairs, and these pairs often overlap. Even a single event can play different roles in different causal pairs.
[0005] Currently, relationship extraction often uses a pipelined approach, first extracting all events and then extracting the relationships between events. If the role of one relationship pair of the event is determined, the role of the event in other relationship pairs cannot be determined, resulting in low accuracy in extracting event roles and event relationships. Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide a method, device, electronic device, and storage medium for extracting event relationships to solve the problem of low accuracy in extracting event roles and event relationships. The specific technical solution is as follows:
[0007] In a first aspect, a method for extracting event relations is provided, the method comprising:
[0008] Inputting the target text into a supervised learning model to obtain a plurality of encoded time series, wherein each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text;
[0009] Decoding each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations, wherein each element of the half-pointer matrix of event arguments can represent a type role of an argument referred to by a character, and each element of the half-pointer matrix of event relations can represent a relationship role of an event referred to by a character;
[0010] Based on the analysis of the half-pointer matrix of the event arguments and the half-pointer matrix of the event relations, the event roles and event relations are extracted.
[0011] Optionally, decoding each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations includes:
[0012] Decoding the time sequence to obtain two half-pointer matrices of event arguments, namely, Role-start-Matrix and Role-end-Matrix, wherein the Role-start-Matrix indicates the starting position of the argument and the Role-end-Matrix indicates the ending position of the argument;
[0013] According to the two half-pointer matrices of the time sequence and the event arguments, two half-pointer matrices of the event relationship, Relation-start-Matrix and Relation-end-Matrix, are obtained, wherein the Relation-start-Matrix indicates the starting position of the relationship and the Relation-end-Matrix indicates the ending position of the relationship.
[0014] Optionally, obtaining two half-pointer matrices of event relations according to the time series and the two half-pointer matrices of the event arguments includes:
[0015] By analyzing the two half-pointer matrices of the event argument, the argument probability of the character being any argument is obtained;
[0016] Determine a sum of the product of the time series, the argument probability, and the time series;
[0017] By decoding the summation result and the time sequence, two half-pointer matrices of event relations are obtained.
[0018] Optionally, in the half-pointer matrix of the event argument, each row represents a character with a length of n, and each column represents the type role of an argument with a length of len(event)*len(argument), where len(event) represents the number of event types and len(argument) represents the number of argument types.
[0019] Optionally, in the half-pointer matrix of the event relationship, each row represents a character with a length of n, and each column represents the relationship role of an event with a length of len(event)*len(relationship), where len(event) represents the number of event types and len(relationship) represents the number of event relationships.
[0020] Optionally, extracting event arguments and causal relationships between events based on parsing the multiple half-pointer matrices includes:
[0021] Extracting event arguments and argument roles based on parsing the two half-pointer matrices of the event arguments;
[0022] Based on the analysis of the two half pointer matrices of the event relationship, the event relationship and the relationship roles of the events are extracted.
[0023] Optionally, before inputting the target text into the supervised learning model, the method further includes:
[0024] Get the initial text;
[0025] The initial text is preprocessed to obtain a preprocessed target text, wherein the preprocessing includes deleting garbled content and interference content.
[0026] In a second aspect, a device for extracting event relations is provided, the device comprising:
[0027] An input-output module inputs the target text into the supervised learning model to obtain a plurality of encoded time series, wherein each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text;
[0028] a decoding module, configured to decode each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations, wherein each element of the half-pointer matrix of event arguments can represent a type role of an argument referred to by a character, and each element of the half-pointer matrix of event relations can represent a relationship role of an event referred to by a character;
[0029] The parsing module is used to extract event roles and event relations based on parsing the half-pointer matrix of the event arguments and the half-pointer matrix of the event relations.
[0030] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0031] Memory for storing computer programs;
[0032] The processor is used to implement any of the above-mentioned event relationship extraction method steps when executing the program stored in the memory.
[0033] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the steps of the event relationship extraction method.
[0034] Beneficial effects of the embodiments of the present application:
[0035] The embodiment of the present application provides a method for extracting event relations. By encoding the target text and decoding the time sequence, the half-pointer matrix of the event argument and the half-pointer matrix of the event relation are obtained. By analyzing the half-pointer matrix of the event argument and the half-pointer matrix of the event relation, the server can determine all argument roles and event roles. The argument role is to assist in realizing the event role. Then the relationship between each event can be fully extracted, eliminating the mutual interference between multiple relationship pairs, so that multiple relationship pairs or an event playing different roles in different relationship pairs can still guarantee a high accuracy rate, thereby improving the accuracy of event role and event relationship extraction.
[0036] Of course, it is not necessary to achieve all of the above advantages at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0038] Figure 1 A schematic diagram of the hardware environment for a method for extracting event relationships provided in an embodiment of the present application;
[0039] Figure 2 A flow chart of a method for extracting event relationships provided in an embodiment of the present application;
[0040] Figure 3 Schematic diagram of the extraction model provided in the embodiment of the present application;
[0041] Figure 4 A schematic diagram of a half-pointer matrix of event arguments provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of a half-pointer matrix of event relationships provided in an embodiment of the present application;
[0043] Figure 6A flowchart for extracting event relationships provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of the structure of an event relationship extraction device provided in an embodiment of the present application;
[0045] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0048] In order to solve the problems mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a method for extracting event relations is provided.
[0049] Optionally, in the embodiment of the present application, the above event relationship extraction method can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1 As shown, the server 103 is connected to the terminal 101 via a network and can be used to provide services for the terminal or a client installed on the terminal. A database 105 can be set on the server or independently of the server to provide data storage services for the server 103. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 includes but is not limited to a PC, a mobile phone, a tablet computer, etc.
[0050] A method for extracting event relations in an embodiment of the present application may be executed by the server 103 .
[0051] The following will describe in detail a method for extracting event relationships provided by an embodiment of the present application in conjunction with a specific implementation method. Figure 2 The specific steps are as follows:
[0052] Step 201: Input the target text into the supervised learning model to obtain multiple encoded time series.
[0053] Each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text.
[0054] In an embodiment of the present application, the server inputs the target text into the supervised learning model, that is, each character in the target text is input into the supervised learning model, and the supervised learning model encodes the character to obtain an encoding vector H containing the context of the character, where the length of H is n, where n is an integer greater than or equal to 1.
[0055] Step 202: Decode each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations.
[0056] Each element of the half-pointer matrix of the event argument can represent the type role of an argument referred to by a character, and each element of the half-pointer matrix of the event relationship can represent the relationship role of an event referred to by a character.
[0057] In an embodiment of the present application, the server decodes each time sequence H to obtain four half-pointer matrices, namely two half-pointer matrices Role-start-Matrix and Role-end-Matrix of event arguments and two half-pointer matrices Relation-start-Matrix and Relation-end-Matrix of event relations.
[0058] In the event argument semi-pointer matrix, each row represents a character, and each column represents the type role of an argument. Therefore, each element can represent the type role of an argument referred to by a character. In the event relation semi-pointer matrix, each row represents a character, and each column represents the relation role of an event. Therefore, each element can represent the relation role of an event referred to by a character.
[0059] Step 203: extracting event roles and event relationships based on parsing the half-pointer matrix of the event arguments and the half-pointer matrix of the event relationships.
[0060] In an embodiment of the present application, the server extracts event arguments based on parsing a half-pointer matrix of event arguments, and extracts event relations based on parsing a half-pointer matrix of event relations.
[0061] In this application, by encoding the target text and decoding the time sequence, the half-pointer matrix of the event argument and the half-pointer matrix of the event relationship are obtained. By analyzing the half-pointer matrix of the event argument and the half-pointer matrix of the event relationship, the server can determine all the argument roles and event roles. The argument role is to assist in realizing the event role. Then the relationship between each event can be fully extracted, eliminating the mutual interference between multiple relationship pairs, so that multiple relationship pairs or an event playing different roles in different relationship pairs can still guarantee a high accuracy rate, thereby improving the accuracy of event role and event relationship extraction.
[0062] As an optional implementation, decoding each of the time series sequences to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations includes: decoding the time series sequence to obtain two half-pointer matrices of event arguments, Role-start-Matrix and Role-end-Matrix, wherein the Role-start-Matrix indicates the starting position of the argument and the Role-end-Matrix indicates the ending position of the argument; and obtaining two half-pointer matrices of event relations, Relation-start-Matrix and Relation-end-Matrix, according to the time series sequence and the two half-pointer matrices of the event arguments, wherein the Relation-start-Matrix indicates the starting position of the relationship and the Relation-end-Matrix indicates the ending position of the relationship.
[0063] In an embodiment of the present application, the server first decodes the timing sequence to obtain two half-pointer matrices of event arguments, namely Role-start-Matrix and Role-end-Matrix, wherein the Role-start-Matrix indicates the starting position of the argument and the Role-end-Matrix indicates the ending position of the argument. The two half-pointer matrices of the event argument are then parsed to obtain the argument probability O of a character being a certain argument, which in turn gives the probability of the type role of the argument represented by the character. The server then determines the sum H+H*O of the timing sequence, the product of the argument probability, and the timing sequence. By parsing H+H*O, the argument probability and the timing sequence can be fused together, that is, the argument type role and the timing sequence are fused together to obtain the two half-pointer matrices of the event relationship, namely, the Relation-start-Matrix and the Relation-end-Matrix.
[0064] Figure 3The following is a diagram of the extraction model. The supervised learning model can be BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model). This model is a joint extraction model based on a labeling scheme. Based on the BERT framework, the input is each character. After BERT encoding, a time series sequence H (length n) containing the context is obtained. Decoding the time series H yields the semi-pointer matrices of event arguments, the Role-start-Matrix and the Role-end-Matrix. By analyzing the Role-start-Matrix and the Role-end-Matrix, the argument probability O is obtained. After calculating H + H * O and then parsing, the semi-pointer matrices of event relations, the Relation-start-Matrix and the Relation-end-Matrix, are obtained. By parsing these four matrices, event arguments and event relations can be extracted.
[0065] As an optional implementation, in a half-pointer matrix of event arguments, each row represents a character of length n, and each column represents the type role of an argument of length len(event)*len(argument), where len(event) represents the number of event types, and len(argument) represents the number of argument types. Event types include causal, coreference, sequential, and temporal. The argument type indicates the subject or object of the argument in the event.
[0066] Figure 4 This is a schematic diagram of the semi-pointer matrix of event arguments, where c1, c2…cj, cn represent the type role of an argument respectively.
[0067] As an optional implementation, in the half-pointer matrix of event relations, each row represents a character with a length of n, and each column represents the relationship role of an event with a length of len(event)*len(relationship), where len(event) represents the number of event types and len(relationship) represents the number of event relations.
[0068] For example, if the causal relationship between events is to be determined, the event relationship is {cause, result}, and len(relationship) is 2. If the temporal relationship between events is to be determined, len(relationship) is multiple.
[0069] Figure 5 This is a schematic diagram of a semi-pointer matrix of event relations, where x1, x2…xj, xn represent the relational roles of an event respectively.
[0070] As an optional implementation, before inputting the target text into the supervised learning model, the method further includes: obtaining an initial text; preprocessing the initial text to obtain a preprocessed target text, wherein the preprocessing includes deleting garbled content and interference content.
[0071] The server obtains the initial text from the terminal. The initial text may contain some garbled content and interference content. The server preprocesses the initial text to obtain the preprocessed target text.
[0072] Based on the same technical concept, the embodiment of the present application also provides an event extraction flow chart of event relations, such as Figure 6 As shown, the process includes:
[0073] 1) Text preprocessing: Preprocess the initial text, mainly involving the removal of garbled content and interference content;
[0074] 2) Natural Language Processing Encoding: The target text is fed into the natural language processing to obtain two and a half pointer matrices of event arguments and two and a half pointer matrices of event relations;
[0075] 3) Event extraction: Parse the semi-pointer matrices Role-start-Matrix and Role-end-Matrix of the event arguments to obtain the event arguments and argument types;
[0076] 4) Event Relationship Extraction: Parse the semi-pointer matrices Relation-start-Matrix and Relation-end-Matrix of the event relationship to obtain the event relationship and identify the event role.
[0077] Based on the same technical concept, the embodiment of the present application also provides an event relationship extraction device, such as Figure 7 As shown, the device includes:
[0078] Input-output module 701 inputs the target text into the supervised learning model to obtain a plurality of encoded time series, wherein each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text;
[0079] A decoding module 702 is configured to decode each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations, wherein each element of the half-pointer matrix of event arguments can represent a type role of an argument referred to by a character, and each element of the half-pointer matrix of event relations can represent a relationship role of an event referred to by a character;
[0080] The parsing module 703 is configured to extract event roles and event relationships based on parsing the half-pointer matrix of the event arguments and the half-pointer matrix of the event relationships.
[0081] Optionally, the decoding module 702 is configured to:
[0082] Decoding the time sequence to obtain two half-pointer matrices of event arguments, namely, Role-start-Matrix and Role-end-Matrix, wherein the Role-start-Matrix indicates the starting position of the argument and the Role-end-Matrix indicates the ending position of the argument;
[0083] According to the two half-pointer matrices of the time sequence and the event arguments, two half-pointer matrices of the event relationship, Relation-start-Matrix and Relation-end-Matrix, are obtained, wherein the Relation-start-Matrix indicates the starting position of the relationship and the Relation-end-Matrix indicates the ending position of the relationship.
[0084] Optionally, the decoding module 702 is configured to:
[0085] By analyzing the two half-pointer matrices of the event argument, the argument probability of the character being any argument is obtained;
[0086] Determine a sum of the product of the time series, the argument probability, and the time series;
[0087] By decoding the summation result and the time sequence, two half-pointer matrices of event relations are obtained.
[0088] Optionally, in the half-pointer matrix of the event argument, each row represents a character with a length of n, and each column represents the type role of an argument with a length of len(event)*len(argument), where len(event) represents the number of event types and len(argument) represents the number of argument types.
[0089] Optionally, in the half-pointer matrix of the event relationship, each row represents a character with a length of n, and each column represents the relationship role of an event with a length of len(event)*len(relationship), where len(event) represents the number of event types and len(relationship) represents the number of event relationships.
[0090] Optionally, the parsing module 703 is used to:
[0091] Extracting event arguments and argument roles based on parsing the two half-pointer matrices of the event arguments;
[0092] Based on the analysis of the two half pointer matrices of the event relationship, the event relationship and the relationship roles of the events are extracted.
[0093] Optionally, the device is further used to:
[0094] Get the initial text;
[0095] The initial text is preprocessed to obtain a preprocessed target text, wherein the preprocessing includes deleting garbled content and interference content.
[0096] According to another aspect of the embodiment of the present application, the present application provides an electronic device, such as Figure 8 As shown, it includes a memory 803, a processor 801, a communication interface 802 and a communication bus 804. The memory 803 stores a computer program that can be run on the processor 801. The memory 803 and the processor 801 communicate through the communication interface 802 and the communication bus 804. When the processor 801 executes the computer program, the steps of the above method are implemented.
[0097] The memory and processor in the electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like.
[0098] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0099] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0100] According to another aspect of the embodiments of the present application, a computer-readable medium having non-volatile program code executable by a processor is provided.
[0101] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for the processor to execute the above method.
[0102] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0103] When implementing the embodiments of the present application, reference may be made to the above embodiments, which have corresponding technical effects.
[0104] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.
[0105] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0106] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0107] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0110] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or partly contributed to the prior art or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard drive, a ROM, a RAM, a magnetic disk, or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without further constraints, an element defined by the phrase "comprises a..." does not preclude the existence of additional identical elements in the process, method, article or apparatus that includes the element.
[0112] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims
1. A method for extracting event relations, characterized in that: The method comprises: Inputting the target text into a supervised learning model to obtain a plurality of encoded time series, wherein each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text; Decoding each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations, wherein each element of the half-pointer matrix of event arguments can represent a type role of an argument referred to by a character, and each element of the half-pointer matrix of event relations can represent a relationship role of an event referred to by a character; Based on the analysis of the half-pointer matrix of the event arguments and the half-pointer matrix of the event relations, the event roles and event relations are extracted.
2. The method according to claim 1, characterized in that Decoding each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations includes: Decoding the time sequence to obtain two half-pointer matrices of event arguments, namely, Role-start-Matrix and Role-end-Matrix, wherein the Role-start-Matrix indicates the starting position of the argument and the Role-end-Matrix indicates the ending position of the argument; According to the two half-pointer matrices of the time sequence and the event arguments, two half-pointer matrices of the event relationship, Relation-start-Matrix and Relation-end-Matrix, are obtained, wherein the Relation-start-Matrix indicates the starting position of the relationship and the Relation-end-Matrix indicates the ending position of the relationship.
3. The method according to claim 2, characterized in that According to the time series and the two half pointer matrices of the event arguments, the two half pointer matrices of the event relationship are obtained, including: By analyzing the two half-pointer matrices of the event argument, the argument probability of the character being any argument is obtained; Determine a sum of the product of the time series, the argument probability, and the time series; By decoding the summation result and the time sequence, two half-pointer matrices of event relations are obtained.
4. The method according to claim 1, wherein In the half-pointer matrix of the event argument, each row represents a character with a length of n, and each column represents the type role of an argument with a length of len(event)*len(argument), where len(event) represents the number of event types and len(argument) represents the number of argument types.
5. The method according to claim 1, characterized in that In the semi-pointer matrix of the event relationship, each row represents a character with a length of n, and each column represents a relationship role of an event with a length of len(event)*len(relationship), where len(event) represents the number of event types and len(relationship) represents the number of event relationships.
6. The method according to claim 2, characterized in that Also includes: Based on the analysis of multiple half-pointer matrices, the causal relationship between event arguments and events is extracted, specifically: Extracting event arguments and argument roles based on parsing the two half-pointer matrices of the event arguments; Based on the analysis of the two half pointer matrices of the event relationship, the event relationship and the relationship roles of the events are extracted.
7. The method according to claim 2, characterized in that Before inputting the target text into the supervised learning model, the method further includes: Get the initial text; The initial text is preprocessed to obtain a preprocessed target text, wherein the preprocessing includes deleting garbled content and interference content.
8. An event relationship extraction device, characterized in that: The device comprises: An input-output module inputs the target text into the supervised learning model to obtain a plurality of encoded time series, wherein each of the time series indicates an encoding vector containing contextual semantic information of a current character in the text; a decoding module, configured to decode each of the time series to obtain a half-pointer matrix of event arguments and a half-pointer matrix of event relations, wherein each element of the half-pointer matrix of event arguments can represent a type role of an argument referred to by a character, and each element of the half-pointer matrix of event relations can represent a relationship role of an event referred to by a character; The parsing module is used to extract event roles and event relations based on parsing the half-pointer matrix of the event arguments and the half-pointer matrix of the event relations.
9. 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 via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Unstructured text extraction multi-task joint training method based on pointer network
CN111488726A
Event extraction method and device, and computer readable storage medium
CN111723569A