Event extraction method and device, computer equipment and storage medium

文档序号:830125 发布日期:2021-03-30 浏览:9次 中文

阅读说明:本技术 事件抽取方法、装置、计算机设备和存储介质 (Event extraction method and device, computer equipment and storage medium ) 是由 赵正锐 刘进步 费加磊 于 2020-11-17 设计创作,主要内容包括:本申请涉及一种事件抽取方法、装置、计算机设备和存储介质。所述方法包括:获取待进行事件抽取的目标文本;将所述目标文本输入到事件抽取联合模型中进行处理,得到所述目标文本中,各个目标分词分别对应的事件类型识别概率以及论元角色识别概率;根据所述论元角色识别概率识别得到所述目标分词对应的目标论元角色;根据所述事件类型识别概率识别得到初始事件类型集合;从所述初始事件类型集合中筛选得到与所述目标论元角色匹配的目标事件类型,以根据所述目标论元角色以及所述目标事件类型得到所述目标文本对应的事件抽取结果。采用本方法能够提高事件抽取准确度。(The application relates to an event extraction method, an event extraction device, computer equipment and a storage medium. The method comprises the following steps: acquiring a target text to be subjected to event extraction; inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word segmentation in the target text; identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability; identifying according to the event type identification probability to obtain an initial event type set; and screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type. By adopting the method, the event extraction accuracy can be improved.)

1. An event extraction method, the method comprising:

acquiring a target text to be subjected to event extraction;

inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word segmentation in the target text;

identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability;

identifying according to the event type identification probability to obtain an initial event type set;

and screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

2. The method according to claim 1, wherein the event extraction joint model includes a text coding model, an event type recognition model and an argument role recognition model, and the step of inputting the target text into the event extraction joint model for processing to obtain the event type recognition probability and the argument role recognition probability corresponding to each target word segmentation in the target text comprises:

inputting the target text into the text coding model, and coding each target word segmentation corresponding to the target text by the text coding model to obtain word segmentation coding vectors corresponding to each target word segmentation;

inputting the segmentation code vectors corresponding to the target segmentation into the event type identification model to obtain event type identification probabilities corresponding to the target segmentation;

and inputting the word segmentation coding vector corresponding to the target word segmentation into the argument role recognition model to obtain argument role recognition probability corresponding to each target word segmentation.

3. The method of claim 1, wherein the argument role recognition probability comprises a probability that the target participle is a head pointer of a candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the method further comprising:

if the probability that the target word segmentation is the head pointer of the candidate argument role is larger than a first threshold value, determining that the target word segmentation is the head pointer of the candidate argument role;

if the probability that the target word segmentation is the tail pointer of the candidate argument role is larger than a second threshold value, determining that the target word segmentation is the tail pointer of the candidate argument role;

and determining a target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

4. The method of claim 3, wherein the event type recognition probability comprises a probability that the target participle is a head pointer of a candidate event type and a probability that the target participle is a tail pointer of the candidate event type, and wherein the recognizing an initial event type set according to the event type recognition probability comprises:

acquiring a head event type set corresponding to a head pointer corresponding to a starting point of the target argument segment according to the probability that the target participle is the head pointer of the candidate event type;

acquiring a tail event type set corresponding to a tail pointer corresponding to a terminating point of the target argument segment according to the probability that the target participle is the tail pointer of the candidate event type;

and determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

5. The method according to claim 4, wherein the obtaining a set of head event types corresponding to a head pointer corresponding to a starting point of the target argument fragment according to the probability that the target participle is a head pointer of a candidate event type comprises:

if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type;

determining a target participle with a distance smaller than a first distance from the starting point of the target argument fragment as a first adjacent participle;

and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

6. The method according to claim 4, wherein the obtaining a set of tail event types corresponding to tail pointers corresponding to termination points of the target argument fragment according to the probability that the target participle is a tail pointer of a candidate event type comprises:

if the probability that the target word segmentation is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target word segmentation is the tail pointer of the candidate event type;

determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle;

and taking the candidate event type taking the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

7. The method of claim 4, wherein said determining an initial set of event types corresponding to the target argument fragment based on the set of head event types and the set of tail event types comprises:

comparing the event type in the head event type set with the event type in the tail event type set;

and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment.

8. The method of claim 1, wherein the filtering of the set of initial event types for target event types matching the target argument role comprises:

acquiring a matching relation between a preset event type and argument roles;

and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as a target event type.

9. An event extraction device, the device comprising:

the target text acquisition module is used for acquiring a target text to be subjected to event extraction;

the processing module is used for inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability which correspond to each target word in the target text;

the argument role obtaining module is used for identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability;

an initial event type set obtaining module, configured to obtain an initial event type set according to the event type identification probability;

and the event extraction result obtaining module is used for screening the initial event type set to obtain a target event type matched with the target argument role so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 8.

11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.

Technical Field

The present application relates to the field of information processing technologies, and in particular, to an event extraction method and apparatus, a computer device, and a storage medium.

Background

With the development of scientific technology, information extraction is required to be performed on texts in many cases to determine information contained in the texts. For example, Event extraction (Event extraction) can be performed on a text, and the Event extraction technology can obtain structured Event information by identifying a specific type of Event and determining and extracting related information.

In the conventional technology, when event extraction is performed, a trigger word extraction and an event type identification task are generally performed first, and then an argument extraction and an argument role identification task are performed, however, the event extraction accuracy is often low.

