Method, device, equipment, and medium for event extraction and extraction model training

By using a multi-layer label pointer network and a bidirectional encoder representation sub-layer in the event extraction model, the event elements in the natural language text and their types and roles are directly determined, which solves the problems of poor extraction effect and high training difficulty in the existing technology. problem, achieving more efficient event extraction and model training.

CN114586038BActive Publication Date: 2024-08-27BOE TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202080002135.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-08-27
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

Existing event extraction technology does not have ideal extraction effects, and has problems such as cascading errors and difficulty in training convergence.

Method used

An extraction model including a classification layer and an output layer is used to directly determine the event elements and their corresponding event types and roles by classifying the character attributes of the natural language text, avoiding the task of trigger word recognition and event recognition and role classification. The task is disjointed, and the transformer-based bidirectional encoder representation sub-layer and part-of-speech embedding sub-layer are used in the encoding layer, combined with the start binary classification network, the termination binary classification network and multiple label binary classification networks to achieve accurate event elements definition.

Benefits of technology

It improves the accuracy of event extraction and model training convergence, avoids cascading errors, and enhances the ability to identify event elements and roles, especially when dealing with overlapping event elements and overlapping roles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114586038B
    Figure CN114586038B
Patent Text Reader

Abstract

The event extraction method provided by the present disclosure includes: processing an object text with a preset extraction model to determine event information of the object text; wherein the event information includes event elements, and event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer; the classification layer is configured to determine character attributes of characters of the object text; the character attributes include whether the character is the starting character of the event element of each event type and each role, and whether the character is the ending character of the event element of each event type and each role; the output layer is configured to determine the event element according to the character attributes of the character, and determine the event type and role corresponding to the event element.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of artificial intelligence technology, and in particular to a method and device for event extraction and extraction model training, an electronic device, and a computer-readable medium. Background Art

[0002] Event extraction (EE) refers to the technology of determining the "event" described in the text and the relevant information of the event based on the text of natural language. Event extraction has important applications in the fields of intelligent risk control, intelligent investment research, public opinion monitoring, event mapping, etc.

[0003] However, the extraction effects of existing event extraction technologies are often not ideal. Summary of the invention

[0004] The embodiments of the present disclosure provide a method and device for event extraction and extraction model training, an electronic device, and a computer-readable medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for event extraction, which includes:

[0006] Process the object text using a preset extraction model to determine the event information of the object text;

[0007] The event information includes event elements, and event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer;

[0008] The classification layer is configured to determine character attributes of characters of the object text; the character attributes include whether the character is a starting character of an event element for each event type and each role, and whether the character is a terminal character of an event element for each event type and each role;

[0009] The output layer is configured to determine an event element according to the character attributes of the character, and determine an event type and a role corresponding to the event element.

[0010] In some embodiments, the extraction model further comprises an encoding layer;

[0011] The encoding layer is configured to encode the object text and input the encoding result to the classification layer.

[0012] In some embodiments, the encoding layer comprises a transformer-based bidirectional encoder representation sublayer.

[0013] In some embodiments, the encoding layer further includes a part-of-speech embedding sublayer; an output of the part-of-speech embedding sublayer and an output of the transformer-based bidirectional encoder representation sublayer are concatenated as the encoding result.

[0014] In some embodiments, the encoding layer further includes a bidirectional long short-term memory sublayer, and the output of the converter-based bidirectional encoder representation sublayer is the encoding result after passing through the bidirectional long short-term memory sublayer.

[0015] In some embodiments, the classification layer includes a starting binary classification network, a terminating binary classification network, and a plurality of label binary classification networks;

[0016] The starting binary classification network is configured to determine whether the characters of the object text are the starting characters of the event element; the ending binary classification network is configured to determine whether the characters of the object text are the ending characters of the event element; each of the label binary classification networks corresponds to a predetermined label, and is configured to determine whether the characters of the object text conform to the predetermined label, the predetermined label includes a predetermined event type and a predetermined role, and at least one of the predetermined event type and the predetermined role in the predetermined labels corresponding to any two different label binary classification networks is different;

[0017] The method of determining the event element according to the character attributes of the character, and determining the event type and role corresponding to the event element includes: determining the event element according to the starting character and the ending character, and determining a predetermined tag corresponding to the event element according to the predetermined tags of at least part of the characters of the event element, and determining a predetermined event type and a predetermined role corresponding to the predetermined tag of the event element.

[0018] In some embodiments, the determining whether the characters of the object text are the starting characters of the event element comprises: determining whether each character of the object text is the starting character of the event element one by one;

[0019] The determining whether the character of the object text is the termination character of the event element comprises: determining one by one whether each character of the object text is the termination character of the event element.

[0020] In some embodiments, determining the event element according to the start character and the end character includes: determining the start character and the end character that are closest to each other as a group, and determining the characters between the start character and the end character in the same group as an event element.

[0021] In some embodiments, determining whether the characters of the object text conform to the predetermined label comprises:

[0022] It is only determined whether each of the start characters and each of the end characters of the object text conforms to the predetermined label.

[0023] In some embodiments, determining the predetermined label corresponding to the event element according to the predetermined labels of at least part of the characters of the event element comprises:

[0024] It is determined that the predetermined label that the start character and the end character of the event element both conform to is the predetermined label of the event element.

[0025] In some embodiments, the extraction model further includes an event extraction layer; the event extraction layer is configured to determine the type probability of each event type; the type probability of an event type represents the relevance of the object text with the event type;

[0026] Determining the character attributes of the characters of the object text includes:

[0027] Determine an initial probability that a character of the object text is a starting character of an event element of a role of an event type; determine whether the character is a starting character of an event element of the event type and the role based on the initial probability and the type probability of the event type;

[0028] Determine the initial probability that a character of the object text is a terminal character of an event element of a role of an event type; and determine whether the character is a terminal character of the event element of the event type and the role based on the initial probability and the type probability of the event type.

[0029] In some embodiments, determining the character attributes of the characters of the object text includes:

[0030] For the characters of the object text, it is determined independently whether they are the starting characters of the event elements of each event type and each role, and whether they are the ending characters of the event elements of each event type and each role.

[0031] In some embodiments, determining the event type and role corresponding to the event element includes:

[0032] In response to the situation that multiple event elements correspond to the same event type and the same role, based on the confidence that each event element in the multiple event elements corresponds to the event type and the role, it is determined that the event element with the highest confidence corresponds to the event type and the role.

[0033] In a second aspect, the present disclosure provides a method for extracting model training, which includes:

[0034] Determine the initial model;

[0035] Training the initial model with multiple training samples to obtain the extraction model;

[0036] Wherein, the extraction model is configured to process the object text to determine the event information of the object text; wherein, the event information includes event elements, and the event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer; the classification layer is configured to determine the character attributes of the characters of the object text; the character attributes include whether the character is the starting character of the event element of each event type and each role, and whether the character is the ending character of the event element of each event type and each role; the output layer is configured to determine the event element according to the character attributes of the character, and determine the event type and role corresponding to the event element.

