Event information extraction method and device, and electronic equipment

By automatically extracting event information using sequence labeling and text classification models, the problems of high labor costs and poor portability in existing technologies are solved, and accurate event information extraction is achieved in different domain scenarios.

CN114840662BActive Publication Date: 2026-01-27JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110145796.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-02
Publication Date
2026-01-27
Estimated Expiration
2041-02-02

AI Technical Summary

Technical Problem

Existing event information extraction methods are labor-intensive and have poor portability, requiring professionals to manually create patterns or rules, making them difficult to adapt to different domain scenarios.

Method used

Event information is automatically extracted using sequence labeling and text classification models. By obtaining sentence vectors, entities, and trigger words, and combining them with position vectors, the event information is automatically identified using a pre-trained model.

Benefits of technology

It reduces labor costs, improves the accuracy of event information extraction, and can be effectively applied in different fields and scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840662B_ABST
    Figure CN114840662B_ABST
Patent Text Reader

Abstract

The application provides an event information extraction method and device and electronic equipment, and relates to the technical field of natural language processing. The method comprises the following steps: obtaining a sentence to be processed; inputting the sentence into a sequence labeling model to obtain a vector corresponding to the sentence, an entity in the sentence, and a trigger word; for each entity-trigger word pair, concatenating the vector corresponding to the sentence, a position vector of the trigger word in the sentence, and a position vector of the entity in the sentence to obtain a concatenated vector; and inputting a plurality of concatenated vectors into a text classification model to obtain event information in the sentence. Thus, the sequence labeling model and the text classification model are used to automatically extract event information in the sentence, thereby reducing the labor cost, and the event information can be accurately extracted for sentences in different fields and scenarios, and the portability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to an event information extraction method, apparatus and electronic device. Background Technology

[0002] Event information extraction refers to presenting unstructured text containing event information in a structured form. As an important information extraction method, event information extraction is widely used in fields such as event graphing, scenario generation, news summarization, and information retrieval.

[0003] In related technologies, event information extraction methods based on pattern matching are commonly used to extract event information from text. These methods involve first constructing extraction patterns or rules for different event types, and then extracting event information based on the patterns or rules matched by the text. However, this approach requires professionals to manually create the patterns or rules beforehand, resulting in high labor costs. Furthermore, different extraction patterns or rules need to be created for event information extraction in different domain scenarios, leading to poor portability. Summary of the Invention

[0004] This application aims to at least partially address one of the technical problems in the related art.

[0005] This application proposes an event information extraction method, apparatus, and electronic device to solve the technical problems of high labor costs and poor portability in related event extraction methods.

[0006] The first aspect of this application proposes an event information extraction method, comprising: acquiring a statement to be processed; inputting the statement into a sequence labeling model to obtain a vector corresponding to the statement, as well as entities and trigger words in the statement; for each entity-trigger word pair, concatenating the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement to obtain a concatenated vector; and inputting multiple concatenated vectors into a text classification model to obtain event information in the statement.

[0007] A second aspect of this application provides an event information extraction device, comprising: a first acquisition module for acquiring a statement to be processed; a second acquisition module for inputting the statement into a sequence labeling model to acquire a vector corresponding to the statement, as well as entities and trigger words in the statement; a concatenation module for concatenating the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement for each entity-trigger word pair to obtain a concatenated vector; and a third acquisition module for inputting multiple concatenated vectors into a text classification model to acquire event information in the statement.

[0008] A third aspect of this application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform an event information extraction method as proposed in a first aspect of this application.

[0009] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform an event information extraction method as described in a first aspect of this application.

[0010] The fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the event information extraction method as proposed in the first aspect of this application.

[0011] The technical solution proposed in this application has the following beneficial effects:

[0012] After acquiring the statement to be processed, the statement is input into a sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement. Then, for each entity-trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement are concatenated to obtain a concatenated vector. The multiple concatenated vectors are then input into a text classification model to obtain the event information in the statement. This achieves automatic extraction of event information from statements using a sequence labeling model and a text classification model, thereby reducing labor costs. Moreover, it can accurately extract event information from statements in different domain scenarios and has strong portability.

[0013] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0014] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0015] Figure 1 This is a flowchart illustrating the event information extraction method provided in Embodiment 1 of this application;

[0016] Figure 2 This is a flowchart illustrating the event information extraction method provided in Embodiment 2 of this application;

[0017] Figure 3A schematic diagram of the architecture of sequence labeling models and text classification models;

[0018] Figure 4 This is a schematic diagram of the event information extraction device provided in Embodiment 3 of this application;

[0019] Figure 5 This is a schematic diagram of the event information extraction device provided in Embodiment 4 of this application;

[0020] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present application is shown. Detailed Implementation