Disclosure of Invention

In view of the above, it is necessary to provide a method, an apparatus, a computer device and a storage medium capable of event extraction for solving the above technical problems.

A method of event extraction, the method comprising: acquiring a target text to be subjected to event extraction; inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word in the target text; identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability; identifying according to the event type identification probability to obtain an initial event type set; and screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

In some embodiments, the event extraction joint model includes a text coding model, an event type identification model, and a argument role identification model, and the inputting the target text into the event extraction joint model for processing to obtain an event type identification probability and an argument role identification probability corresponding to each target word in the target text includes: inputting the target text into the text coding model, and coding each target participle corresponding to the target text by the text coding model to obtain a participle coding vector corresponding to each target participle; inputting the word segmentation coding vectors corresponding to the target word segmentation into the event type identification model to obtain event type identification probabilities corresponding to the target word segmentation; and inputting the word segmentation coding vector corresponding to the target word segmentation into the argument role recognition model to obtain argument role recognition probability corresponding to each target word segmentation.

In some embodiments, the argument role recognition probability comprises a probability that the target participle is a head pointer of a candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the method further comprising: if the probability that the target word segmentation is the head pointer of the candidate argument role is larger than a first threshold value, determining that the target word segmentation is the head pointer of the candidate argument role; if the probability that the target word segmentation is the tail pointer of the candidate argument role is larger than a second threshold value, determining that the target word segmentation is the tail pointer of the candidate argument role; and determining a target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

In some embodiments, the event type identification probability includes a probability that the target word segmentation is a head pointer of a candidate event type and a probability that the target word segmentation is a tail pointer of the candidate event type, and the identifying an initial event type set according to the event type identification probability includes: acquiring a head event type set corresponding to a head pointer corresponding to a starting point of the target argument segment according to the probability that the target word segmentation is the head pointer of the candidate event type; acquiring a tail event type set corresponding to a tail pointer corresponding to a terminating point of the target argument segment according to the probability that the target participle is the tail pointer of the candidate event type; and determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

In some embodiments, the obtaining, according to the probability that the target word segmentation is the head pointer of the candidate event type, the head event type set corresponding to the head pointer corresponding to the starting point of the target argument fragment includes: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from the starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

In some embodiments, the obtaining, according to the probability that the target participle is a tail pointer of a candidate event type, a tail event type set corresponding to a tail pointer corresponding to a termination point of the target argument fragment includes: if the probability that the target participle is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target participle is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type taking the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

In some embodiments, the determining, according to the head event type set and the tail event type set, an initial event type set corresponding to the target argument fragment includes: comparing the event type in the head event type set with the event type in the tail event type set; and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment.

In some embodiments, the filtering of the target event type matching the target argument role from the initial set of event types includes: acquiring a matching relation between a preset event type and argument roles; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as a target event type.

An event extraction device, the device comprising: the target text acquisition module is used for acquiring a target text to be subjected to event extraction; the processing module is used for inputting the target text into an event extraction combined model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word in the target text; the argument role obtaining module is used for identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability; an initial event type set obtaining module, configured to obtain an initial event type set according to the event type identification probability; and an event extraction result obtaining module, configured to filter the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

In some embodiments, the event extraction joint model includes a text coding model, an event type identification model, and an argument role identification model, and the processing module includes: a word segmentation coding vector obtaining unit, configured to input the target text into the text coding model, where the text coding model codes each target word segmentation corresponding to the target text to obtain a word segmentation coding vector corresponding to each target word segmentation; an event type identification probability obtaining unit, configured to input the segmentation coding vectors corresponding to the target segmentation into the event type identification model, so as to obtain event type identification probabilities corresponding to the target segmentation; and the argument role recognition probability obtaining unit is used for inputting the word segmentation coding vector corresponding to the target word segmentation into the argument role recognition model to obtain argument role recognition probabilities respectively corresponding to the target word segmentation.

In some embodiments, the argument role recognition probability comprises a probability that the target participle is a head pointer of a candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the apparatus further comprising: a head pointer determining module, configured to determine that the target word segmentation is the head pointer of the candidate argument role if the probability that the target word segmentation is the head pointer of the candidate argument role is greater than a first threshold; a tail pointer determining module, configured to determine that the target participle is a tail pointer of the candidate argument role if the probability that the target participle is the tail pointer of the candidate argument role is greater than a second threshold; and the target argument fragment determining module is used for determining the target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

In some embodiments, the event type identification probability includes a probability that the target word segmentation is a head pointer of a candidate event type and a probability that the target word segmentation is a tail pointer of the candidate event type, and the initial event type set obtaining module includes: a head event type set obtaining unit, configured to obtain, according to the probability that the target word segmentation is a head pointer of a candidate event type, a head event type set corresponding to the head pointer corresponding to the starting point of the target argument segment; a tail event type set obtaining unit, configured to obtain, according to the probability that the target word segmentation is the tail pointer of the candidate event type, a tail event type set corresponding to the tail pointer corresponding to the termination point of the target argument segment; and the initial event type set determining unit is used for determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

In some embodiments, the head event type set obtaining unit is configured to: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from the starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

In some embodiments, the tail event type set obtaining unit is configured to: if the probability that the target word segmentation is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target word segmentation is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type taking the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