[0037] In some embodiments, the training of the initial model using a plurality of training samples to obtain the extraction model comprises:

[0038] The initial model is adversarially trained using multiple training samples to obtain the extraction model.

[0039] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising:

[0040] one or more processors;

[0041] A memory having one or more computer programs stored thereon:

[0042] One or more I / O interfaces, connected between the processor and the memory, and configured to implement information exchange between the processor and the memory;

[0043] When the one or more computer programs are executed by the one or more processors, any of the above event extraction methods can be implemented.

[0044] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising:

[0045] one or more processors;

[0046] A memory having one or more computer programs stored thereon:

[0047] One or more I / O interfaces, connected between the processor and the memory, and configured to implement information exchange between the processor and the memory;

[0048] When the one or more computer programs are executed by the one or more processors, any one of the above extraction model training methods can be implemented.

[0049] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements any one of the above event extraction methods when executed by a processor.

[0050] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the computer program implements any one of the above extraction model training methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:

[0052] Figure 1 A flowchart of a method for event extraction provided by an embodiment of the present disclosure;

[0053] Figure 2 A schematic diagram of the structure of an extraction model used in the event extraction method provided in an embodiment of the present disclosure;

[0054] Figure 3 A schematic diagram of classification results of a classification layer of an extraction model used in the event extraction method provided in an embodiment of the present disclosure;

[0055] Figure 4 A schematic diagram of the structure of another extraction model used in the event extraction method provided in an embodiment of the present disclosure;

[0056] Figure 5 A schematic diagram of a processing result of a double pointer network in another extraction model used in the event extraction method provided in an embodiment of the present disclosure;

[0057] Figure 6 A flowchart of a method for extracting model training provided in an embodiment of the present disclosure;

[0058] Figure 7 A block diagram of an electronic device provided in an embodiment of the present disclosure;

[0059] Figure 8 A block diagram of another electronic device provided by an embodiment of the present disclosure;

[0060] Fig. 9 A block diagram of a computer-readable medium provided for an embodiment of the present disclosure;

[0061] Fig.10 A block diagram of another computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0062] In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present disclosure, the event extraction and extraction model training methods and devices, electronic devices, and computer-readable media provided by the embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0063] The embodiments of the present disclosure will be described more fully below with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms and should not be construed as being limited to the embodiments set forth in the present disclosure. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0064] The embodiments of the present disclosure may be described with reference to plan views and / or cross-sectional views by way of ideal schematic diagrams of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.

[0065] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0066] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. The term "and / or" as used in the present disclosure includes any and all combinations of one or more related enumerated items. The singular forms "one" and "the" as used in the present disclosure are also intended to include plural forms, unless the context clearly indicates otherwise. The terms "including", "made of..." as used in the present disclosure specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0067] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0068] The embodiments of the present disclosure are not limited to the embodiments shown in the drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0069] Technical term explanation

[0070] In the embodiments of the present disclosure, unless otherwise specified, the following technical terms should be understood as follows:

[0071] Events refer to "things" of predetermined categories, such as "Player A scored a buzzer beater, Team B defeated Team C and advanced to the finals", "Conference E in City D closed at time F", "Country G established diplomatic relations with Country H", "Company I announced the launch of Product J", etc.

[0072] Event type refers to the "classification" of the pre-set "category" of the event. For example, event types may include "game action - win or lose", "game action - promotion", "organization action - opening", "organization action - closing", "war action - win or lose", "war action - start", "war action - end", etc.

[0073] It should be understood that the meanings of some of the above event types overlap, but they still belong to different event types. For example, "Match Action - Win or Lose" and "Match Action - Promotion" are both related to matches, but they are two different event types, because winning or losing a match does not necessarily lead to promotion (for example, there is only one match), and promotion in a match is not necessarily related to winning or losing (for example, a draw in the group stage may also lead to promotion).

[0074] It should be understood that, since the event type is pre-set, whether an "event" is regarded as an "event" in the embodiment of the present disclosure, and which event type it belongs to, are all related to the setting method of the event type. For example, if the event types such as "match behavior-win or lose" and "match behavior-advance" are not set, then although "Player A makes a buzzer beater, Team B defeats Team C and advances to the finals" is usually regarded as an "event" in reality, it is not regarded as an "event" in the embodiment of the present disclosure; for another example, for the event "Player A makes a buzzer beater, Team B defeats Team C and advances to the finals", if only the "match behavior-win or lose" event type is set, then the event only corresponds to the "match behavior-win or lose" event type, and if the "match behavior-advance" event type is also set, then the event also corresponds to the "match behavior-advance" event type.

[0075] Event elements, also called "arguments" of events, refer to predetermined "elements" related to events, which can be "participants" of events (such as the subject and object of events) or words that express event-related properties (such as adverbials of events). For example, event elements may include "Player A", "Team B", "Team C", "City D", "Time F", etc.

[0076] Roles refer to predetermined related content that may appear in different "positions" in an event. Usually, each role corresponds to an event element of the event, and each event element of the event is also a certain role in the event. For example, the "B team" above is the "winner" role and / or "promoter" role in the event, "C team" is the "loser" role in the event, "D city" is the "place" role in the event, "F time" is the "time" role in the event, etc.

[0077] It should be understood that "roles" are usually related to "event types", that is, different event types correspond to different roles. For example, corresponding to the "game behavior-win or lose" event type, there may be a "winner" role and a "loser" role, but there will not be a "promoter" role.

[0078] It should be understood that since the "role" is pre-set, which event elements are involved in an event and what roles these event elements are are all related to the way the roles are set. For example, for the event "Player A scored a buzzer beater, and Team B defeated Team C and advanced to the finals", for the "Game Behavior-Win or Lose" event type, if only the "Winner" role is set but not the "Loser" role, then "Team B" is an event element and the role is "Winner"; but "Team C" is no longer an event element (because it has no corresponding role).

[0079] It should be understood that not all preset roles and corresponding event elements corresponding to the event type are necessarily present in each event. For example, if the event type "Game Behavior - Win or Lose" also has a "Time" role, then for the event "Player A scores a buzzer beater, Team B defeats Team C and advances to the finals", there is no event element corresponding to the "Time" role.

[0080] Event extraction refers to the process of processing natural language text to determine the "event" described in the text, and to determine the event type to which the event belongs, the event elements involved in the event, and the event type and role corresponding to each event element (or what role in what event type).

[0081] A binary classification network is a type of intelligent classification network that is used to classify the object to be processed into one of two possible categories. It cannot be considered that the object belongs to two categories at the same time, nor can it be considered that the object does not meet the requirements of both categories.

[0082] Among them, the two categories corresponding to the binary classification network are often "mutually exclusive", that is, in the form of "conforming to a certain feature" and "not conforming to a certain feature", or in the form of "yes (such as represented by 1)" and "no (such as represented by 0)". Therefore, the binary classification network can usually calculate the probability that an object conforms to a certain feature (of course, the sum of the probability of conforming to the feature and the probability of not conforming to the feature is 1), and judge whether the object "conforms" to the feature based on whether the probability of conforming to the feature exceeds a predetermined value.