[0021] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0022] In related technologies, event information extraction methods based on pattern matching are commonly used to extract event information from text. These methods involve first constructing extraction patterns or rules for different event types, and then extracting event information based on the patterns or rules matched by the text. However, this approach requires professionals to manually create the patterns or rules beforehand, resulting in high labor costs. Furthermore, different extraction patterns or rules need to be created for event information extraction in different domain scenarios, leading to poor portability.

[0023] This application addresses the technical problems of high labor costs and poor portability in event extraction methods in related technologies by proposing an event information extraction method.

[0024] The event information extraction method of this application embodiment, after obtaining the statement to be processed, inputs the statement into a sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement. Then, for each entity-trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement are concatenated to obtain a concatenated vector. The multiple concatenated vectors are then input into a text classification model to obtain the event information in the statement. Thus, the event information in the statement is automatically extracted using a sequence labeling model and a text classification model, thereby reducing labor costs. Moreover, it can accurately extract event information from statements in different domain scenarios and has strong portability.

[0025] To better understand the technical solution of this application, some terms will be introduced first.

[0026] An entity is an object or collection of objects within a semantic category, such as a person's name, a vehicle's name, a company name, or a place name.

[0027] An event is something that has happened, may happen, or will happen in the real world. It generally includes time, place, and people involved, such as birth, death, earthquake, or car accident.

[0028] A role is a participant and attribute in an event, typically represented by entities. For example, the deceased, time of death, and location of the event are roles in a death event, while the party increasing its stake and the company increasing its stake are roles in a shareholding increase event.

[0029] Trigger words are the core words used to identify events (mostly verbs and nouns). For example, "born from" or "born" are trigger words for birth events, and "increase holdings" is a trigger word for increase holdings events.

[0030] The following description, with reference to the accompanying drawings, outlines an event information extraction method, apparatus, electronic device, and storage medium according to embodiments of this application.

[0031] Figure 1 This is a flowchart illustrating the event information extraction method provided in Embodiment 1 of this application.

[0032] It should be noted that the embodiments of this application illustrate the example of the event information extraction method being configured in an event information extraction device. The event information extraction device can be applied to any electronic device so that the electronic device can perform the function of extracting event information of statements.

[0033] Among them, electronic devices can be personal computers (PCs), cloud devices, mobile devices, etc. Mobile devices can be hardware devices with various operating systems, touch screens and / or displays, such as mobile phones, tablets, personal digital assistants, wearable devices, and in-vehicle devices.

[0034] like Figure 1 As shown, the event information extraction method may include the following steps:

[0035] Step 101: Obtain the statement to be processed.

[0036] The statement to be processed refers to the statement from which event information is to be extracted. This statement can be user-inputted, news or news comments scraped from the internet, or obtained through other means; this application does not impose any restrictions on this. Furthermore, the statement to be processed can be in any language, such as Chinese or English; this application does not impose any restrictions on this either.

[0037] Step 102: Input the statement into the sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement.

[0038] In an exemplary embodiment, a sequence labeling model can be pre-trained. The input of the sequence labeling model is a statement, and the output is the vector corresponding to the statement, the entities in the statement, and the trigger words. Thus, by inputting the statement to be processed into the sequence labeling model, the sequence labeling model processes the statement to be processed and obtains the vector corresponding to the statement, the entities in the statement, and the trigger words.

[0039] Taking the statement to be processed, “Group A: Announced on February 10, 2018, that Group B increased its holdings of the company’s shares by 8.1099 million shares”, as an example, by inputting the statement into the sequence labeling model, the entities in the statement can be obtained: Group A, February 10, 2018, Group B, 8.1099 million shares, and the trigger word: increased holdings.

[0040] Step 103: For each entity trigger word pair, concatenate the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement to obtain the concatenated vector.

[0041] It is understood that the entities and trigger words in a statement may each include one or more, for example, a statement may include two entities and one trigger word, or four entities and two trigger words. In the embodiments of this application, each entity and each trigger word in the statement can be combined to form an entity-trigger word pair.

[0042] For example, suppose a statement contains three entities: entity 1, entity 2, and entity 3, and one trigger word: trigger word 1. Then, based on these three entities and one trigger word, the following three entity-trigger word pairs can be formed: entity 1 and trigger word 1, entity 2 and trigger word 1, and entity 3 and trigger word 1. Suppose a statement contains four entities: entity 1, entity 2, entity 3, and entity 4, and two trigger words: trigger word 1 and trigger word 2. Then, based on these four entities and two trigger words, the following eight entity-trigger word pairs can be formed: entity 1 and trigger word 1, entity 2 and trigger word 1, entity 3 and trigger word 1, entity 4 and trigger word 1, entity 1 and trigger word 2, entity 2 and trigger word 2, entity 3 and trigger word 2, and entity 4 and trigger word 2.