In some embodiments, the initial event type set determination unit is to: comparing the event type in the head event type set with the event type in the tail event type set; and taking the event types which are compared to each other as initial event types to obtain an initial event type set corresponding to the target argument fragment.

In some embodiments, the event extraction result obtaining module is configured to: acquiring a matching relation between a preset event type and argument roles; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as a target event type.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program: acquiring a target text to be subjected to event extraction; inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word segmentation in the target text; identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability; identifying according to the event type identification probability to obtain an initial event type set; and screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

In some embodiments, the event extraction joint model includes a text coding model, an event type identification model, and a argument role identification model, and the inputting the target text into the event extraction joint model for processing to obtain an event type identification probability and an argument role identification probability corresponding to each target word in the target text includes: inputting the target text into the text coding model, and coding each target participle corresponding to the target text by the text coding model to obtain a participle coding vector corresponding to each target participle; inputting the word segmentation coding vectors corresponding to the target word segmentation into the event type identification model to obtain event type identification probabilities corresponding to the target word segmentation; and inputting the word segmentation coding vector corresponding to the target word segmentation into the argument role recognition model to obtain argument role recognition probability corresponding to each target word segmentation.

In some embodiments, the argument role recognition probability comprises a probability that the target participle is a head pointer of a candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the computer program further causing the processor to perform the steps of: if the probability that the target word segmentation is the head pointer of the candidate argument role is larger than a first threshold value, determining that the target word segmentation is the head pointer of the candidate argument role; if the probability that the target word segmentation is the tail pointer of the candidate argument role is larger than a second threshold value, determining that the target word segmentation is the tail pointer of the candidate argument role; and determining a target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

In some embodiments, the event type identification probability includes a probability that the target word segmentation is a head pointer of a candidate event type and a probability that the target word segmentation is a tail pointer of the candidate event type, and the identifying an initial event type set according to the event type identification probability includes: acquiring a head event type set corresponding to a head pointer corresponding to a starting point of the target argument segment according to the probability that the target word segmentation is the head pointer of the candidate event type; acquiring a tail event type set corresponding to a tail pointer corresponding to a terminating point of the target argument segment according to the probability that the target participle is the tail pointer of the candidate event type; and determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

In some embodiments, the obtaining, according to the probability that the target word segmentation is the head pointer of the candidate event type, the head event type set corresponding to the head pointer corresponding to the starting point of the target argument fragment includes: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from the starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

In some embodiments, the obtaining, according to the probability that the target participle is a tail pointer of a candidate event type, a tail event type set corresponding to a tail pointer corresponding to a termination point of the target argument fragment includes: if the probability that the target participle is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target participle is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type taking the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

In some embodiments, the determining, according to the head event type set and the tail event type set, an initial event type set corresponding to the target argument fragment includes: comparing the event type in the head event type set with the event type in the tail event type set; and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment.

In some embodiments, the filtering of the target event type matching the target argument role from the initial set of event types includes: acquiring a matching relation between a preset event type and argument roles; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as a target event type.

A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps of: acquiring a target text to be subjected to event extraction; inputting the target text into an event extraction joint model for processing to obtain event type identification probability and argument role identification probability corresponding to each target word segmentation in the target text; identifying and obtaining a target argument role corresponding to the target word segmentation according to the argument role identification probability; identifying according to the event type identification probability to obtain an initial event type set; and screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

In some embodiments, the event extraction joint model includes a text coding model, an event type identification model, and a argument role identification model, and the inputting the target text into the event extraction joint model for processing to obtain an event type identification probability and an argument role identification probability corresponding to each target word in the target text includes: inputting the target text into the text coding model, and coding each target participle corresponding to the target text by the text coding model to obtain a participle coding vector corresponding to each target participle; inputting the word segmentation coding vectors corresponding to the target word segmentation into the event type identification model to obtain event type identification probabilities corresponding to the target word segmentation; and inputting the word segmentation coding vector corresponding to the target word segmentation into the argument role recognition model to obtain argument role recognition probability corresponding to each target word segmentation.

In some embodiments, the argument role recognition probability comprises a probability that the target participle is a head pointer of a candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the computer program further causing the processor to perform the steps of: if the probability that the target word segmentation is the head pointer of the candidate argument role is larger than a first threshold value, determining that the target word segmentation is the head pointer of the candidate argument role; if the probability that the target word segmentation is the tail pointer of the candidate argument role is larger than a second threshold value, determining that the target word segmentation is the tail pointer of the candidate argument role; and determining a target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

In some embodiments, the event type identification probability includes a probability that the target word segmentation is a head pointer of a candidate event type and a probability that the target word segmentation is a tail pointer of the candidate event type, and the identifying an initial event type set according to the event type identification probability includes: acquiring a head event type set corresponding to a head pointer corresponding to a starting point of the target argument segment according to the probability that the target word segmentation is the head pointer of the candidate event type; acquiring a tail event type set corresponding to a tail pointer corresponding to a terminating point of the target argument segment according to the probability that the target participle is the tail pointer of the candidate event type; and determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

In some embodiments, the obtaining, according to the probability that the target word segmentation is the head pointer of the candidate event type, the head event type set corresponding to the head pointer corresponding to the starting point of the target argument fragment includes: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from the starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

In some embodiments, the obtaining, according to the probability that the target participle is a tail pointer of a candidate event type, a tail event type set corresponding to a tail pointer corresponding to a termination point of the target argument fragment includes: if the probability that the target participle is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target participle is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type taking the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