[0083] "Token" refers to the smallest independent unit that a text (object text) can be divided into according to natural language. For example, each character can be a Chinese character, an Arabic numeral, an English / French / German / Russian / Arabic / Latin letter, a punctuation mark (such as a comma, period, question mark, connector), etc. DETAILED DESCRIPTION

[0085] In some related technologies, the event extraction process may include four tasks: trigger word recognition, event type recognition, event element recognition, and role recognition.

[0086] Among them, trigger word recognition refers to identifying the "keywords" in the text that represent "events". Trigger words are usually verbs and usually have a certain relationship with the event type, such as victory, promotion, closing, etc.

[0087] Event type recognition is a word-based multi-classification task, which is used to determine the event type corresponding to each word in the text to determine the event type of the event in the text.

[0088] Event element recognition is the process of determining the event elements involved in an event in a text.

[0089] Role identification is a multi-classification task based on "word pairs", which forms "word pairs" of words corresponding to event elements in the text (such as entities) and words corresponding to event types (such as trigger words), and determines the role of the event elements in each "word pair" in the corresponding event type.

[0090] It can be seen that the above trigger word recognition and event type recognition are equivalent to determining "what events" in the text, so the two can constitute an "event recognition task". The above event element recognition and role recognition are equivalent to determining the role of each event element in the event (event of a specific event type), so the two can constitute a "role classification task".

[0091] In some related technologies, an extraction model with event recognition task and role classification task as pipeline approach can be used for event recognition. That is, the event recognition task is first performed on the text to determine the event type, and the event type is used as the input of the role classification task to further determine the event elements and corresponding roles. However, in the above-mentioned extraction model, the event recognition task and the role classification task are disconnected from each other (or they are two independent models). The error of the former will inevitably lead to the error of the latter (cascade error), and the latter cannot provide feedback to the former, which ultimately leads to poor effect of event extraction.

[0092] In some related technologies, an extraction model in which the event recognition task and the role classification task are a joint approach can also be used for event recognition. That is, the event recognition task and the role classification task are mutually related and feedback is provided, thereby avoiding cascading errors. However, in the above-mentioned extraction model, since the interaction between the event recognition task and the role classification task is "bidirectional", the change of the former will change the latter, and the change of the latter will change the former again. Such a cycle results in that the two parts of the extraction model are often difficult to reach the optimum at the same time during the training process, the training process is difficult to converge, and the effect of event extraction is not good.

[0093] In addition, in the above related technologies, since the correspondence between event elements and roles is performed in the form of "word pairs", it is not possible to properly handle events with "event element overlap" or "role overlap".

[0094] For example, in the event "Player A scored the winning goal, and Team B defeated Team C and advanced to the finals", the "Team B" event element is both the "Winner" role of the "Competition Behavior - Win or Lose" event type and the "Promoter" role of the "Competition Behavior - Advancement" event type. This situation is called "role overlap".

[0095] For another example, for the event "D City E Meeting closed at F time", the event element corresponding to the "Activity Name" role of the "Organizational Behavior-Closing" event type is "D City E Meeting", while the event element corresponding to the "Location" role is "D City", that is, the event elements corresponding to different roles are partially overlapping, and this situation is called "event element overlap".

[0096] In a first aspect, an embodiment of the present disclosure provides a method for event extraction.

[0097] Reference Figure 1 The method of the embodiment of the present disclosure is used to extract events from a natural language text, which includes:

[0098] S101. Process the object text using a preset extraction model to determine event information of the object text.

[0099] The event information includes event elements, and event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer;

[0100] The classification layer is configured to determine character attributes of characters of the object text; the character attributes include whether the character is a starting character of an event element for each event type and each role, and whether the character is a terminal character of an event element for each event type and each role;

[0101] The output layer is configured to determine the event element according to the character attributes of the character, and determine the event type and role corresponding to the event element.

[0102] In the disclosed embodiment, a preset extraction model is used to process the object text (ie, the natural language text for event extraction) to extract the event information therein.

[0103] There are various specific ways to obtain the object text, for example, the object text may be read from a specific storage medium (such as a hard disk), or the object text may be obtained through a network (local area network or the Internet).

[0104] The source of the object text may also be diverse. For example, the object text may be text within a specific range, such as text in a newspaper or a magazine; or the object text may be text collected from multiple sources in some way, such as text obtained through a search engine (such as text in hot spots, text searched within a specific time range, etc.), or text crawled by a web crawler, etc.

[0105] The event information includes the event type of the event described in the object text, the event elements involved in the event appearing in the object text, and the correspondence between the above event elements and the roles in the event type (ie, what event type and role the event element is).

[0106] Reference Figure 2 , the extraction model of the embodiment of the present disclosure includes a classification layer and an output layer.

[0107] Among them, the classification layer is used to determine the character attributes of the characters (Token) of the object text, that is, to determine whether the character is the starting character (first character) of the event elements of various event types and various roles, and whether it is the ending character (last character) of the event elements of various event types and various roles.

[0108] Therefore, the classification layer determines both which characters are "related" to each role of each event type, and also determines, when a character is "related" to a role of an event type, whether it is the first or last character of the corresponding event element.

[0109] It can be seen that the above classification layer is actually equivalent to "multi-classification" of characters (Token), that is, classifying characters into one or more of multiple possible categories, where each category can be the starting character or ending character of a specific event type and a specific role.

[0110] After obtaining the above character attributes, the output layer determines which characters in the object text correspond to event elements (that is, corresponding to at least one role of at least one event type) according to the character attributes of each character, as well as the specific event types and roles corresponding to these event elements, thereby completing event extraction.

[0111] It can be seen that according to the embodiment of the present disclosure, the extraction model directly determines the relationship between a single character in the object text and the event element, event type, and role, determines which characters correspond to the event element, and the event type and role corresponding to the event element, thereby completing the event extraction. However, in the above extraction process, no "trigger word" recognition is performed at all, and no "event recognition task" and "role classification task" are performed, so it is fundamentally different from the event recognition technology in the related art.

[0112] Therefore, no cascading errors will occur in the embodiments of the present disclosure, the extraction model is easy to train to achieve the best result, and the event extraction effect is good.

[0113] In some embodiments, the extraction model further includes an encoding layer; the encoding layer is configured to encode the object text and input the encoding result to the classification layer.

[0114] Reference Figure 4 In order to better obtain the semantic features of the object text, an encoding layer can also be set in the extraction model, which "encodes" the object text and then inputs the encoding into the classification network.

[0115] In some embodiments, the encoding layer includes a transformer-based bidirectional encoder representation sublayer.

[0116] As one embodiment of the present disclosure, the encoding layer includes a bidirectional encoder representation from transformer (BERT) sublayer.

[0117] Therefore, the extraction model of the embodiment of the present disclosure can be regarded as a "Multi-layer Label Pointer Net Based on BERT (BMPN)".