[0043] In other words, the number of entity trigger word pairs is the product of the number of entities included in the statement and the number of trigger words.

[0044] In the exemplary embodiment, after obtaining the entity and trigger word corresponding to the statement, for each entity, the position vector of the entity in the statement can be obtained according to the position of the entity in the statement, and for each trigger word, the position vector of the trigger word in the statement can be obtained according to the position of the trigger word in the statement.

[0045] Furthermore, for each entity trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement can be concatenated to obtain the concatenated vector corresponding to each entity trigger word pair.

[0046] It is important to note that when concatenating the vector corresponding to the statement, the position vector of the trigger word in the entity trigger word pair in the statement, and the position vector of the entity in the entity trigger word pair in the statement, the concatenation must be performed in the following order: the vector corresponding to the statement, the position vector of the trigger word in the entity trigger word pair in the statement, and the position vector of the entity in the entity trigger word pair in the statement.

[0047] Step 104: Input the concatenated vectors into the text classification model to obtain event information in the sentences.

[0048] The event information in the statement includes the entity in the statement, the trigger word, and the role of the entity.

[0049] In an exemplary embodiment, after obtaining the concatenated vector corresponding to each entity trigger word pair in the statement to be processed, a matrix can be constructed based on the multiple concatenated vectors corresponding to each entity trigger word pair. Furthermore, a text classification model can be pre-trained. The input of the text classification model is the matrix composed of multiple concatenated vectors corresponding to each entity trigger word pair in the statement, and the output is the role of the entity in the statement. Thus, by inputting the matrix composed of multiple concatenated vectors into the text classification model, the role corresponding to each entity in the statement to be processed can be obtained. In this way, by combining the entities and trigger words in the statement output by the sequence labeling model, the event information in the statement can be obtained.

[0050] In the process of constructing a matrix based on the multiple concatenated vectors corresponding to each entity trigger word pair, the number of rows in the matrix can be the number of entity trigger word pairs, and the number of columns in the matrix can be the dimension of each concatenated vector.

[0051] For example, taking the statement "Group A: Announced on February 10, 2018, that Group B increased its holdings of the company's shares by 8.1099 million shares" as an example, after inputting the statement into the sequence labeling model, we can obtain the entities in the statement: Group A, February 10, 2018, Group B, 8.1099 million shares, as well as the trigger word: "increased holdings," and the corresponding vector of the statement. Then, we can obtain the position vector of each entity in the statement and the position vector of each trigger word. Furthermore, based on the four entities and one trigger word in the statement, we can obtain four entity-trigger word pairs. For each entity-trigger word pair, we can concatenate the vector corresponding to the statement, the position vector of the trigger word in the entity-trigger word pair, and the position vector of the entity in the entity-trigger word pair, thus obtaining four concatenated vectors. Then, each concatenated vector is used as a row element of a matrix to construct a 4-row matrix. This 4-row matrix is ​​input into a pre-trained text classification model to obtain the following event information from the sentence: event type is "increased holdings," date is February 10, 2018, the company increasing holdings is Group B, the company increasing holdings is Group A, and the number of shares is 8.1099 million. The event type can be determined based on trigger words.

[0052] The event information extraction method provided in this application can automatically extract event information from sentences to be processed by using a pre-trained sequence labeling model and text classification model, thereby reducing labor costs. Furthermore, since the position of entities and trigger words in the sentence is combined when extracting event information, the accuracy of event information extraction can be improved. In addition, the event information extraction method using sequence labeling model and text classification model can be applied to different domain scenarios and has strong portability.

[0053] The event information extraction method of this application embodiment, after obtaining the statement to be processed, inputs the statement into a sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement. Then, for each entity-trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement are concatenated to obtain a concatenated vector. The multiple concatenated vectors are then input into a text classification model to obtain the event information in the statement. Thus, the event information in the statement is automatically extracted using a sequence labeling model and a text classification model, thereby reducing labor costs. Moreover, it can accurately extract event information from statements in different domain scenarios and has strong portability.

[0054] As can be seen from the above analysis, in the embodiments of this application, a sequence labeling model and a text classification model can be pre-trained to extract event information from the statements to be processed. The following section combines... Figure 2The training process of the sequence labeling model and text classification model used for event information extraction in the event information extraction method of the embodiments of this application is described.

[0055] Figure 2 This is a flowchart illustrating the training process of the sequence labeling model and text classification model provided in Embodiment 2 of this application. Figure 2 As shown, in Figure 1 Based on the illustrated embodiment, prior to step 102, the event information extraction method may further include the following steps:

[0056] Step 201: Obtain the initial sequence labeling model and the initial text classification model that are connected sequentially.

[0057] Step 202: Obtain training data, which includes sample statements and corresponding sample event information.