In some embodiments, the determining, according to the head event type set and the tail event type set, an initial event type set corresponding to the target argument fragment includes: comparing the event type in the head event type set with the event type in the tail event type set; and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment.

In some embodiments, the filtering of the target event type matching the target argument role from the initial set of event types includes: acquiring a matching relation between a preset event type and argument roles; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as a target event type.

According to the event extraction method, the event extraction device, the computer equipment and the storage medium, the event type identification probability and the argument role identification probability which are respectively corresponding to each target participle in the target text can be obtained based on the event extraction joint model, and then the target argument role corresponding to the target participle is obtained based on the argument role identification probability, so that the corresponding argument role can be accurately obtained, the event type identification probability and the argument role identification probability are jointly obtained, when the target argument role corresponding to the target participle is determined, the target event type is obtained from the initial event type set obtained based on the event type identification probability in combination with the target argument role, the accuracy of obtaining the target event type can be improved, and the accuracy of the event extraction result is improved.

Drawings

FIG. 1 is a diagram of an application environment of a method for event extraction in one embodiment;

FIG. 2 is a flow diagram illustrating a method for event extraction in one embodiment;

FIG. 3 is a flowchart illustrating an example of an event in which a target text is input into an event extraction combination model and processed to obtain event type identification probabilities and argument role identification probabilities corresponding to respective target participles in the target text;

FIG. 4 is a flowchart illustrating an example of identifying an initial set of event types according to event type identification probabilities;

FIG. 5A is a schematic diagram illustrating an example of an identification principle for obtaining an event type identification model;

FIG. 5B is a schematic diagram illustrating an identification principle of the argument character identification model obtained in one embodiment;

FIG. 6 is a block diagram showing the structure of an event extraction device according to an embodiment;

FIG. 7 is a block diagram showing the structure of an event processing module in one embodiment;

FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The event extraction method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may receive a text editing operation of a user to obtain a target text, the terminal 102 uploads the target text to the server 104, and the server 104 executes the event extraction method provided by the embodiment of the present application to obtain an event extraction result. The server may build a knowledge base based on the event extraction results. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.

In some embodiments, after the event extraction result is obtained, each piece of information of the event extraction result may be stored correspondingly, for example, a knowledge graph may be established, and when a search request is received, a search may be performed in the knowledge graph according to a search term in the search request to obtain a search result, and the search result is returned to a terminal corresponding to the search request.

In one embodiment, as shown in fig. 2, an event extraction method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:

step S202, a target text to be subjected to event extraction is obtained.

An event may refer to an occurrence or a change of state of one or more actions within a certain geographical range at a certain time. Event extraction can be realized by presenting event trigger words and event arguments in a structured form from unstructured texts containing event information. The event extraction mainly comprises two tasks of event detection and classification (also called event identification) and event argument role extraction (also called event element identification). For the detection and classification of events, candidate event types to be extracted may be given in advance, for example, candidate event types may include attack events, litigation events, and conference events. Event argument (Event argument) is the various elements of an Event and may include an entity description, a temporal expression, and attribute values. The roles included in a class of events are predefined, and the event arguments may differ in a particular event instance. Event argument role extraction is the argument of the detected event and assigns the corresponding role in the event. For example, an event argument role (role) of an attack event may be an attacker or an attacker. The target text may be chinese text.

For example, assuming that an "attack" event is defined as one of the candidate event types, for the natural language text "a is injured in an attack event that occurs at site B," the task of event extraction may be to identify the trigger word "attack," meaning that the expressed event type is "attack," and to identify the role that the event argument "a" serves in this attack event as "victim," and the role that site B "serves in this attack event as" site.

Specifically, the server responds to an event extraction instruction to acquire a target text. For example, the server may receive an instruction to perform event extraction on news on a certain news website, and obtain a title of the news or an abstract of the news on the news website as text to be subjected to event extraction.

And step S204, inputting the target text into the event extraction joint model for processing to obtain the event type identification probability and the argument role identification probability corresponding to each target word segmentation in the target text.

The event extraction joint model is a model for extracting events, and the event extraction joint model can be a neural network model. The event extraction joint model can comprise an encoding model and a decoding model, and the decoding model can further comprise an event type identification model and an argument role identification model. The coding model is used for coding the text to obtain a coding vector, and the event type recognition model and the argument role recognition model respectively obtain the vector obtained by coding to decode.

The target participle refers to a word obtained by participling a target text, the participle is a process of recombining continuous word sequences into word sequences according to a certain specification, the participle method can be at least one of a word segmentation method based on character string matching, a word segmentation method based on understanding or a word segmentation method based on statistics, for example, if the target text is "a is injured in an attack event occurring at a site B", the word sequence obtained after the participle can be represented as "a/at/B site/occurrence/attack event/middle/injured/", wherein "a" and "at" are the target participle.

Specifically, the server may input the target text into the event extraction joint model, and the event extraction joint model is based on the coding model, fuses context information in the target text, and codes each target participle in the target text to obtain a participle coding vector corresponding to each target participle. And the server inputs a word segmentation coding vector sequence consisting of the word segmentation coding vectors corresponding to the target word segmentation into the event type identification model to obtain the event type identification probability corresponding to each target word segmentation. And the server inputs a participle coding vector sequence consisting of participle coding vectors corresponding to the target participles into the argument role recognition model to obtain argument role recognition probabilities corresponding to the target participles. For example, the probability that the target participle C is the argument role of each candidate and the probability that the target participle C is the event type of each candidate may be obtained.