[0118] For example, the BERT sublayer first uses a tokenizer to tokenize the input object text to obtain a tokenized sequence X, and then encodes X into a word embedding matrix W t and a position embedding matrix W p , then add the two matrices (or vectors) together as the embedding representation vector h0, and then the embedding representation vector h0 passes through an L-layer transformer to obtain the output text semantic representation vector h L , the corresponding process is expressed as:

[0119] h0=XW t +W p ;

[0120] h i = Transformer(h i-1 ),i∈[1,L];

[0121] Among them, Transformer() means that the transformer processes the content in brackets; h i represents the output of the i-th layer of the converter, so when i is not L, h i is the output of the hidden layer of the converter, and h when i is L i That is, the text semantic representation vector h L , is the final output of the converter.

[0122] From the format point of view, the BERT sublayer can add a specific identifier (such as CLS) before the text input into it, and add a specific separator (such as SEP) at the end of the text.

[0123] In some embodiments, the encoding layer further includes a part-of-speech embedding sublayer; the output of the part-of-speech embedding sublayer and the output of the transformer-based bidirectional encoder representation sublayer are concatenated as an encoding result.

[0124] Considering that the BERT sub-layer uses word encoding, some semantic information of "words (language structures composed of multiple sub-words)" may be lost; therefore, refer to Figure 4 The encoding layer also includes a part-of-speech embedding sublayer, which embeds the object text into parts of speech and compares its output with the output of the BERT sublayer (text semantic representation vector h L ) are concatenated and used as the output of the encoding layer, that is, as the input of the classification network.

[0125] For example, a part-of-speech tagging tool (such as Jieba) can be used to first tag the input object text with parts of speech (such as verbs, nouns, adverbs, etc.), and then each word is embedded in the BIE tagging method according to the part of speech to obtain the part-of-speech embedding vector h pos Among them, the BIE notation method uses B to indicate the beginning of a word, I to indicate the middle of a word, E to indicate the end of a word, and S to indicate a single character.

[0126] After that, the part-of-speech embedding vector h obtained above is pos And the text semantic representation vector h output by the BERT sublayer L Splice (for example, directly connect) to obtain the output result of the coding layer, which is a vector h of the shared coding layer (Share Layer) s , the corresponding process is expressed as:

[0127] h s =Concatenate([h L ,h pos ]).

[0128] In some embodiments, the encoding layer further includes a bidirectional long short-term memory sublayer, and the output of the converter-based bidirectional encoder representation sublayer is an encoding result after passing through the bidirectional long short-term memory sublayer.

[0129] As another embodiment of the present disclosure, a bidirectional long short-term memory (BILSTM) sublayer may be added after the BERT sublayer to extract long-term dependency information in the object text.

[0130] In some embodiments, the classification layer includes a starting binary classification network, a terminating binary classification network, and a plurality of label binary classification networks;

[0131] The starting binary classification network is configured to determine whether the characters of the object text are the starting characters of the event element; the ending binary classification network is configured to determine whether the characters of the object text are the ending characters of the event element; each label binary classification network corresponds to a predetermined label, and is configured to determine whether the characters of the object text conform to the predetermined label, the predetermined label includes a predetermined event type and a predetermined role, and at least one of the predetermined event type and the predetermined role in the predetermined labels corresponding to any two different label binary classification networks is different;

[0132] Determining an event element according to character attributes of a character, and determining an event type and a role corresponding to the event element include: determining the event element according to a start character and an end character, and determining a predetermined tag corresponding to the event element according to predetermined tags of at least part of the characters of the event element, and determining a predetermined event type and a predetermined role corresponding to the event element for the predetermined tag.

[0133] It can be seen that the work of the above classification layer can be logically divided into two parts. One part is to determine whether the character is the start / end character of the event element, and the other part is to determine the combination of the event type and role corresponding to the character. The results of these two parts are combined to determine the character attribute of the character.

[0134] To this end, the "multi-classification" of the classification layer can be specifically realized through multiple "binary classifications", that is, the classification layer can include a starting binary classification network, a terminating binary classification network, and multiple label binary classification networks.

[0135] Among them, the start binary classification network only determines whether the characters of the object text are the start characters of the event element, while the end binary classification network only determines whether the characters of the object text are the end characters of the event element. Therefore, the common classification result of the two is to determine the start character and end character of the event element in the object text.

[0136] Therefore, the above start binary classification network and the end binary classification network can be regarded as a "double pointer network (Pointer Net)" as a whole, that is, the double pointer network is used to give the head position pointer (Start, corresponding to the start character) and the tail position pointer (End, corresponding to the end character) respectively, and according to a head position pointer and a tail position pointer, the boundary (Span) of an event element can be determined, that is, an event element can be determined.