[0058] Step 203: Using sample sentences from the training data as input and sample event information corresponding to the sample sentences as output, the coefficients of the initial sequence labeling model and the initial text classification model are jointly adjusted by combining the predicted event information output by the initial classification model and the sample event information to achieve training.

[0059] Specifically, an initial sequence labeling model and an initial text classification model can be obtained sequentially, and training data including sample sentences and corresponding sample event information can be obtained. Then, the sample sentences in the training data are used as input, and the sample event information corresponding to the sample sentences is used as output. The coefficients of the initial sequence labeling model and the initial text classification model are jointly adjusted by combining the predicted event information output by the initial classification model and the sample event information to achieve training.

[0060] By jointly adjusting the coefficients of the initial sequence labeling model and the initial text classification model, the error propagation problem during the training process of the initial sequence labeling model and the initial text classification model can be avoided, thereby improving the training effect of the model.

[0061] In an exemplary embodiment, reference is made to Figure 3 The initial sequence labeling model may include:

[0062] The pre-trained semantic representation layer, bidirectional neural network layer, graph vector layer, and entity trigger word extraction layer are connected in sequence.

[0063] The semantic representation layer is used to obtain the vector corresponding to each word in the sentence.

[0064] The bidirectional neural network layer and graph vector layer are used to combine the vectors corresponding to each character to obtain the vector corresponding to the sentence;

[0065] The entity trigger word extraction layer is used to extract entities and trigger words from a statement by combining the vector corresponding to the statement.

[0066] Among them, the pre-trained semantic representation layer, bidirectional neural network layer, and graph vector layer constitute the shared encoding layer of the initial sequence labeling model.

[0067] The pre-trained semantic representation layer can be any pre-trained layer capable of obtaining vectors corresponding to each character in a sentence. For example, it could be the semantic encoding layer within a pre-trained semantic representation model, such as the semantic encoding layer in a BERT or Roberta model. Pre-training the semantic representation model involves training the initial model using corpora from multiple domains. These corpora could include news articles, chat conversations, or academic papers, allowing the semantic encoding layer to learn a wealth of linguistic knowledge. Inputting a sentence into the pre-trained semantic representation layer then yields the vectors corresponding to each character in the sentence.

[0068] A bidirectional neural network layer can preserve the sequence information between characters in a sentence within the vector corresponding to the sentence. Therefore, in this embodiment, a bidirectional neural network layer can be designed in the sequence labeling model. This layer, combined with the vectors corresponding to each character, can be used to obtain the vector corresponding to the sentence. Specifically, the input to the bidirectional neural network layer is the vector corresponding to each character. By inputting the vectors corresponding to each character output from the pre-trained semantic representation layer into the bidirectional neural network layer, the vector corresponding to the sentence can be obtained.

[0069] In an exemplary embodiment, the bidirectional neural network layer may be, for example, a Bi-LSTM (Bidirectional Long Short Term Memory) network.

[0070] The graph vector layer, for example, can be the encoding layer in a graph neural network (GCN) model. It can build syntactic dependency trees on a word-by-word basis to obtain a knowledge graph of the statement, and then obtain vectors from the knowledge graph. In this embodiment, the vectors corresponding to the statements output by the bidirectional neural network are input into the graph vector layer, so that the graph vector layer can add information such as the relationships between words to the vectors corresponding to the statements, thereby obtaining new vectors corresponding to the statements.

[0071] The entity trigger word extraction layer can be any layer capable of performing entity recognition, part-of-speech tagging, etc. For example, a CRF (Conditional Random Field) model can be used as the entity trigger word extraction layer in a sequence labeling model. The vectors corresponding to the sentences output by the graph vector layer are input into the entity trigger word extraction layer, which can then combine the vectors corresponding to the sentences to extract the entities and trigger words from the sentences.

[0072] The initial text classification model can be any model capable of text classification, and this application does not impose any restrictions on it. For example, the initial text classification model can be the TextCNN model.

[0073] In an exemplary embodiment, taking an initial sequence labeling model comprising a pre-trained semantic representation layer, a bidirectional neural network layer, a graph vector layer, and an entity trigger word extraction layer connected in sequence as an example, the sample sentences in the training data can be used as input, and the sample event information corresponding to the sample sentences can be used as output. The coefficients of the last three layers of the semantic representation layer, the bidirectional neural network layer, the graph vector layer, the entity trigger word extraction layer, and the initial text classification model in the initial sequence labeling model can be jointly adjusted by combining the predicted event information and sample event information output by the initial classification model, so as to achieve joint training of the initial sequence labeling model and the initial text classification model connected in sequence.