And S206, identifying and obtaining the target argument roles corresponding to the target word segmentation according to the argument role identification probability.

Specifically, the argument role with the maximum argument role identification probability may be used as the target argument role corresponding to the target participle, or the argument role with the identification probability of the corresponding argument role greater than a preset probability threshold may be used as the target argument role corresponding to the target participle. For example, there may be a plurality of candidate argument roles, the probability that the target participle belongs to each candidate argument role can be obtained, and the candidate argument role having the corresponding argument role recognition probability greater than the preset probability threshold is used as the target argument role corresponding to the target participle. For example, assume that there are 3 argument roles for the candidate: j1, J2 and J3, the probability that the target participle C is the candidate argument role J1 is 0.05, the probability that the target participle C is the candidate argument role J2 is 0.15, the probability that the target participle C is the candidate argument role J3 is 0.8, the probability threshold value is 0.7, and the probability 0.8 of the candidate argument role J3 is greater than the probability threshold value 0.7, so that the target argument role of the target participle C is J3.

And S208, identifying according to the event type identification probability to obtain an initial event type set.

Specifically, the initial event type is an event type obtained by preliminary screening. The server can select a plurality of initial event types according to the event type identification probability to form an event type set, wherein the plurality refers to at least two. The server may use the event type meeting the filtering condition as an initial event type corresponding to the target word segmentation. The screening condition comprises at least one of the event type identification probability being greater than a preset probability threshold or the event type identification probability being ordered before the preset ordering, and the event type identification probability is ordered from large to small. For example, assuming that there are 8 candidate event types, the event type with the probability of 5 in the event type identification probability may be obtained as the event type obtained by the preliminary screening.

And step S210, screening the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

Specifically, since the target argument role has been obtained, the server can acquire a type matching the target argument role as the target event type. The event extraction result can include a target argument role and a target event type.

In some embodiments, the server may obtain a matching relationship between a preset event type and a argument role; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as the target event type.

Specifically, the matching relationship between the event type of each candidate and the argument role of the candidate may be set in advance. For example, argument roles corresponding to the set attack event types include an attacker and a victim. Therefore, when the target argument role is obtained, the event type matched with the target argument role in the initial event type set can be used as the target event type. For example, if the target argument role is obtained as an attacker, and the initial event type set includes an attack event and a litigation event, the event type matched by the attacker is the attack event, that is, the target event type is the attack event.

In the event extraction method, because the event type identification probability and the argument role identification probability respectively corresponding to each target participle in the target text can be obtained based on the event extraction combined model, and the target argument role corresponding to the target participle is obtained based on the argument role identification probability, the corresponding argument role can be accurately obtained, and the event type identification probability and the argument role identification probability are obtained jointly.

In one embodiment, as shown in fig. 3, the event extraction joint model includes a text coding model, an event type identification model, and an argument role identification model, and step S204 is to input the target text into the event extraction joint model for processing, so as to obtain the event type identification probability and the argument role identification probability corresponding to each target participle in the target text, where the event type identification probability and the argument role identification probability respectively include:

step S302, inputting the target text into a text coding model, and coding each target word segmentation corresponding to the target text by the text coding model to obtain word segmentation coding vectors corresponding to each target word segmentation.

The text encoding model is used for encoding text, and may be a pre-trained bert (bidirectional Encoder retrieval from transforms) encoding model. For example, the open source pre-training model Roberta-WWM-ext-large for Chinese optimization can be used. The model is developed and improved on the basis of BERT, Whole Word Masking (Whole Word Masking) is introduced, and the problem that learning difficulty of a mask language model is reduced due to fixed matching of words in a Chinese context is avoided. Meanwhile, longer corpora are added, and a Next Sentence Prediction (Next Prediction) training task is deleted.

The text coding model codes each target word segmentation corresponding to the target text,and obtaining the word segmentation coding vector corresponding to each target word segmentation. For example, an input Chinese sentence includes N participles (x)0,x1,…xN) Coding model from (x)0,x1,…xN) Extracts feature and outputs expression (x ') including context information'0,x′1,…x′N) To facilitate use by subsequent downstream tasks. As an actual example, assuming that there are 10 target participles in a target text, the encoding vector corresponding to each target participle in the 10 target participles may be output, that is, 10 participle encoding vectors are output.

Step S304, the segmentation code vectors corresponding to the target segmentation are input into the event type identification model, and the event type identification probability corresponding to each target segmentation is obtained.

Specifically, the server may combine the segmentation coding vectors corresponding to the target segmentation into a segmentation coding vector sequence according to the sequence of the target segmentation, and input the segmentation coding vector sequence into the event type identification model to obtain the probability that each target segmentation belongs to each event type, that is, the event type identification probability.

Step S306, the word segmentation coding vectors corresponding to the target word segmentation are input into the argument role recognition model, and argument role recognition probabilities corresponding to the target word segmentation are obtained.

Specifically, the server may combine the participle code vectors corresponding to the target participles into a participle code vector sequence according to the sequence of the target participles, and input the participle code vector sequence into the argument role identification model to obtain the probability that each target participle belongs to each argument role, that is, the argument role identification probability.