[0137] For example, the processing results of the two-pointer network can be referred to Figure 5 , where the Start row is labeled 1 ( Figure 5 The character at the corresponding position (right below) is the starting character, and 0 indicates that the character at the corresponding position is not the starting character; the End row is marked with 1 ( Figure 5 ) indicates that the character at the corresponding position is the termination character, and 0 indicates that the character at the corresponding position is not the termination character; thus the starting character and the termination character in the object text are determined ( Figure 5 (indicated by pockmarks in the figure).

[0138] At the same time, the classification layer also includes multiple label binary classification networks, and each label binary classification network is used to determine whether a character is a character in an event element corresponding to a specific combination of event type and role, that is, to determine whether the character conforms to a predetermined label.

[0139] Moreover, the predetermined labels used for classification by any different label binary classification network are different, that is, among any two different predetermined labels, at least one of the predetermined event type and the predetermined role is different.

[0140] As one form of an embodiment of the present disclosure, all predetermined labels corresponding to the label binary classification networks should correspond one-to-one to all possible event types (preset) and all possible roles (preset) combinations.

[0141] For example, if all possible event types and all possible roles are as shown in the following table, all pre-defined tags may include six types: (competition behavior-win or lose, winner), (competition behavior-win or lose, loser), (competition behavior-win or lose, time), (competition behavior-advancement, time), (competition behavior-advancement, winner) and (competition behavior-advancement, promotion event).

[0142] Table 1. Examples of event types and roles

[0143] Event Type Role 1 Role 2 Role 3 Competition behavior - winning or losing Winner Loser time Competition Behavior - Promotion time Qualifiers Qualifying Tournament

[0144] Therefore, through the joint action of multiple label binary classification networks, it is equivalent to determining the correspondence between the characters in the object text and the combination of event types and roles.

[0145] Among them, the work of the binary classification networks with different labels can be relatively independent, so for each character, it may eventually be judged to meet only one predetermined label, or it may be judged to meet multiple predetermined labels at the same time, or it may be judged to not meet any predetermined label.

[0146] Therefore, the above multiple label binary classification networks are essentially equivalent to a "multi-layer label classification network (Multi-layer Label Net)", which is used to determine the characters that match in multiple predetermined labels.

[0147] Among them, the above "double pointer network" and "multi-layer label classification network" can both be logically realized through the fully connected layer, such as through Dense. Figure 4 In the above figure, the two are represented by two Dense.

[0148] Among them, Dense is a function, which is a specific implementation form of the fully connected layer. Its calculation formula is as follows:

[0149] Out = Activation (W*a+bias);

[0150] Among them, a is the input of the function, which is an n-dimensional vector; W is the preset weight, in the form of an m*n-dimensional vector; Activation represents the activation function; bias represents the preset bias; Out is the output of the function, which is an m-dimensional vector.

[0151] It can be seen that the starting binary classification network and the ending binary classification network can determine which characters in the object text belong to the "event element", and the multiple label binary classification networks can determine which predetermined labels (predetermined event type and predetermined role) the characters in the object text meet. Therefore, combining the outputs of the starting binary classification network, the ending binary classification network, and the multiple label binary classification networks is equivalent to determining whether the character is the starting character of the event element of each event type and each role, and whether it is the ending character of the event element of each event type and each role, that is, determining the character attribute of the character, completing the overall work of the classification layer.

[0152] After determining the starting character and ending character of the event element, the output layer can determine that the characters between the starting character and the ending character (including the starting character and the ending character themselves) are the characters of the "event element", thus completing the process of determining the event element; further, the output layer can also determine the predetermined label of the event element based on the predetermined label that the characters of the event element conform to, that is, determine the combination of event type and role corresponding to the event element to complete event extraction.

[0153] It can be seen that the working process of the above classification layer can be logically regarded as calculating the probability that the character conforms to each classification (each classification is the starting character or ending character of a specific role of a specific event type), and then determining the classification that the character conforms to based on the probability.

[0154] For example, the probability that the i-th character is predicted to be the starting character of the predetermined label r is The probability of being predicted as the terminal character of the predetermined label r is but and It can be expressed as follows:

[0155]

[0156]

[0157] Among them, s and e correspond to the start character and the end character respectively. are preset, trainable, and weight vectors corresponding to the combination r, are preset, trainable, and corresponding bias items of the combination r, and σ is the sigmoid activation function.

[0158] Therefore, the total classification results of the above classification layers can be referred to Figure 3 Each predetermined label, such as (competition behavior-win or lose, winner), corresponds to a line of labels indicating the start character (Start) and a line of labels indicating the end character (End). The 1 in each line of labels ( Figure 3 ) indicates that the character at the corresponding position (just below) is the starting character or the ending character of the event element of the predetermined role of the predetermined tag, and 0 indicates that the character at the corresponding position is not the starting character or the ending character of the event element of the predetermined role of the predetermined tag. Therefore, the character between the two 1 positions in the two lines of annotation is the event element of the predetermined role of the predetermined tag ( Figure 3 (indicated by pockmark filling).

[0159] It should be understood that for some predetermined tags, both lines of annotations are 0, which means that the object text does not involve the predetermined event type and / or predetermined role of the predetermined tag.

[0160] Specifically, the total classification result of the above classification layer can be represented in the form of two two-dimensional matrices Ss and Se. Among them, Ss represents the correspondence between the starting character and the predetermined label, each column of which is a character of an object text, and each row is a predetermined label, so that the intersection of a row and a column represents whether the character of the column is the starting character of the event element of the predetermined role of the predetermined label of the row. Similarly, Ss represents the correspondence between the ending character and the predetermined label, each column of which is a character of an object text, and each row is a predetermined label, so that the intersection of a row and a column represents whether the character of the column is the ending character of the event element of the predetermined role of the predetermined label of the row.

[0161] In some embodiments, determining whether a character of the object text is a starting character of an event element comprises: determining whether each character of the object text is a starting character of the event element one by one;

[0162] Determining whether a character of the object text is a termination character of the event element includes: determining one by one whether each character of the object text is a termination character of the event element.

[0163] As one method of the embodiment of the present disclosure, each character of the object text may be classified using a start binary classification network and a stop binary classification network to determine whether each character is a start character or a stop character of an event element.

[0164] It should be understood that the judgment of the starting character and the ending character may also be carried out in other specific ways. For example, after determining the first starting character in the object text, it is possible to determine whether the subsequent characters are ending characters (because there is obviously no ending character before the first starting character).

[0165] In some embodiments, determining the event element according to the start character and the end character includes: determining the start character and the end character that are closest to each other as a group, and determining the characters between the start character and the end character in the same group as an event element.

[0166] Obviously, the object text may involve multiple event elements, and thus there are corresponding multiple start characters and multiple end characters. When these start characters and end characters are combined in different ways, it is equivalent to the head position pointer (Start) and the tail position pointer (End) being combined in different ways, which will produce different event element boundaries (Span), that is, different event elements are obtained.

[0167] To ensure the correctness of the event element obtained, the closest start character and end character can be defined as a "group", and the characters between them (including the start character and the end character themselves) are used as the characters of the event element (refer to Figure 3 ).

[0168] In some embodiments, determining whether characters of the object text conform to a predetermined tag includes:

[0169] It is only determined whether each starting character and each ending character of the object text conforms to a predetermined label.

[0170] As one method of an embodiment of the present disclosure, a start binary classification network and a stop binary classification network can be used to first determine which characters of the object text are start characters or stop characters, and then multiple label binary classification networks can be used to classify the predetermined labels; thus, each label binary classification network can only determine whether the above start characters and stop characters meet the predetermined labels without having to process other characters in the object text.

[0171] It should be understood that the label binary classification network may also use other specific methods to judge the characters. For example, each label binary classification network may also classify all characters in the object text.

[0172] In some embodiments, determining the predetermined tag corresponding to the event element according to the predetermined tags of at least some characters of the event element includes: determining the predetermined tag that both the start character and the end character of the event element meet as the predetermined tag of the event element.

[0173] The role of an event element has the greatest correlation with the roles of its starting character and ending character. Therefore, when the starting character and the ending character have the same predetermined label, the output layer can use the same predetermined label as the predetermined label of the event element, that is, determine that the event element corresponds to the predetermined event and predetermined role in the predetermined label.

[0174] It should be understood that the predetermined label of the event element may also be determined in other specific ways. For example, when all characters (including middle characters) of the event element have the same predetermined label, the predetermined label (the same predetermined label) may be used as the predetermined label of the event element; or, when any character of the event element has a predetermined label, the predetermined label may be used as the predetermined label of the event element.

[0175] In some embodiments, the extraction model further includes an event extraction layer; the event extraction layer is configured to determine the type probability of each event type; the type probability of the event type represents the relevance of the object text to the event type;

[0176] Character attributes that determine the characters of the object's text include:

[0177] Determine an initial probability that a character of the object text is a starting character of an event element of a role of an event type; determine whether the character is a starting character of an event element of the event type and the role based on the initial probability and the type probability of the event type;

[0178] Determine the initial probability that a character of the object text is a terminal character of an event element of a role of an event type; and determine whether the character is a terminal character of the event element of the event type and the role based on the initial probability and the type probability of the event type.

[0179] As mentioned above, the classification layer essentially classifies the "characters" in the object text, so it obtains less information from the "whole" perspective of the object text. Figure 4 The extraction model may also include an event extraction layer, which is used to analyze the object text as a whole to determine the degree of relevance (type probability) between the object text as a whole (not the individual characters therein) and each event type.

[0180] Exemplarily, the event extraction layer can also use the vector h of the above shared encoding layer s The object text is input and subjected to maximum pooling (Maxpooling), and then a fully connected layer (such as Dense) is used to perform multiple classifications (each classification corresponds to an event type) to determine the degree of relevance of the object text to each event type, that is, the type probability p g , the corresponding process is expressed as:

[0181] x p =Maxpooling(h s );

[0182] p g =σ(W g x p +b g );

[0183] Among them, W g is a preset, trainable weight vector, b g is a preset, trainable bias term, σ is the sigmoid activation function, and Maxpooling() is the maximum pooling process.

[0184] Correspondingly, the classification layer first determines the probability (initial probability) that the character is the initial character or the terminal character of an event element of a predetermined label through its own multi-classification, and then jointly determines whether the character meets the predetermined label based on the initial probability and the type probability of the same event type.

[0185] Exemplarily, the initial probability of a character corresponding to a predetermined label may be multiplied by the corresponding type probability. If the product of the two is greater than a predetermined value, the character is judged to match the predetermined label. If the product of the two is not greater than the predetermined value, the character is judged to not match the predetermined label even if the initial probability itself is large.

[0186] Exemplarily, the probability (final probability) that the i-th character is predicted to be the starting character of the event element of the predetermined role of the predetermined tag r is and the probability (final probability) of the terminal character of the event element predicted to be the predetermined role of the predetermined label r The formula can be changed to:

[0187]

[0188]

[0189] in, and That is equivalent to the above initial probability, and p rg The type probability p of the event type corresponding to the predetermined label r g .

[0190] Of course, there are various specific ways to determine whether a character meets the predetermined label based on the initial probability and the final probability. For example, it is also possible to determine whether a character meets the predetermined label based on the sum of the initial probability and the final probability; or it is determined that the character meets the predetermined label only when the initial probability and the final probability are both greater than a predetermined value (which can be two different predetermined values).

[0191] It can be seen that after setting the event extraction layer, it is equivalent to combining the two angles of "character" and "object text as a whole" to extract information, which can improve the training convergence speed of the extraction model and the final event extraction effect to a certain extent.

[0192] In some embodiments, determining character attributes of characters of the object text includes:

[0193] For characters of the object text, it is determined independently whether they are the start characters of the event elements of each event type and each role, and whether they are the end characters of the event elements of each event type and each role.

[0194] As one method of an embodiment of the present disclosure, it is possible to independently determine whether each character is the starting character / ending character of an event element of a predetermined label (i.e., a combination of a specific event type and a specific role), that is, the classification result of one character has nothing to do with the classification results of other characters.

[0195] According to the above method, a situation may occur where one character corresponds to multiple predetermined tags, so that it may be finally determined that one event element is multiple roles of multiple event types; or one part of one event element is another event element.

[0196] Therefore, the embodiments of the present disclosure can well handle events with "event element overlap" or "role overlap", further improving the effect of event extraction.

[0197] Determine the event type and role corresponding to the event element, including:

[0198] In response to the situation that multiple event elements correspond to the same event type and the same role, based on the confidence of each event element in the multiple event elements corresponding to the event type and the role, determine that the event element with the highest confidence corresponds to the event type and the role.

[0199] Since the event extraction in the disclosed embodiment is based on "characters", it is possible that the same event type and the same role correspond to multiple different event elements, and these different event elements are also "different expressions" of a "factual event element", but the existence of this situation may lead to complex event extraction results. Therefore, when the above situation occurs, the output layer can judge the confidence of these event elements that meet the event type and the role, and take the event element with the largest confidence as the event element corresponding to the event type and the role.

[0200] For example, for the object text "Team H defeated the defending champion Team I", its original extraction result (Result) may include:

[0201] Result:{"event_type":"Competition-Win or Lose","argument":[{"role":"Loser","argument":"Team I"},{"role":"Loser","argument":"Defending Champion Team I"}]";

[0202] Among them, event_type indicates the event type, argument indicates the event element, and role indicates the role.

[0203] It can be seen that due to the different ways of taking the "attributive", two corresponding event elements, "I team" and "defending champion I team" are generated for the "loser" role of the "competitive behavior-win or lose" event type. At this time, it is necessary to determine the confidence of the two event elements. For example, the final probability corresponding to the initial characters of the event element is used as the confidence, so as to judge that the confidence of "I team" is greater than the confidence of "defending champion I team". Therefore, the event element corresponding to the "loser" role of the "competitive behavior-win or lose" event type is "I team", not "defending champion I team".

[0204] Of course, the above confidence comparison process is also optional. For example, if, when determining the character attribute corresponding to a character, it is stipulated that the character attribute can only be the start character / end character of a role of an event type, the above problem will not occur; or, it can also be set to allow the same event type and the same role to correspond to multiple different event elements (regarded as different expressions of an event element).

[0205] Second, refer to Figure 6 , the present disclosure provides a method for extracting model training, which includes:

[0206] S201, determine the initial model.

[0207] S202: Train the initial model using multiple training samples to obtain an extraction model.

[0208] The extraction model is configured to process the object text to determine the event information of the object text; the event information includes event elements, and event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer; the classification layer is configured to determine the character attributes of the characters of the object text; the character attributes include whether the character is the starting character of the event element of each event type and each role, and whether the character is the ending character of the event element of each event type and each role; the output layer is configured to determine the event element according to the character attributes of the character, and determine the event type and role corresponding to the event element.

[0209] The extraction model of the embodiment of the present disclosure can be obtained through pre-training, and its training process may include: setting an initial model and training samples, the initial model has the same structure as the extraction model, and the training samples include the object text to be processed and the standard result (or "standard answer") that should be obtained after the object text is processed; then, the training samples are processed with the initial model, the processing results are compared with the standard results, the difference between the processing results and the standard results is determined through the loss function, and the parameters in the initial model are adjusted according to the difference; this is repeated until the end conditions are met (such as the number of processed training samples reaches a predetermined number, or the processing of the verification samples reaches a predetermined effect, or the change of parameters converges, etc.), and the training is terminated, and the initial model (with changed parameters) at this time is used as the extraction model.

[0210] For example, the loss function used in the above training can be:

[0211]

[0212] Among them, s and e correspond to the starting character and the ending character respectively, n is the length of the input object text (number of characters), and the summation symbol represents a comprehensive judgment of the processing results of all characters in the object text (the upper limit of the summation is "n+2" because the character sequence actually processed by the BERT sublayer also includes the above identifier CLS and separator SEP), so the two summation symbols correspond to the loss of the starting character and the loss of the ending character respectively; and and It is the judgment of whether the corresponding character in the standard result has a predetermined label (0 means not in compliance, 1 means in compliance).

[0213] In some embodiments, training the initial model with multiple training samples to obtain the extraction model includes:

[0214] The initial model is adversarially trained with multiple training samples to obtain the extraction model.

[0215] As a method of an embodiment of the present disclosure, in order to improve the extraction effect of the obtained extraction model, a “adversarial training” method can also be used.

[0216] That is, some training samples are set as "adversarial samples", in which subtle disturbances are deliberately added, and these disturbances are likely to cause the extraction model to produce erroneous results. By training with adversarial samples, the model can adapt to the disturbance, thereby improving the anti-interference robustness of the trained extraction model.

[0217] For example, adversarial training can be done by adding perturbations to the encoding layer, such as perturbing the word embedding matrix W of the BERT sublayer tAnd the part-of-speech embedding vector h of the part-of-speech embedding sublayer (Postag Embedding sublayer) pos . Thus, adversarial training can be expressed as the following maximum minimization formula:

[0218]

[0219] Where D represents the training set composed of all training samples, x is the input representation of the sample, y represents the predetermined label of the sample (standard result), θ represents the model parameter, Δx represents the superimposed disturbance, and Ω represents the disturbance space of all disturbances.

[0220] Furthermore, Δx can be obtained by calculating the gradient of the embedding layer, which can be specifically expressed as:

[0221] Δx=εsign[▽ x L(x,y;θ)];

[0222] Among them, L(x,y,θ) is the loss function of the sample, ▽ x L(x, y; θ) represents the gradient of the loss function with respect to x, and ε is a preset constant. Therefore, L(x+Δx, y; θ) represents the loss function obtained by comparing the result obtained by superimposing the perturbation Δx on the sample x (i.e., the perturbed sample) with y.

[0223] It can be seen that the above embedding matrix W of the encoding layer is directly t and the part-of-speech embedding vector h of the part-of-speech embedding sublayer pos By performing perturbations (i.e., adding perturbations Δx), the purpose of adversarial training is achieved, so that the extraction model can adapt to the perturbations Δx and have better anti-interference robustness.

[0224] Thirdly, refer to Figure 7 , an embodiment of the present disclosure provides an electronic device, comprising:

[0225] one or more processors;

[0226] A memory having one or more computer programs stored thereon:

[0227] One or more I / O interfaces, connected between the processor and the memory, configured to implement information exchange between the processor and the memory;

[0228] When one or more computer programs are executed by one or more processors, any of the above event extraction methods can be implemented.

[0229] Fourthly, refer to Figure 8 , an embodiment of the present disclosure provides an electronic device, comprising:

[0230] one or more processors;

[0231] A memory having one or more computer programs stored thereon:

[0232] One or more I / O interfaces, connected between the processor and the memory, configured to implement information exchange between the processor and the memory;

[0233] When one or more computer programs are executed by one or more processors, any of the above extraction model training methods can be implemented.

[0234] Fifth, refer to Fig. 9 The embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, any of the above event extraction methods is implemented.

[0235] Sixth, refer to Fig.10 , an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, any of the above extraction model training methods is implemented.

[0236] Specific Examples

[0237] The following describes the embodiments of the present disclosure in more detail with reference to some specific examples.

[0238] (1) Experimental data

[0239] A preset Chinese event extraction dataset is used as experimental data. The dataset includes 17,000 hot sentences (object texts) from a specific search engine. The standard results of event types, event elements, and roles are determined through manual annotation. A total of 65 event types are preset (including recently added event types), and it is determined that all sentences include a total of 20,000 events.

[0240] 12,000 sentences in the dataset are randomly selected as the training set, 1,500 sentences are randomly selected as the validation set, and the remaining 3,500 sentences are used as the test set; 1,500 sentences are randomly selected from all the sentences in the test set as test set 1 (test1), and all 3,500 sentences in the test set are called test set 2 (test2).

[0241] (2) Model settings

[0242] A subject extraction model (referred to as BMNP) of the present disclosure embodiment is set up including a BERT sublayer, a part-of-speech embedding sublayer, a starting binary classification network, a terminating binary classification network, and multiple label binary classification networks.

[0243] The extraction model 1 of the embodiment of the present disclosure is obtained by removing the part-of-speech embedding sublayer in the subject extraction model, which is called BMPN-POS.

[0244] A BILSTM sublayer is added to the subject extraction model as the extraction model 2 of the embodiment of the present disclosure, which is called BMNP+BILSTM.

[0245] The extraction model 3 of the embodiment of the present disclosure is trained using adversarial training (that is, other extraction models do not use adversarial training), which is called BMNP+ adversarial training.

[0246] The BERT sublayer uses the RoBERTa-Large pre-trained language model, with a maximum sequence length of 160 characters, an optimization algorithm of Adam, and an initial learning rate of 5e -5 , after 1 epoch, it drops to 1e -5 , the total number of epochs is 8, and the part-of-speech embedding dimension is 256.

[0247] An extraction model using an existing "BERT+CRF (conditional random field)" structure in some related technologies is a comparative extraction model, called BERT+CRF.

[0248] The extraction models of the embodiments of the present disclosure and the comparative examples are trained respectively.

[0249] (3) Experimental results

[0250] Each extraction model is used to process the sentences in the above test set 1 (test1) respectively. The processing results are as follows:

[0251] Table 2. Processing results of each extraction model on test set 1

[0252] Extraction model precision recall F1 BERT+CRF 0.843 0.84 0.841 BMPN-POS 0.845 0.869 0.857 BMP 0.847 0.872 0.859 BMPN+BILSTM 0.855 0.862 0.858 BMPN+Adversarial Training 0.851 0.871 0.861

[0253] Among them, the precision and recall are obtained by comparing the extraction results with the standard results, and F1 means that word-level matching is used.

[0254] Wherein, word level matching F1=2*word level matching P value*word level matching R value / (word level matching P value+word level matching R value);

[0255] Word-level matching P value = number of common words between model-predicted event elements and standard outcome event elements / number of words in model-predicted event elements;

[0256] Word-level matching R value = number of common words between model-predicted event elements and standard result event elements / number of words in standard result event elements.

[0257] It can be seen that in terms of accuracy and word-level matching F1, the effects of the extraction models in the embodiments of the present disclosure are better than those of the extraction models in the comparative examples, and the advantage in recall rate is even more obvious.

[0258] The extraction model effect can be further improved by adding a part-of-speech embedding sublayer (referring to the data comparison between BMPN and BMPN-POS), a BILSTM sublayer, or performing adversarial training. Among them, adding a BILSTM sublayer has the most obvious improvement on accuracy.

[0259] In order to make full use of the data set, the training set and the validation set are further combined and randomly divided into 10 samples. A 10-fold cross validation (CV, Cross Validation, i.e., one sample is selected from the 10 samples as a validation sample, and the remaining 9 samples are used as training samples. When different validation samples are selected, they are trained separately) is performed on each extraction model in the embodiment of the present disclosure to obtain each extraction model, and then the results are voted (Voting Ensembles, i.e., the standard result is determined by voting according to the processing results of each extraction model), and then the test set 1 (test1) and the test set 2 (test2) are processed respectively. The results are as follows:

[0260] Table 3. Processing results of each extraction model on test set 1 (cross validation + voting fusion)

[0261] Extraction model precision recall F1 BMPN-POS 0.862 0.87 0.866 BMP 0.862 0.872 0.867 BMPN+BILSTM 0.863 0.872 0.867 BMPN+Adversarial Training 0.86 0.876 0.868 Ensemble all (fusion result) 0.873 0.875 0.874

[0262] Table 4. Processing results of each extraction model on test set 1 (cross validation + voting fusion)

[0263] Extraction model precision recall F1 Ensemble all (fusion result) 0.8758 0.8429 0.859

[0264] Among them, as before, different extraction models may also give different "different expressions" for the "actual event elements" corresponding to a specific role of a specific event type, such as the different expressions of "I team" and "defending champion I team" above. At this time, different "expressions" should be regarded as different results, and the correct "expression" should be determined based on the votes of each extraction model (such as determining that "I team" is correct).

[0265] It can be seen that the cross-validation voting fusion has brought about a certain improvement in the extraction effect. The final cross-validation voting fusion result has an F1 value of 0.859 on the test set 2 (test2).

[0266] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0267] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0268] Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-temporary medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0269] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only as generally illustrative, and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or event elements described in conjunction with a particular embodiment may be used alone, or may be used in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A method for event extraction, comprising: Process the object text using a preset extraction model to determine the event information of the object text; The event information includes event elements, and event types and roles corresponding to the event elements; the extraction model includes a classification layer and an output layer; The classification layer is configured to determine character attributes of characters of the object text; the character attributes include whether the character is a starting character of an event element for each event type and each role, and whether the character is a terminal character of an event element for each event type and each role; The output layer is configured to determine an event element according to the character attributes of the character, and determine an event type and a role corresponding to the event element; Wherein, the extraction model further includes an event extraction layer; the event extraction layer is configured to determine the type probability of each event type; the type probability of an event type represents the correlation between the object text and the event type; Determining the character attributes of the characters of the object text includes: Determine an initial probability that a character of the object text is a starting character of an event element of a role of an event type; determine whether the character is a starting character of an event element of the event type and the role based on the initial probability and the type probability of the event type; Determine the initial probability that a character of the object text is a terminal character of an event element of a role of an event type; and determine whether the character is a terminal character of the event element of the event type and the role based on the initial probability and the type probability of the event type.

2. The method according to claim 1, wherein: The extraction model also includes a coding layer; The encoding layer is configured to encode the object text and input the encoding result to the classification layer.

3. The method according to claim 2, wherein: The encoding layer includes a transformer-based bidirectional encoder representation sublayer.

4. The method according to claim 3, wherein: The encoding layer also includes a part-of-speech embedding sublayer; the output of the part-of-speech embedding sublayer and the output of the converter-based bidirectional encoder representation sublayer are concatenated into the encoding result.

5. The method according to claim 3, wherein: The encoding layer also includes a bidirectional long short-term memory sublayer, and the output of the converter-based bidirectional encoder representation sublayer is the encoding result after passing through the bidirectional long short-term memory sublayer.

6. The method according to claim 1, wherein: The classification layer includes a starting binary classification network, a terminating binary classification network, and multiple label binary classification networks; The starting binary classification network is configured to determine whether the characters of the object text are the starting characters of the event element; the ending binary classification network is configured to determine whether the characters of the object text are the ending characters of the event element; each of the label binary classification networks corresponds to a predetermined label, and is configured to determine whether the characters of the object text conform to the predetermined label, the predetermined label includes a predetermined event type and a predetermined role, and at least one of the predetermined event type and the predetermined role in the predetermined labels corresponding to any two different label binary classification networks is different; The method of determining the event element according to the character attributes of the character, and determining the event type and role corresponding to the event element includes: determining the event element according to the starting character and the ending character, and determining a predetermined tag corresponding to the event element according to the predetermined tags of at least part of the characters of the event element, and determining a predetermined event type and a predetermined role corresponding to the predetermined tag of the event element.

7. The method according to claim 6, wherein: The determining whether the characters of the object text are the starting characters of the event element comprises: determining whether each character of the object text is the starting character of the event element one by one; The determining whether the character of the object text is the termination character of the event element comprises: determining one by one whether each character of the object text is the termination character of the event element.

8. The method according to claim 7, wherein: Determining the event element according to the start character and the end character includes: determining the start character and the end character that are closest to each other as a group, and determining the characters between the start character and the end character in the same group as an event element.

9. The method according to claim 6, wherein: The determining whether the characters of the object text conform to the predetermined label comprises: It is only determined whether each of the start characters and each of the end characters of the object text conforms to the predetermined label.

10. The method according to claim 9, wherein: Determining the predetermined label corresponding to the event element according to the predetermined labels of at least part of the characters of the event element comprises: It is determined that the predetermined label that the start character and the end character of the event element both conform to is the predetermined label of the event element.

11. The method according to claim 1, wherein: Determining the character attributes of the characters of the object text includes: For the characters of the object text, it is determined independently whether they are the starting characters of the event elements of each event type and each role, and whether they are the ending characters of the event elements of each event type and each role.

12. The method according to claim 1, wherein: Determining the event type and role corresponding to the event element includes: In response to the situation that multiple event elements correspond to the same event type and the same role, based on the confidence that each event element in the multiple event elements corresponds to the event type and the role, it is determined that the event element with the highest confidence corresponds to the event type and the role.

13. A method for extracting model training, comprising: Determine the initial model; Training the initial model with multiple training samples to obtain the extraction model; Wherein, the extraction model is the extraction model used in the event extraction method described in any one of claims 1 to 12.

14. The method according to claim 13, wherein: The training of the initial model with a plurality of training samples to obtain the extraction model comprises: The initial model is adversarially trained using multiple training samples to obtain the extraction model.

15. An electronic device, comprising: one or more processors; A memory having one or more computer programs stored thereon: One or more I / O interfaces, connected between the processor and the memory, and configured to implement information exchange between the processor and the memory; When the one or more computer programs are executed by the one or more processors, the event extraction method described in any one of claims 1 to 12 can be implemented.

16. An electronic device, comprising: one or more processors; A memory having one or more computer programs stored thereon: One or more I / O interfaces, connected between the processor and the memory, and configured to implement information exchange between the processor and the memory; When the one or more computer programs are executed by the one or more processors, the method for extraction model training described in any one of claims 13 to 14 can be implemented.

17. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, can implement the event extraction method described in any one of claims 1 to 12.

18. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, can implement the method for extracting model training described in any one of claims 13 to 14.

Citation Information

Patent Citations

  • Event element extraction method and device, computing equipment and storage medium

    CN109582949A

  • Information classification extraction method and device, computer equipment and storage medium

    CN110765265A

  • Unstructured text extraction multi-task joint training method based on pointer network

    CN111488726A