[0074] It should be noted that the last three layers of the semantic representation layer are fully connected layers. When training the initial sequence labeling model and the initial text classification model using sample sentences and corresponding sample event information, for the semantic representation layer, only the coefficients of the last three layers of the semantic representation layer can be adjusted. This allows the trained semantic representation layer to learn event information from the sample sentences and corresponding sample event information. Furthermore, since the other network layers of the semantic representation layer are not trained using sample sentences and corresponding sample event information, the language knowledge already learned during pre-training can be retained. Moreover, by training only a portion of the network layers of the semantic representation layer, training time can be reduced.

[0075] In an exemplary embodiment, the process of jointly adjusting the coefficients of the initial sequence labeling model and the initial text classification model by taking sample sentences from the training data as input, taking the sample event information corresponding to the sample sentences as output, and combining the predicted event information output by the initial classification model with the sample event information can be as follows:

[0076] The sample statement is input into the initial sequence labeling model and the initial text classification model, which are connected in sequence, to obtain the sequence labeling results output by the initial sequence labeling model and the predicted event information output by the initial text classification model.

[0077] The value of the first loss function is determined by combining the sequence labeling results, the sample event information corresponding to the sample sentences, the first loss function of the initial sequence labeling model, and the first weight of the initial sequence labeling model.

[0078] The value of the second loss function is determined by combining the predicted event information, the sample event information corresponding to the sample statement, the second loss function of the initial text classification model, and the second weight of the initial text classification model.

[0079] The coefficients of the initial sequence labeling model and the initial text classification model are adjusted by combining the values ​​of the first and second loss functions.

[0080] The sequence labeling results can include entities, trigger words, and corresponding vectors from the sample statements. The predicted event information can include event information from the sample statements.

[0081] Taking the initial sequence labeling model, which consists of a pre-trained semantic representation layer, a bidirectional neural network layer, a graph vector layer, and an entity trigger word extraction layer connected in sequence, as an example, refer to... Figure 3 The sample statement can be input into an initial sequence labeling model and an initial text classification model, which are connected sequentially. The graph vector layer in the initial sequence labeling model outputs vectors corresponding to the sample statement, and the entity trigger word extraction layer extracts and outputs entities and trigger words from the sample statement. After the entity trigger word extraction layer outputs the entities and trigger words from the sample statement, it obtains the position vectors of each entity and each trigger word in the sample statement, and forms entity trigger word pairs based on the entities and trigger words. For each entity trigger word pair, following the order of the vectors corresponding to the sample statement output by the graph vector layer, the position vectors of the trigger words in the entity trigger word pair, and the position vectors of the entities in the entity trigger word pair, the vectors of the entities in the entity trigger word pair are concatenated to obtain multiple concatenated vectors. These concatenated vectors form a matrix, which is then input into the initial text classification model to obtain the predicted event information in the sample statement.

[0082] In an exemplary embodiment, when jointly training the initial sequence labeling model and the initial text classification model, in order to ensure that the training speed of the two models is consistent, weights corresponding to the initial sequence labeling model and the initial text classification model can be set respectively, namely, the first weight and the second weight. The first weight and the second weight can be dynamically adjusted according to the loss function values ​​corresponding to the two models respectively, so as to make the training speed of the two models consistent.

[0083] In an exemplary embodiment, a sample statement can be input into an initial sequence labeling model and an initial text classification model, which are sequentially connected. Then, the sequence labeling result output by the initial sequence labeling model, along with the sample event information corresponding to the sample statement, is substituted into the first loss function of the initial sequence labeling model to obtain a calculation result. This calculation result is then multiplied by the first weight of the initial sequence labeling model to obtain the first loss function value. Furthermore, the predicted event information output by the text classification model, along with the sample event information corresponding to the sample statement, is substituted into the second loss function of the initial text classification model to obtain a calculation result. This calculation result is then multiplied by the second weight of the initial text classification model to obtain the second loss function value. Finally, the coefficients of the initial sequence labeling model and the initial text classification model are adjusted by combining the first and second loss function values ​​to obtain the adjusted sequence labeling model and text classification model.

[0084] Furthermore, another sample statement can be input into the sequentially connected, coefficient-adjusted sequence labeling model and text classification model. The sequence labeling result output by the coefficient-adjusted sequence labeling model, along with the sample event information corresponding to the sample statement, is substituted into the first loss function to obtain the calculation result. This calculation result is then multiplied by the first weight to obtain another first loss function value. Similarly, the predicted event information output by the coefficient-adjusted text classification model, along with the sample event information corresponding to the sample statement, is substituted into the second loss function to obtain the calculation result. This calculation result is then multiplied by the second weight to obtain another second loss function value. Finally, by combining the new first and second loss function values, the coefficients of the coefficient-adjusted sequence labeling model and text classification model are further adjusted to obtain a further coefficient-adjusted sequence labeling model and text classification model.