In the embodiment of the application, the argument role recognition model and the event type recognition model share a text coding model. And the probabilities to be obtained by the text coding vectors are obtained respectively based on the text coding vectors, so that the relevance of the subtasks can be reflected, and the effect of the subtasks is mutually improved. This avoids staging, which would result in upstream errors being passed on to downstream tasks, error propagation, and the fact that the dependencies of the subtasks are not reflected. Namely, the model in the embodiment of the application is an event extraction model based on a joint framework, the event type is also used as a label of an event argument, the same event argument corresponds to two-level labels of argument role and event type, and the argument role and the event type are simultaneously obtained by adopting the joint extraction model

In some embodiments, the text encoding model, the event type recognition model, and the argument role recognition model are jointly trained. During model training, model parameters of the argument role recognition model can be adjusted based on loss values corresponding to the argument role recognition model, and model parameters of the event type recognition model are adjusted based on loss values corresponding to the event type recognition model. In the adjustment of the text coding model, a first parameter descending gradient can be calculated according to a loss value corresponding to the argument character recognition model, a second parameter descending gradient can be calculated according to a loss value corresponding to the event type recognition model, the sum of the first parameter descending gradient and the second parameter descending gradient is used as a descending gradient of the model parameter of the text coding model, and the model parameter of the text coding model is adjusted according to the descending gradient, so that the parameter of the text model is adjusted towards the direction of improving the recognition accuracy of the event type recognition model and the recognition accuracy of the argument character recognition model, and the accuracy of the vector coded by the text coding model is improved.

In some embodiments, the model loss value may be calculated using equation (1).

Wherein gamma in formula 5 is a hyperparameter,andrespectively representing the probability of a negative example and the probability of a positive example, K is the number of positive example samples, L is the number of negative example samples, and m is the similarity of the positive example and the similarity of the negative exampleDistance between degrees, LuniRepresenting the model loss value.

In some embodiments, the model Loss values may be calculated using Circle Loss, which provides a uniform view to unify traditional triple Loss, CE Loss, and other variants. The triple Loss is a Loss function in deep learning and is used for training samples with small differences, such as human faces and the like, Feed data comprises Anchor (Anchor) examples, Positive (Positive) examples and Negative (Negative) examples, and similarity calculation of the samples is achieved by optimizing that the distance between the Anchor examples and the Positive examples is smaller than the distance between the Anchor examples and the Negative examples. The Circle Loss optimization target is further pushed to a larger inter-class distance and a smaller inner distance from a hyperplane for constructing a separated space, and forms a similar circular distribution on the space constructed by the probability of positive samples and negative samples, wherein L iscircleRepresenting the model loss value, gamma in formula 2 is a hyperparameter,andrespectively representing the probability of a negative example and a positive example, K is the number of positive example samples, L is the number of negative example samples, m is the distance between the similarity of the positive example and the similarity of the negative example,andmay be preset weight coefficients.

The Circle Loss is mainly used for distinguishing the difference between the positive case similarity and the negative case similarity, so that the probability that one sample belongs to the class of the sample is as large as possible, the distribution of the positive and negative samples can not be concerned, and the problem of sample imbalance can be relieved by adopting the Circle Loss.

In some embodiments, the argument role recognition probability includes a probability that the target participle is a head pointer of the candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, and the event extraction method further includes: if the probability that the target word segmentation is the head pointer of the candidate argument role is larger than a first threshold value, determining that the target word segmentation is the head pointer of the candidate argument role; if the probability that the target word segmentation is the tail pointer of the candidate argument role is larger than a second threshold value, determining that the target word segmentation is the tail pointer of the candidate argument role; and determining a target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

The argument role recognition model is a Pointer Network (Pointer Network) based on Machine Reading understanding (MRC), and the argument roles are classified respectively according to the probability of outputting head pointers and the probability of outputting tail pointers, and the first threshold and the second threshold may be set as required, for example, may be 0.8. For a candidate argument role, if the probability that the target participle is the head pointer of the argument role is greater than a first threshold, the target participle is the head pointer of the candidate argument role, and for the candidate argument role, if the probability that the target participle is the tail pointer of the argument role is greater than a second threshold, the target participle is the tail pointer of the candidate argument role. When a candidate argument role corresponds to a head pointer and a tail pointer, the text from the head pointer to the tail pointer can be an argument segment of the candidate argument role, and meanwhile, the candidate argument role is an argument role existing in the target text, namely, a target argument role. It will be appreciated that for a candidate argument role, if there are no target participles greater than a first threshold or no target participles greater than a second threshold, then it can be confirmed that the candidate argument role is not an argument role present in the target text.

In some embodiments, as shown in fig. 4, the event type identification probability includes a probability that the target participle is a head pointer of the candidate event type and a probability that the target participle is a tail pointer of the candidate event type, and identifying the initial event type set according to the event type identification probability includes:

step S402, according to the probability that the target word segmentation is the head pointer of the candidate event type, a head event type set corresponding to the head pointer corresponding to the starting point of the target argument fragment is obtained.

The event type recognition model is a Pointer Network (Pointer Network) based on Machine Reading Comprehension (MRC), and the probability of a head Pointer and the probability of a tail Pointer are output for event type line classification. The head event type set includes one or more head events corresponding to the head pointer. For example, the candidate event type with the probability greater than the third threshold among the probabilities of the target participle being the head pointers of the candidate event types may be added to the set of head event types. The starting point of the target argument segment is the first participle of the target argument segment, and the head event type set corresponding to the head pointer corresponding to the starting point may be a candidate event type corresponding to a participle having a distance from the starting point smaller than the first distance when the participle is the head pointer.

In some embodiments, obtaining a set of head event types corresponding to a head pointer corresponding to a starting point of a target argument fragment according to a probability that a target participle is a head pointer of a candidate event type includes: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from a starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

The third threshold may be set as needed, and may be 0.8, for example. For a target participle C, if the probability that the participle is the tail pointer of the A candidate event type is 0.9, determining that the probability that the target participle is the A candidate event type is greater than a third threshold value, and determining that the target participle C is the head pointer of the A candidate event type.

The first distance may be set as desired, for example, two segmentations may be spaced. For example, for the target text "a/at/B location/occurred/attack event/middle/injury/", assuming the starting point is "occurred" the first distance is 2 tokens. The first adjacent participle includes "B location", "occurrence", and "of". If the "B location" is the head pointer of a candidate event type, then the candidate event type is added to the set of head event types.

Step S404, according to the probability that the target word segmentation is the tail pointer of the candidate event type, a tail event type set corresponding to the tail pointer corresponding to the terminating point of the target argument segment is obtained.

The tail event type set includes one or more event types corresponding to the tail pointer. For example, of the probabilities that the target participle is a tail pointer of the candidate event type, the candidate event type with the probability greater than the fourth threshold may be added to the tail event type set. The termination point of the target argument segment is the last participle of the target argument segment, and the tail event type set corresponding to the tail pointer corresponding to the termination point may be a candidate event type corresponding to a participle whose distance from the termination point is less than the second distance when the participle is the tail pointer.

In some embodiments, obtaining a tail event type set corresponding to a tail pointer corresponding to a termination point of a target argument segment according to a probability that a target participle is a tail pointer of a candidate event type includes: if the probability that the target word segmentation is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target word segmentation is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type with the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

The fourth threshold may be set as needed, and may be 0.8, for example. For a target participle C, if the probability that the participle is the tail pointer of the G candidate event type is 0.9, the probability that the target participle is the A candidate event type is determined to be larger than a fourth threshold value, and the target participle C is determined to be the tail pointer of the G candidate event type.

The second distance may be set as desired, for example, three segmentations may be spaced. For example, corresponding to "a/at/B site/occurred/hit/mid/injury/", assuming the termination point is "injury", the first distance is 2 tokens. The second adjacent participle includes "attack event", "middle", and "injury".

If the attack event is the tail pointer of a candidate event type, the candidate event type is added into the tail event type set.

Step S406, determining an initial event type set corresponding to the target argument fragment according to the head event type set and the tail event type set.

Specifically, the event types in the head event type set may be compared with the event types in the tail event type set; and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment. For example, assume that the set of head event types includes three candidate event types: a1, a2 and a3, the tail event type set includes three candidate event types: a1, a3 and a4, then by comparison, it can be determined that the same candidate event types in the head event type set and the tail event type set include a1 and a3, and the initial event type set includes a1 and a 3.

In some embodiments, for one text, the number of head pointers and tail pointers output by the argument role recognition model can be obtained, and the number is more than that to determine the argument role and the argument fragment. For example, if the number of head pointers is greater than the number of tail pointers, the head pointers are selected as the starting points of the argument segments, and the argument roles can be determined. And selecting a tail pointer behind the initial point by the end point of the argument segment, and further determining the argument segment. Then, for the event type identification model, first, head pointers in two participles separated from the initial point of the argument segment can be found, candidate event types corresponding to the head pointers are obtained, a first event type set is determined, then tail pointers in two participles separated from the end point of the argument segment are found, candidate event types corresponding to the tail pointers are obtained, a second event type set is determined, and the intersection of the two sets is taken as an initial event type set of the argument segment. And then filtering out the event types which are not matched with the argument roles in the candidate event type set according to the predefined event types and the corresponding argument roles. And finally, determining the argument roles and the event types corresponding to the argument fragments.

In the embodiment of the application, the problem of argument role overlapping is solved by respectively carrying out two classification on the event type and the event argument and outputting the head pointer and the tail pointer, and meanwhile, multi-segment and multi-class extraction can be carried out. For example, mapping from participle (Token) features to argument fragments, event types, and argument roles can be implemented based on a pointer network for machine-read understanding (MRC). For each Token, each event type and argument role of the Token respectively correspond to a head output result and a tail output result, and the head output result and the tail output result represent whether the Token is a starting point and an ending point of the event type corresponding to the argument or not, and the starting point and the ending point of the argument role. The output layer scheme can conveniently process nesting conditions between argument roles and event types. For example, the event type recognition probability and the argument character recognition probability can be calculated by equations (3) to (6),

wherein x'iThe Token is a characteristic representation of Token, t is an event type, r is an argument role, s is a starting point of an argument fragment, e is an end point of the argument fragment, and sigma is a sigmoid function.Indicates the probability that the ith Token, belongs to the jth event type and is the head pointer,indicates the probability that the ith Token, belongs to the jth event type and is a tail pointer,representing the probability that the ith Token, belongs to the jth argument role and is the head pointer,represents the probability that the ith Token belongs to the jth argument role and is the tail pointer. Wherein the range of probability is [0,1 ]]When the value is greater than a certain threshold, for example 0.8, the value is reassigned to 1, otherwise it is 0.The value after assignment is 1, which indicates that the target participle is the head pointer of the jth event type.The value after assignment is 1, which indicates that the target participle is the tail pointer of the jth event type.The value is 1 after assignment, the head pointer of the jth argument role of the target participle is represented,and the value after assignment is 1, and the target participle is represented as a tail pointer of the jth argument role.