[0085] Therefore, by continuously adjusting the coefficients of the initial sequence labeling model and the initial text classification model, the initial sequence labeling model and the initial text classification model are iteratively trained until the accuracy of the predicted event information output by the final initial text classification model meets the preset accuracy threshold. The training ends, and the trained sequence labeling model and text classification model are obtained.

[0086] It is understandable that during the training of the initial sequence labeling model and the text classification model, the training speeds of the two models may be inconsistent, resulting in a significant difference in the loss function values ​​of the two models after a period of training. In this embodiment, by setting the first weight of the initial sequence labeling model and the second weight of the initial text classification model, and dynamically adjusting the first and second weights in combination with the first and second loss function values, the difference between the first and second loss function values ​​obtained after adjusting the weights can be minimized, thereby achieving consistency between the training speed of the initial sequence labeling model and the initial text classification model.

[0087] For example, assuming the initial values ​​of the first and second weights are both 0.5, and the ratio of the first and second loss function values ​​is set to meet a preset range, such as between 0.9 and 1.1, then when the first loss function value is determined to be 100 and the second loss function value is 10, the second weight can be increased to keep the ratio of the first and second loss function values ​​within the preset range. Then, based on the adjusted first and second weights, the training of the initial sequence labeling model and the initial text classification model can continue.

[0088] In this embodiment of the application, the event information extraction device can be implemented using a trained sequence labeling model and a text classification model. Figure 1 The various steps in the illustrated embodiment. That is, as... Figure 3 As shown, when processing the statement "Group A: Announced on the evening of February 10, 2018, that Group B increased its holdings of the company's shares by 8,109,900 shares", the semantic representation layer of the trained sequence labeling model is used to obtain the vectors corresponding to each character in the statement. The bidirectional neural network layer and graph vector layer of the trained sequence labeling model are then used, combined with the vectors corresponding to each character, to obtain the vectors corresponding to the statement. Finally, the entity trigger word extraction layer of the trained sequence labeling model is used, combined with the vectors corresponding to the statement, to extract the entities and trigger words from the statement. After obtaining the position vector of each entity in the statement and the position vector corresponding to each trigger word, for each entity-trigger word pair, the vector corresponding to the statement output by the graph vector layer is concatenated with the position vectors of the trigger words and the entity in the statement to obtain multiple concatenated vectors. The matrix formed by these concatenated vectors is then input into the trained text classification model to obtain the roles of the entities in the statement, thus obtaining the following... Figure 3 The event information in the statement shown.

[0089] The event information extraction method of this application embodiment can obtain an initial sequence labeling model and an initial text classification model connected in sequence, and obtain training data. The training data includes sample sentences and corresponding sample event information. Then, using the sample sentences in the training data as input and the corresponding sample event information as output, the coefficients of the initial sequence labeling model and the initial text classification model are jointly adjusted by combining the predicted event information output by the initial classification model and the sample event information to achieve training. Thus, the initial sequence labeling model and the initial text classification model are trained. Because the initial sequence labeling model and the initial text classification model are jointly trained, the error propagation problem during the training process of the initial sequence labeling model and the initial text classification model can be avoided, improving the training effect of the model.

[0090] Figure 4 This is a schematic diagram of the event information extraction device provided in Embodiment 3 of this application.

[0091] like Figure 4 As shown, the event information extraction device 400 may include: a first acquisition module 410, a second acquisition module 420, a splicing module 430, and a third acquisition module 440.

[0092] The first acquisition module 410 is used to acquire the statement to be processed;

[0093] The second acquisition module 420 is used to input the statement into the sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement;

[0094] The concatenation module 430 is used to concatenate the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement for each entity trigger word pair, to obtain the concatenated vector.

[0095] The third acquisition module 440 is used to input multiple concatenated vectors into the text classification model to obtain event information in the sentence.

[0096] Furthermore, in one possible implementation of the embodiments of this application, in conjunction with reference to... Figure 5 ,exist Figure 4 Based on the embodiment shown, the event information extraction device may further include: a third acquisition module 450, a fourth acquisition module 460, and a training module 470.

[0097] The third acquisition module 450 is used to acquire the initial sequence labeling model and the initial text classification model that are connected sequentially.

[0098] The fourth acquisition module 460 is used to acquire training data, which includes: sample statements and corresponding sample event information;

[0099] The training module 470 is used to take sample sentences from the training data as input and the sample event information corresponding to the sample sentences as output. It combines the predicted event information output by the initial classification model and the sample event information to jointly adjust the coefficients of the initial sequence labeling model and the initial text classification model in order to achieve training.

[0100] Furthermore, in one possible implementation of this application embodiment, the initial sequence labeling model includes: a pre-trained semantic representation layer, a bidirectional neural network layer, a graph vector layer, and an entity trigger word extraction layer connected in sequence;