For example, for the target text "8 months and 21 days, world badminton tournament" held in basel, switzerland, the results obtained can be as shown in fig. 5A and 5B. The method comprises the steps that a Shared Bert represents an Event Type identification model and an argument character identification model share a text coding model, a Role Extractor represents the argument character identification model, and an Event Type Extractor represents the Event Type identification model.

The event extraction result provided by the embodiment of the application can be applied to the artificial intelligence fields of knowledge base construction, intelligent wind control, intelligent investment and research, public opinion monitoring and the like.

It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in a strict order unless explicitly stated herein, and may be performed in other orders. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.

In one embodiment, as shown in fig. 6, there is provided an event extraction device including: a target text obtaining module 602, a processing module 604, an argument role obtaining module 606, an initial event type set obtaining module 608, and an event extraction result obtaining module 610, wherein:

a target text obtaining module 602, configured to obtain a target text to be subjected to event extraction;

the processing module 604 is configured to input the target text into the event extraction joint model for processing, so as to obtain event type identification probabilities and argument role identification probabilities corresponding to the target word segments in the target text;

an argument role obtaining module 606, configured to identify and obtain a target argument role corresponding to the target participle according to the argument role identification probability;

an initial event type set obtaining module 608, configured to obtain an initial event type set according to event type identification probability identification;

and an event extraction result obtaining module 610, configured to screen the initial event type set to obtain a target event type matched with the target argument role, so as to obtain an event extraction result corresponding to the target text according to the target argument role and the target event type.

In some embodiments, as shown in fig. 7, the event extraction joint model includes a text coding model, an event type recognition model, and a argument role recognition model, and the processing module 604 includes:

a word segmentation coding vector obtaining unit 702, configured to input the target text into a text coding model, where the text coding model codes each target word segmentation corresponding to the target text to obtain a word segmentation coding vector corresponding to each target word segmentation;

an event type identification probability obtaining unit 704, configured to input the segmentation coding vectors corresponding to the target segmentation into an event type identification model, so as to obtain event type identification probabilities corresponding to the target segmentation;

an argument role recognition probability obtaining unit 706, configured to input the participle coding vector corresponding to the target participle into the argument role recognition model, so as to obtain argument role recognition probabilities corresponding to the target participles respectively.

In some embodiments, the argument role recognition probability comprises a probability that the target participle is a head pointer of the candidate argument role and a probability that the target participle is a tail pointer of the candidate argument role, the apparatus further comprising: the head pointer determining module is used for determining the target word segmentation as the head pointer of the candidate argument role if the probability that the target word segmentation is the head pointer of the candidate argument role is greater than a first threshold value; the tail pointer determining module is used for determining that the target word segmentation is the tail pointer of the candidate argument role if the probability that the target word segmentation is the tail pointer of the candidate argument role is greater than a second threshold value; and the target argument fragment determining module is used for determining the target argument fragment according to the head pointer of the candidate argument role and the tail pointer of the candidate argument role.

In some embodiments, the event type recognition probability includes a probability that the target participle is a head pointer of the candidate event type and a probability that the target participle is a tail pointer of the candidate event type, and the initial event type set obtaining module includes: the head event type set acquisition unit is used for acquiring a head event type set corresponding to a head pointer corresponding to a starting point of the target argument segment according to the probability that the target word segmentation is the head pointer of the candidate event type; a tail event type set acquisition unit, configured to acquire a tail event type set corresponding to a tail pointer corresponding to a termination point of a target argument segment according to a probability that a target participle is a tail pointer of a candidate event type; and the initial event type set determining unit is used for determining an initial event type set corresponding to the target theoretic element segment according to the head event type set and the tail event type set.

In some embodiments, the head event type set acquisition unit is configured to: if the probability that the target word segmentation is the head pointer of the candidate event type is larger than a third threshold value, determining that the target word segmentation is the head pointer of the candidate event type; determining a target participle with a distance smaller than a first distance from a starting point of the target argument fragment as a first adjacent participle; and taking the candidate event type taking the first adjacent participle as a head pointer as a head event type to obtain a head event type set.

In some embodiments, the tail event type set acquisition unit is to: if the probability that the target word segmentation is the tail pointer of the candidate event type is larger than a fourth threshold value, determining that the target word segmentation is the tail pointer of the candidate event type; determining a target participle with a distance smaller than a second distance from the terminal point of the target argument segment as a second adjacent participle; and taking the candidate event type with the second adjacent participle as a tail pointer as a tail event type to obtain a tail event type set.

In some embodiments, the initial event type set determination unit is to: comparing the event type in the head event type set with the event type in the tail event type set; and taking the event types which are consistent in comparison as initial event types to obtain an initial event type set corresponding to the target argument fragment.

In some embodiments, the event extraction result obtaining module is configured to: acquiring a matching relation between a preset event type and a theory element role; and according to the matching relation between the event type and the argument role, taking the event type matched with the target argument role in the initial event type set as the target event type.

For the specific definition of the event extraction device, reference may be made to the above definition of the event extraction method, which is not described herein again. The modules in the event extraction device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor calls and executes operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing event extraction data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an event extraction method.

Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described event extraction method when executing the computer program.

In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned event extraction method.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example.

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于用户会话分析的情绪识别方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!