[0101] The semantic representation layer is used to obtain the vector corresponding to each word in the sentence.

[0102] The bidirectional neural network layer and graph vector layer are used to combine the vectors corresponding to each character to obtain the vector corresponding to the sentence;

[0103] The entity trigger word extraction layer is used to extract entities and trigger words from a statement by combining the vector corresponding to the statement.

[0104] Furthermore, in one possible implementation of this application embodiment, the training module 470 is specifically used for:

[0105] Using sample sentences from the training data as input and sample event information corresponding to the sample sentences as output, the coefficients of the last three layers of the semantic representation layer, the bidirectional neural network layer, the graph vector layer, the entity trigger word extraction layer, and the initial text classification model are jointly adjusted by combining the predicted event information and sample event information output by the initial classification model.

[0106] Furthermore, in one possible implementation of this application embodiment, the training module 470 is further used for:

[0107] The sample statement is input into the initial sequence labeling model and the initial text classification model, which are connected in sequence, to obtain the sequence labeling results output by the initial sequence labeling model and the predicted event information output by the initial text classification model.

[0108] The value of the first loss function is determined by combining the sequence labeling results, the sample event information corresponding to the sample sentences, the first loss function of the initial sequence labeling model, and the first weight of the initial sequence labeling model.

[0109] The value of the second loss function is determined by combining the predicted event information, the sample event information corresponding to the sample statement, the second loss function of the initial text classification model, and the second weight of the initial text classification model.

[0110] The coefficients of the initial sequence labeling model and the initial text classification model are adjusted by combining the values ​​of the first and second loss functions.

[0111] Furthermore, in one possible implementation of this application embodiment, the training module 470 is further used for:

[0112] By combining the first and second loss function values, the first and second weights are dynamically adjusted to achieve the same training speed for the initial sequence labeling model and the initial text classification model.

[0113] It should be noted that the explanations and descriptions in the aforementioned event information extraction method embodiments also apply to the event information extraction device of this embodiment, and will not be repeated here.

[0114] The event information extraction device of this application embodiment, after acquiring the statement to be processed, inputs the statement into a sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement. Then, for each entity-trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement are concatenated to obtain a concatenated vector. The multiple concatenated vectors are then input into a text classification model to obtain the event information in the statement. Thus, the event information in the statement is automatically extracted using a sequence labeling model and a text classification model, thereby reducing labor costs. Moreover, it can accurately extract event information from statements in different domain scenarios and has strong portability.

[0115] To implement the above embodiments, this application also proposes an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the event information extraction method as proposed in the foregoing embodiments of this application.

[0116] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the event information extraction method proposed in the foregoing embodiments of this application.

[0117] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the event information extraction method proposed in the foregoing embodiments of this application.

[0118] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present application is shown. Figure 6The electronic device 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0119] like Figure 6 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0120] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0121] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0122] Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0123] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this application.

[0124] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although... Figure 6 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0125] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0126] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0127] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0128] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0129] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0130] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0131] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0133] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for extracting event information, characterized in that, include: Get the statements to be processed; The statement is input into a sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement; For each entity trigger word pair, the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement are concatenated to obtain a concatenated vector. Each entity in the statement is combined with each trigger word to form an entity trigger word pair. Multiple concatenated vectors are input into a text classification model to obtain event information from the statement.

2. The event information extraction method according to claim 1, characterized in that, Before inputting the statement into the sequence labeling model, the following is also included: Obtain the initial sequence labeling model and the initial text classification model that are connected sequentially; Acquire training data, wherein the training data includes: sample statements and corresponding sample event information; Using sample sentences from the training data as input and sample event information corresponding to the sample sentences as output, the coefficients of the initial sequence labeling model and the initial text classification model are jointly adjusted by combining the predicted event information output by the initial text classification model and the sample event information to achieve training.

3. The event information extraction method according to claim 2, characterized in that, The initial sequence labeling model includes: a pre-trained semantic representation layer, a bidirectional neural network layer, a graph vector layer, and an entity trigger word extraction layer connected in sequence; The semantic representation layer is used to obtain the vector corresponding to each word in the statement; The bidirectional neural network layer and the graph vector layer are used to combine the vectors corresponding to each character to obtain the vector corresponding to the sentence; The entity trigger word extraction layer is used to extract entities and trigger words from the statement by combining the vector corresponding to the statement.

4. The event information extraction method according to claim 3, characterized in that, The step of taking sample sentences from the training data as input and the sample event information corresponding to the sample sentences as output, and jointly adjusting the coefficients of the initial sequence labeling model and the initial text classification model by combining the predicted event information output by the initial text classification model and the sample event information, includes: Using sample sentences from the training data as input and sample event information corresponding to the sample sentences as output, the coefficients of the last three layers of the semantic representation layer, the bidirectional neural network layer, the graph vector layer, the entity trigger word extraction layer, and the coefficients of the initial text classification model are jointly adjusted by combining the predicted event information output by the initial text classification model and the sample event information.

5. The event information extraction method according to claim 2, characterized in that, The step of taking sample sentences from the training data as input and the sample event information corresponding to the sample sentences as output, and jointly adjusting the coefficients of the initial sequence labeling model and the initial text classification model by combining the predicted event information output by the initial text classification model and the sample event information, includes: The sample statement is input into the initial sequence labeling model and the initial text classification model, which are connected in sequence, to obtain the sequence labeling results output by the initial sequence labeling model and the predicted event information output by the initial text classification model. The value of the first loss function is determined by combining the sequence labeling results, the sample event information corresponding to the sample statement, the first loss function of the initial sequence labeling model, and the first weight of the initial sequence labeling model. The value of the second loss function is determined by combining the predicted event information, the sample event information corresponding to the sample statement, the second loss function of the initial text classification model, and the second weight of the initial text classification model. The coefficients of the initial sequence labeling model and the initial text classification model are adjusted by combining the first loss function value and the second loss function value.

6. The event information extraction method according to claim 5, characterized in that, The step of taking sample sentences from the training data as input, taking sample event information corresponding to the sample sentences as output, and jointly adjusting the coefficients of the initial sequence labeling model and the initial text classification model by combining the predicted event information output by the initial text classification model and the sample event information, further includes: By combining the first loss function value and the second loss function value, the first weight and the second weight are dynamically adjusted to ensure that the training speed of the initial sequence labeling model is consistent with that of the initial text classification model.

7. An event information extraction device, characterized in that, include: The first acquisition module is used to acquire statements to be processed. The second acquisition module is used to input the statement into the sequence labeling model to obtain the vector corresponding to the statement, as well as the entities and trigger words in the statement; The concatenation module is used to concatenate the vector corresponding to the statement, the position vector of the trigger word in the statement, and the position vector of the entity in the statement for each entity trigger word pair to obtain a concatenated vector. Each entity in the statement is combined with each trigger word to form an entity trigger word pair. The third acquisition module is used to input multiple concatenated vectors into a text classification model to obtain event information in the statement.

8. The event information extraction device according to claim 7, characterized in that, Also includes: The third acquisition module is used to acquire the initial sequence labeling model and the initial text classification model that are connected sequentially. The fourth acquisition module is used to acquire training data, wherein the training data includes: sample statements and corresponding sample event information; The training module is used to take sample sentences from the training data as input, and the sample event information corresponding to the sample sentences as output. It combines the predicted event information output by the initial text classification model and the sample event information to jointly adjust the coefficients of the initial sequence labeling model and the initial text classification model to achieve training.

9. The event information extraction device according to claim 8, characterized in that, The initial sequence labeling model includes: a pre-trained semantic representation layer, a bidirectional neural network layer, a graph vector layer, and an entity trigger word extraction layer connected in sequence; The semantic representation layer is used to obtain the vector corresponding to each word in the statement; The bidirectional neural network layer and the graph vector layer are used to combine the vectors corresponding to each character to obtain the vector corresponding to the sentence; The entity trigger word extraction layer is used to extract entities and trigger words from the statement by combining the vector corresponding to the statement.

10. The event information extraction device according to claim 9, characterized in that, The training module is specifically used for: Using sample sentences from the training data as input and sample event information corresponding to the sample sentences as output, the coefficients of the last three layers of the semantic representation layer, the bidirectional neural network layer, the graph vector layer, the entity trigger word extraction layer, and the coefficients of the initial text classification model are jointly adjusted by combining the predicted event information output by the initial text classification model and the sample event information.

11. The event information extraction device according to claim 8, characterized in that, The training module is also used for: The sample statement is input into the initial sequence labeling model and the initial text classification model, which are connected in sequence, to obtain the sequence labeling results output by the initial sequence labeling model and the predicted event information output by the initial text classification model. The value of the first loss function is determined by combining the sequence labeling results, the sample event information corresponding to the sample statement, the first loss function of the initial sequence labeling model, and the first weight of the initial sequence labeling model. The value of the second loss function is determined by combining the predicted event information, the sample event information corresponding to the sample statement, the second loss function of the initial text classification model, and the second weight of the initial text classification model. The coefficients of the initial sequence labeling model and the initial text classification model are adjusted by combining the first loss function value and the second loss function value.

12. The event information extraction device according to claim 11, characterized in that, The training module is also used for: By combining the first loss function value and the second loss function value, the first weight and the second weight are dynamically adjusted to ensure that the training speed of the initial sequence labeling model is consistent with that of the initial text classification model.

13. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.