Event element extraction method, device, electronic equipment and computer medium

Through deep bidirectional dynamic language model and joint training text classification model and event extraction model, event elements are automatically identified and extracted, solving the problem of inefficient acquisition of event elements by enterprises or individuals, and achieving large-scale and high-real-time event elements processing.

CN115017309BActive Publication Date: 2024-11-26SHENZHEN ROADSHOW TIME NETWORK DATA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210555549.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2024-11-26
Estimated Expiration
2042-05-19

Smart Images

  • Figure CN115017309B_ABST
    Figure CN115017309B_ABST
Patent Text Reader

Abstract

The present invention relates to an event element extraction method, device, electronic device and computer medium, comprising the steps of: obtaining at least one first event element text; determining a first marking result corresponding to each first event element text according to at least one first event element text; determining a first classification result corresponding to each first target text according to each first event element text with the first marking result as the first target text; determining a target extraction result corresponding to each second target text according to each first target text containing a preset event element as the second target text. The method solves the problem that enterprises or individuals are inefficient in obtaining online event elements and it is difficult to process these public event elements in large quantities and in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In order to better obtain useful event elements from industry news, encyclopedia knowledge and other texts, enterprises or individuals usually can only search for keywords on Baidu, and then browse through numerous web pages one by one to search for the event elements they want. The work efficiency is extremely low, and they have to browse a lot of useless information. More importantly, they need to hire professionals to analyze and refine the event elements in order to obtain the required event elements. Therefore, enterprises or individuals are inefficient in obtaining online event elements, and it is difficult to process these public event elements in large quantities and in real time. Summary of the invention

[0003] In order to overcome the problem that existing enterprises or individuals are inefficient in acquiring online event elements and it is difficult to process these public event elements in large quantities and in real time, the present invention provides an event element extraction method, device, electronic device and computer medium.

[0004] In a first aspect, in order to solve the above technical problem, the present invention provides an event element extraction method, comprising the following steps:

[0005] S1. Obtain at least one first event element text;

[0006] S2. Determine, according to at least one first event element text, a first marking result corresponding to each first event element text, where the first marking result is a weight corresponding to each word in the first event element text;

[0007] S3, determining a first classification result corresponding to each first target text according to each first event element text with the first marking result as the first target text, the first classification result being whether the first target text contains the preset event element or does not contain the preset event element;

[0008] S4. According to each first target text containing the preset event element as the second target text, determine the target extraction result corresponding to each second target text, where the target extraction result is the preset event element contained in the second target text.

[0009] The beneficial effect of an event element extraction method provided by the present invention is: when an enterprise or an individual needs to obtain a preset event element, first obtain the first event element text, and obtain the first marking result corresponding to the first event element text, and then use each first event element text with the first marking result as the first target text, and judge whether the first target text contains the preset event element. If it is judged that the first target text contains the preset event element, then use each first target text containing the preset event element as the second target text, and obtain the preset event element in the second target text. The present application can process the first event element text in large quantities, solving the problem of low efficiency in obtaining the preset event elements and difficulty in large-scale and high-real-time processing.

[0010] On the basis of the above technical solution, an event element extraction method of the present invention can also be improved as follows.

[0011] Further, the above step S2 specifically includes:

[0012] Inputting at least one first event element text into the deep bidirectional dynamic language model, and outputting a first tagging result corresponding to each first event element text through the deep bidirectional dynamic language model, wherein the first tagging result is a weight corresponding to each word in the first event element text;

[0013] Among them, the deep bidirectional dynamic language model is trained in the following way:

[0014] S11, obtaining at least one second event element text, each second event element text carrying a second marking result, and for each second event element text, the second marking result represents a weight corresponding to each word contained in the second event element text;

[0015] S12, taking at least one second event element text as a first training set, inputting it into a first initial model, and obtaining a first prediction labeling result for each second event element text in the first training set;

[0016] S13, for each second event element text in the first training set, determining a first loss value according to a first predicted labeling result and a second labeling result of the second event element text;

[0017] S14. Determine a first total loss value of the first initial model according to the first loss value corresponding to each second event element text in the first training set. If the first total loss value meets a preset first training end condition, use the first initial model that meets the first training end condition as a deep bidirectional dynamic language model. If the first total loss value does not meet the first training end condition, adjust the parameters of the first initial model and retrain the first initial model according to the adjusted parameters until the first total loss value of the first initial model meets the first training end condition.

[0018] The beneficial effect of adopting the above further scheme is: the first initial model is trained by the first training set to obtain a deep bidirectional dynamic language model, and the deep bidirectional dynamic language model is used to directly mark the acquired first event element text to obtain a first marking result, which can realize the marking work of the first event element text in large quantities.

[0019] Further, the first initial model includes 8 deep self-attention blocks connected in sequence, and the S12 includes:

[0020] S21, inputting each second event element text in the first training set into the first deep self-attention block, and obtaining a second prediction labeling result for each second event element text through the first deep self-attention block;

[0021] S22, taking the second deep self-attention block as the current module, and executing the following steps until the current module is the eighth deep self-attention block, and taking the third prediction labeling result of each second event element text output by the eighth self-attention module as the first prediction labeling result of each second event element text;

[0022] The following steps are as follows:

[0023] Input each second event element text into the current module, determine the third predicted marking result of each second event element text output by the current module, and each second event element text is a second event element text carrying the predicted marking result output by the previous module of the current module.

[0024] The beneficial effect of adopting the above further scheme is that the current module in the first initial model sequentially labels the predicted labeling results output by the previous module, thereby obtaining the parameter weights of the 8 deep self-attention blocks in the first initial model, and finally training to obtain a deep bidirectional dynamic language model. In the process of determining the first labeling result, the influence of the input and output of each deep self-attention block on the first labeling result can be considered, so that the determined first labeling result is more accurate.

[0025] Furthermore, the above S3 specifically includes:

[0026] Taking each first event element text with the first marking result as the first target text, inputting each first target text into the text classification model, and outputting the first classification result corresponding to each first target text through the text classification model, the first classification result being whether the first target text contains the preset event element or does not contain the preset event element;

[0027] The above S4 specifically includes:

[0028] Taking each first target text containing a preset event element as a second target text, inputting each second target text into an event extraction model, and determining a target extraction result corresponding to each second target text through the event extraction model, wherein the target extraction result is the preset event element contained in the second target text;

[0029] Among them, the text classification model and event extraction model are trained in a joint training manner:

[0030] S31, obtaining at least one third event element text, each third event element text carrying a third marking result, and for each third event element text, the third marking result represents a weight corresponding to each word in the third event element text;

[0031] S32, taking each third event element text with the third marking result as a second training sample, inputting it into the second initial model, and obtaining a first prediction classification result for each third event element text in the second training set, wherein for each third event element text, the first prediction classification result is whether the third event element text contains a preset event element or does not contain a preset event element;

[0032] S33, for each third event element text in the second training set, determining a second loss value according to the first prediction classification result and the third labeling result of the third event element text;

[0033] S34, obtaining at least one fourth event element text, each fourth event element text carrying a second classification result, and for each fourth event element text, the second classification result represents whether the fourth event element text contains a preset event element or does not contain a preset event element;

[0034] S35, taking each fourth event element text with the second classification result as a third training sample, inputting it into the third initial model, and obtaining a prediction extraction result of each fourth event element text in the third training set, wherein for each fourth event element text, the prediction extraction result is a preset event element contained in the fourth event element text;

[0035] S36, for each fourth event element text in the third training set, determining a third loss value according to the prediction extraction result and the second classification result of the fourth event element text;

[0036] S37. Determine the second total loss value according to the second loss value corresponding to each third event element text in the second training set and the third loss value corresponding to each fourth event element text in the third training set. If the second total loss value meets the preset second training end condition, the second initial model that meets the second training end condition is used as the text classification model, and the third initial model that meets the second training end condition is used as the event extraction model. If the second total loss value does not meet the training end condition, adjust the parameters of the second initial model and the third initial model, and re-train the second initial model and the third initial model according to the adjusted parameters until the second total loss value meets the second training end condition.

[0037] The beneficial effect of adopting the above further scheme is: the second initial model is trained by the second training sample to obtain a text classification model, and the text classification model can batch determine whether each first target text contains a preset event element. The third initial model is trained by the third training sample to obtain an event extraction model, and the event extraction model can batch extract the preset event elements from the second target text. For the text classification model and the event extraction model, a joint training method is adopted to train the text classification model and the event extraction model at the same time, thereby avoiding the error transmission caused by training the text classification model first and then training the event extraction model.

[0038] Further, the second initial model includes a first fully connected layer and a Softmax activation function layer connected in sequence, and the S32 includes:

[0039] S51, inputting each third event element text in the second training set into the first fully connected layer, and obtaining a word vector of each third event element text after linear mapping through the first fully connected layer for each third event element text in the second training set;

[0040] S52, input each word vector into the Softmax activation function layer, and obtain the first prediction classification result of each third event element text through the Softmax activation function layer.

[0041] The beneficial effect of adopting the above further scheme is that after each third event element text in the second training set passes through the first fully connected layer, the third event element text can be mapped into a set of word vectors, and then the word vectors are input into the Softmax activation function layer, so as to determine the probability that each word in the word vector is a preset event element.

[0042] Further, the third initial model includes a second fully connected layer and a Sigmoid activation function layer connected in sequence, and the S35 includes:

[0043] S61, inputting each fourth event element text in the third training set into the second fully connected layer, and for each fourth event element text in the third training set, obtaining the start position and end position of each word in each fourth event element text through the second fully connected layer;

[0044] S62, inputting the start position and the end position of each word into the Sigmoid activation function layer, and obtaining the prediction extraction result of each fourth event element text through the Sigmoid activation function layer.

[0045] The beneficial effect of adopting the above further scheme is that after each fourth event element text in the third training set is input into the second fully connected layer, the start position and end position of each fourth event element text can be determined, and then from the start position to the end position, the Sigmoid activation function layer is used to determine whether each word is a preset event element, and if so, the word is extracted.

[0046] In a second aspect, the present invention provides an event element extraction device, including an acquisition module, a marking module, a classification module and an extraction module;

[0047] An acquisition module, used for acquiring at least one first event element text;

[0048] A marking module, used to determine a first marking result corresponding to each first event element text according to at least one first event element text, wherein the first marking result is a weight corresponding to each word in the first event element text;

[0049] A classification module, used to determine a first classification result corresponding to each first target text based on each first event element text with a first marking result as a first target text, wherein the first classification result is whether the first target text contains a preset event element or does not contain the preset event element;

[0050] The extraction module is used to determine the target extraction result corresponding to each second target text according to each first target text containing the preset event element as the second target text, and the target extraction result is the preset event element contained in the second target text.

[0051] The beneficial effect of an event element extraction device provided by the present invention is: when an enterprise or an individual needs to obtain a preset event element, first obtain the first event element text, and obtain the first marking result corresponding to the first event element text, and then use each first event element text with the first marking result as the first target text, and judge whether the first target text contains the preset event element. If it is judged that the first target text contains the preset event element, then use each first target text containing the preset event element as the second target text, and obtain the preset event element in the second target text. The present application can process the first event element text in large quantities, solving the problem of low efficiency in obtaining the preset event elements and difficulty in large-scale and high-real-time processing.

[0052] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a program stored in the memory and running on the processor, wherein when the processor executes the program, the steps of an event element extraction method as described above are implemented.

[0053] In a fourth aspect, the present invention further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the steps of an event element extraction method as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0055] Figure 1 A schematic diagram of a flow chart of an event element extraction method according to an embodiment of the present invention;

[0056] Figure 2 The present invention is a schematic diagram of the structure of an event element extraction device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following examples are provided to further explain and supplement the present invention and do not constitute any limitation to the present invention.

[0058] The following describes an event element extraction method, device, electronic device and computer medium according to an embodiment of the present invention in conjunction with the accompanying drawings.

[0059] like Figure 1 As shown, an event element extraction method according to an embodiment of the present invention comprises the following steps:

[0060] S1. Obtain at least one first event element text.

[0061] In this embodiment, the first event element text may be a text such as industry news, encyclopedia knowledge, etc., wherein the first event element text contains preset event elements or does not contain preset event elements. The preset event elements can be set by users in different industries. For example, in the financial investment industry, the preset event elements may be financing rounds, investors, financing parties, financing amounts, and financing time, etc.

[0062] S2. Determine a first marking result corresponding to each first event element text according to at least one first event element text, where the first marking result is a weight corresponding to each word in the first event element text.

[0063] Specifically, this embodiment uses a deep bidirectional dynamic language model to obtain the first marking result of each first event element text.

[0064] Specifically, a word with a higher weight indicates that there is a greater probability that the word in the first event element text is a preset event element.

[0065] Optionally, a deep bidirectional dynamic language model is trained by:

[0066] S11, obtaining at least one second event element text, each second event element text carrying a second marking result, and for each second event element text, the second marking result represents a weight corresponding to each word contained in the second event element text;

[0067] S12, taking at least one second event element text as a first training set, inputting it into a first initial model, and obtaining a first prediction labeling result for each second event element text in the first training set;

[0068] S13, for each second event element text in the first training set, determining a first loss value according to a first predicted labeling result and a second labeling result of the second event element text;

[0069] S14. Determine a first total loss value of the first initial model according to the first loss value corresponding to each second event element text in the first training set. If the first total loss value meets a preset first training end condition, use the first initial model that meets the first training end condition as a deep bidirectional dynamic language model. If the first total loss value does not meet the first training end condition, adjust the parameters of the first initial model and retrain the first initial model according to the adjusted parameters until the first total loss value of the first initial model meets the first training end condition.

[0070] Optionally, the first initial model includes 8 deep self-attention blocks connected in sequence, and S12 includes:

[0071] S21, inputting each second event element text in the first training set into the first deep self-attention block, and obtaining a second prediction labeling result for each second event element text through the first deep self-attention block;

[0072] S22, taking the second deep self-attention block as the current module, and executing the following steps until the current module is the eighth deep self-attention block, and taking the third prediction labeling result of each second event element text output by the eighth self-attention module as the first prediction labeling result of each second event element text;

[0073] The following steps are as follows:

[0074] Input each second event element text into the current module, determine the third predicted marking result of each second event element text output by the current module, and each second event element text is a second event element text carrying the predicted marking result output by the previous module of the current module.

[0075] S3. Take each first event element text with the first marking result as the first target text, and determine the first classification result corresponding to each first target text. The first classification result is whether the first target text contains the preset event element or does not contain the preset event element.

[0076] Optionally, the deep bidirectional dynamic language model is trained in the above manner, which mainly plays two roles. One is dynamic whole-word masking, which is specially designed for Chinese tasks. Each word in the second event element text in the first training set is masked as a unit, which improves the training effect of the deep bidirectional dynamic language model. The dynamics mainly include the dynamic masking of tokens in the first training set and the dynamic masking of attention weights between tokens. The probability of masking the attention weights of tokens that are far apart is higher, which can improve the robustness of the deep bidirectional dynamic language model and reduce the interference of distant entities on the current entity relationship extraction in downstream tasks. The second is the second event element text in the first training set, which can increase the difficulty of the task and improve the semantic understanding ability of the deep bidirectional dynamic language model.

[0077] Specifically, a text classification model is used to determine whether the first target text contains a preset event element.

[0078] S4. According to each first target text containing a preset event element as the second target text, a target extraction result corresponding to each second target text is determined, where the target extraction result is the preset event element contained in the second target text.

[0079] Specifically, an event extraction model is used to extract preset event elements in the second target text.

[0080] Specifically, in this embodiment, the text classification model and the event extraction model are trained by joint training, as follows:

[0081] S31, obtaining at least one third event element text, each third event element text carrying a third marking result, and for each third event element text, the third marking result represents a weight corresponding to each word in the third event element text;

[0082] S32, taking each third event element text with the third marking result as a second training sample, inputting it into the second initial model, and obtaining a first prediction classification result for each third event element text in the second training set, wherein for each third event element text, the first prediction classification result is whether the third event element text contains a preset event element or does not contain a preset event element;

[0083] S33, for each third event element text in the second training set, determining a second loss value according to the first prediction classification result and the third labeling result of the third event element text;

[0084] S34, obtaining at least one fourth event element text, each fourth event element text carrying a second classification result, and for each fourth event element text, the second classification result represents whether the fourth event element text contains a preset event element or does not contain a preset event element;

[0085] S35, taking each fourth event element text with the second classification result as a third training sample, inputting it into the third initial model, and obtaining a prediction extraction result of each fourth event element text in the third training set, wherein for each fourth event element text, the prediction extraction result is a preset event element contained in the fourth event element text;

[0086] S36, for each fourth event element text in the third training set, determining a third loss value according to the prediction extraction result and the second classification result of the fourth event element text;

[0087] S37. Determine the second total loss value according to the second loss value corresponding to each third event element text in the second training set and the third loss value corresponding to each fourth event element text in the third training set. If the second total loss value meets the preset second training end condition, the second initial model that meets the second training end condition is used as the text classification model, and the third initial model that meets the second training end condition is used as the event extraction model. If the second total loss value does not meet the training end condition, adjust the parameters of the second initial model and the third initial model, and re-train the second initial model and the third initial model according to the adjusted parameters until the second total loss value meets the second training end condition.

[0088] Optionally, in this embodiment, the second loss value is recorded as Le, the third loss value is recorded as Lr, and the second total loss value is recorded as L. As an example, the second total loss value may be

[0089] L=0.4*Lr+0.6*Le. The second training end condition can be set based on actual needs. For example, the second total loss value is less than the set threshold, or the number of training times reaches the set number of times. The use of the above second training end condition can greatly increase the generalization ability of text classification model training and event extraction model training.

[0090] like Figure 2 As shown, an event element extraction device according to an embodiment of the present invention includes an acquisition module 201, a marking module 202, a classification module 203 and an extraction module 204;

[0091] An acquisition module 201 is used to acquire at least one first event element text;

[0092] The marking module 202 is used to determine a first marking result corresponding to each first event element text according to at least one first event element text, where the first marking result is a weight corresponding to each word in the first event element text;

[0093] The classification module 203 is used to determine a first classification result corresponding to each first target text according to each first event element text with the first marking result as the first target text, wherein the first classification result is whether the first target text contains the preset event element or does not contain the preset event element;

[0094] The extraction module 204 is used to determine the target extraction result corresponding to each second target text according to each first target text containing the preset event element as the second target text, and the target extraction result is the preset event element contained in the second target text.

[0095] Optionally, the function implemented by the above-mentioned marking module 202 can be implemented by a deep bidirectional dynamic language model. The device also includes a first model training module, which is used to train the deep bidirectional dynamic language model in the following manner:

[0096] S11, obtaining at least one second event element text, each of which carries a second marking result, and for each of which, the second marking result represents a weight corresponding to each word contained in the second event element text;

[0097] S12, taking at least one of the second event element texts as a first training set, inputting it into a first initial model, and obtaining a first prediction labeling result for each of the second event element texts in the first training set;

[0098] S13, for each second event element text in the first training set, determining a first loss value according to a first predicted labeling result and a second labeling result of the second event element text;

[0099] S14. Determine a first total loss value of the first initial model according to the first loss value corresponding to each of the second event element texts in the first training set; if the first total loss value satisfies a preset first training end condition, use the first initial model that satisfies the first training end condition as the deep bidirectional dynamic language model; if the first total loss value does not meet the first training end condition, adjust the parameters of the first initial model, and retrain the first initial model according to the adjusted parameters until the first total loss value of the first initial model meets the first training end condition.

[0100] Optionally, the first initial model includes eight deep self-attention blocks connected in sequence, and the device further includes a first prediction module, which is used to obtain a first prediction labeling result in the following manner:

[0101] S21, inputting each second event element text in the first training set into the first deep self-attention block, and obtaining a second prediction labeling result for each second event element text through the first deep self-attention block;

[0102] S22, taking the second deep self-attention block as the current module, and executing the following steps until the current module is the eighth deep self-attention block, and taking the third prediction labeling result of each second event element text output by the eighth self-attention module as the first prediction labeling result of each second event element text;

[0103] The following steps are as follows:

[0104] Input each second event element text into the current module, determine the third predicted marking result of each second event element text output by the current module, and each second event element text is a second event element text carrying the predicted marking result output by the previous module of the current module.

[0105] Optionally, the function implemented by the above-mentioned marking module 203 can be implemented by a text classification model and an event extraction model, and the device also includes a second model training module, which is used to train the text classification model and the event extraction model in the following manner:

[0106] S31, obtaining at least one third event element text, each third event element text carrying a third marking result, and for each third event element text, the third marking result represents a weight corresponding to each word in the third event element text;

[0107] S32, taking each third event element text with the third marking result as a second training sample, inputting it into the second initial model, and obtaining a first prediction classification result for each third event element text in the second training set, wherein for each third event element text, the first prediction classification result is whether the third event element text contains a preset event element or does not contain a preset event element;

[0108] S33, for each third event element text in the second training set, determining a second loss value according to the first prediction classification result and the third labeling result of the third event element text;

[0109] S34, obtaining at least one fourth event element text, each fourth event element text carrying a second classification result, and for each fourth event element text, the second classification result represents whether the fourth event element text contains a preset event element or does not contain a preset event element;

[0110] S35, taking each fourth event element text with the second classification result as a third training sample, inputting it into the third initial model, and obtaining a prediction extraction result of each fourth event element text in the third training set, wherein for each fourth event element text, the prediction extraction result is a preset event element contained in the fourth event element text;

[0111] S36, for each fourth event element text in the third training set, determining a third loss value according to the prediction extraction result and the second classification result of the fourth event element text;

[0112] S37. Determine the second total loss value according to the second loss value corresponding to each third event element text in the second training set and the third loss value corresponding to each fourth event element text in the third training set. If the second total loss value meets the preset second training end condition, the second initial model that meets the second training end condition is used as the text classification model, and the third initial model that meets the second training end condition is used as the event extraction model. If the second total loss value does not meet the training end condition, adjust the parameters of the second initial model and the third initial model, and re-train the second initial model and the third initial model according to the adjusted parameters until the second total loss value meets the second training end condition.

[0113] Optionally, the second initial model includes a first fully connected layer and a Softmax activation function layer connected in sequence, and the device also includes a second prediction module, which is used to obtain the first prediction classification result in the following manner:

[0114] S51, inputting each third event element text in the second training set into the first fully connected layer, and obtaining a word vector of each third event element text after linear mapping through the first fully connected layer for each third event element text in the second training set;

[0115] S52, input each word vector into the Softmax activation function layer, and obtain the first prediction classification result of each third event element text through the Softmax activation function layer.

[0116] Optionally, the third initial model includes a second fully connected layer and a Sigmoid activation function layer connected in sequence, and the device also includes a third prediction module, which is used to obtain the prediction extraction result in the following manner:

[0117] S61, inputting each fourth event element text in the third training set into the second fully connected layer, and for each fourth event element text in the third training set, obtaining the start position and end position of each word in each fourth event element text through the second fully connected layer;

[0118] S62, inputting the start position and the end position of each word into the Sigmoid activation function layer, and obtaining the prediction extraction result of each fourth event element text through the Sigmoid activation function layer.

[0119] The above-mentioned parameters and steps for each unit module to implement corresponding functions in an event element extraction device of the present invention can refer to the parameters and steps in the embodiment of an event element extraction method above, and will not be repeated here.

[0120] An electronic device according to an embodiment of the present invention comprises a memory, a processor and a program stored in the memory and running on the processor, wherein the processor implements part or all of the steps of the above-mentioned event element extraction method when executing the program.

[0121] Among them, the electronic device can be a computer, a mobile phone, etc. Correspondingly, its program is a computer software or a mobile phone APP, etc., and the above-mentioned parameters and steps in an electronic device of the present invention can refer to the parameters and steps in the embodiment of an event element extraction method above, which will not be repeated here.

[0122] A specific embodiment of this embodiment:

[0123] For users in the financial investment industry, the preset event elements are financing rounds, investors, financing parties, financing amounts, and financing time. A piece of industry news or encyclopedia knowledge is obtained as the first event element text, for example, "Investor XXX, financing amount XX yuan." The first event element text is input into the deep bidirectional dynamic language model, and the deep bidirectional dynamic language model outputs the weight corresponding to each word in the first event element text, that is, the first marking result. The first event element text with the first marking result is then used as the first target text, and the first target text is input into the text classification model. The text classification model determines that the first event element text contains the preset event elements ("Investor XXX", "Financing amount XX yuan"), and then the first target text is used as the second target text, and the second target text is input into the event extraction model. The event extraction model extracts the preset event elements ("Investor XXX", "Financing amount XX yuan") in the second target text.

[0124] In order to better summarize and organize the extracted preset event elements, the extracted preset event elements are mapped into standardized element names according to the lookup table and preset rules. The lookup table can be constructed based on the company's own organization name and project name. For each entity in the lookup table, the Word2Vec algorithm is used to train in encyclopedia knowledge and industry news. Finally, each entity in the lookup table will have its own word vector. In the actual mapping, for the financing party and the investor, the name matching method is first used to perform string matching from the lookup table. The entity name in the lookup table must contain the preset event element name. If there is no match, the entity is inserted into the lookup table. If a preset event element matches multiple entities in the lookup table, the input text used for event extraction will be segmented, and then the vectors of each word will be added and averaged to obtain the vector of the text. The cosine distance between this vector and the vector of each matched entity will be calculated one by one, and the entity with the closest distance will be selected as the mapping result. The financing round, financing time, and financing financial form are relatively simple and can be directly stored in the database after regularization. Based on the above, the extracted preset event elements are mapped into standardized element names according to the preset lookup table and preset rules. That is, in this embodiment, the extracted preset event elements are summarized as "Investor XXX financing amount XX yuan", and finally the summarized data is stored in the preset lookup table for users to search.

[0125] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above.

[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0127] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for extracting event elements, characterized in that: The following steps are involved: S1. Obtain at least one first event element text; S2. Determine, according to at least one of the first event element texts, a first marking result corresponding to each of the first event element texts, wherein the first marking result is a weight corresponding to each word in the first event element text; S3, taking each of the first event element texts with the first marking result as the first target text, and determining the first classification result corresponding to each of the first target texts, wherein the first classification result is whether the first target text contains the preset event element or does not contain the preset event element; S4, taking each of the first target texts containing a preset event element as a second target text, and determining a target extraction result corresponding to each of the second target texts, wherein the target extraction result is the preset event element contained in the second target text; The S3 specifically includes: Taking each of the first event element texts with the first marking result as the first target text, inputting each of the first target texts into a text classification model, and outputting a first classification result corresponding to each of the first target texts through the text classification model, wherein the first classification result is whether the first target text contains a preset event element or does not contain a preset event element; The S4 specifically includes: Taking each of the first target texts containing preset event elements as the second target text, inputting each of the second target texts into the event extraction model, and determining the target extraction result corresponding to each of the second target texts through the event extraction model, wherein the target extraction result is the preset event element contained in the second target text; The text classification model and the event extraction model are trained in a joint training manner: S31, obtaining at least one third event element text, each of which carries a third marking result, and for each of which, the third marking result represents a weight corresponding to each word in the third event element text; S32, taking each of the third event element texts with the third marking result as a second training sample, inputting it into a second initial model, and obtaining a first prediction classification result for each of the third event element texts in the second training set, wherein for each of the third event element texts, the first prediction classification result is whether the third event element text contains a preset event element or does not contain a preset event element; S33, for each of the third event element texts in the second training set, determining a second loss value according to the first prediction classification result and the third labeling result of the third event element text; S34, obtaining at least one fourth event element text, each of which carries a second classification result, and for each of which, the second classification result indicates whether the fourth event element text contains a preset event element or does not contain a preset event element; S35, taking each of the fourth event element texts with the second classification result as a third training sample, inputting it into a third initial model, and obtaining a prediction extraction result of each of the fourth event element texts in the third training set, wherein for each of the fourth event element texts, the prediction extraction result is the preset event element contained in the fourth event element text; S36, for each of the fourth event element texts in the third training set, determining a third loss value according to the prediction extraction result and the second classification result of the fourth event element text; S37. Determine a second total loss value according to the second loss value corresponding to each of the third event element texts in the second training set and the third loss value corresponding to each of the fourth event element texts in the third training set. If the second total loss value meets the preset second training end condition, the second initial model that meets the second training end condition is used as the text classification model, and the third initial model that meets the second training end condition is used as the event extraction model. If the second total loss value does not meet the training end condition, adjust the parameters of the second initial model and the third initial model, and retrain the second initial model and the third initial model according to the adjusted parameters until the second total loss value meets the second training end condition.

2. The method according to claim 1, characterized in that The step S2 specifically includes: Inputting at least one of the first event element texts into a deep bidirectional dynamic language model, and outputting a first tagging result corresponding to each of the first event element texts through the deep bidirectional dynamic language model, wherein the first tagging result is a weight corresponding to each word in the first event element text; The deep bidirectional dynamic language model is trained in the following way: S11, obtaining at least one second event element text, each of which carries a second marking result, and for each of which, the second marking result represents a weight corresponding to each word contained in the second event element text; S12, taking at least one of the second event element texts as a first training set, inputting it into a first initial model, and obtaining a first prediction labeling result for each of the second event element texts in the first training set; S13, for each second event element text in the first training set, determining a first loss value according to a first predicted labeling result and a second labeling result of the second event element text; S14. Determine a first total loss value of the first initial model according to the first loss value corresponding to each of the second event element texts in the first training set; if the first total loss value satisfies a preset first training end condition, use the first initial model that satisfies the first training end condition as the deep bidirectional dynamic language model; if the first total loss value does not meet the first training end condition, adjust the parameters of the first initial model, and retrain the first initial model according to the adjusted parameters until the first total loss value of the first initial model meets the first training end condition.

3. The method according to claim 2, characterized in that The first initial model includes 8 deep self-attention blocks connected in sequence, and S12 includes: S21, inputting each of the second event element texts in the first training set into a first deep self-attention block, and obtaining a second prediction labeling result for each of the second event element texts through the first deep self-attention block; S22, taking the second deep self-attention block as the current module, and performing the following steps until the current module is the eighth deep self-attention block, and taking the third prediction labeling result of each second event element text output by the eighth self-attention module as the first prediction labeling result of each second event element text; The following steps include: Input each second event element text into the current module, determine the third predicted marking result of each second event element text output by the current module, and each second event element text is a second event element text carrying the predicted marking result output by the previous module of the current module.

4. The method according to claim 1, characterized in that: The second initial model includes a first fully connected layer and a Softmax activation function layer connected in sequence, and S32 includes: S51, inputting each of the third event element texts in the second training set into the first fully connected layer, and obtaining, for each of the third event element texts in the second training set, a word vector after linear mapping of each of the third event element texts through the first fully connected layer; S52, inputting each of the word vectors into the Softmax activation function layer, and obtaining a first prediction classification result for each of the third event element texts through the Softmax activation function layer.

5. The method according to claim 1, characterized in that The third initial model includes a second fully connected layer and a Sigmoid activation function layer connected in sequence, and S35 includes: S61, inputting each of the fourth event element texts in the third training set into the second fully connected layer, and for each of the fourth event element texts in the third training set, obtaining the start position and the end position of each word in each of the fourth event element texts through the second fully connected layer; S62, inputting the start position and the end position of each word into the Sigmoid activation function layer, and obtaining the prediction extraction result of each fourth event element text through the Sigmoid activation function layer.

6. An event element extraction device, characterized in that: It includes acquisition module, marking module, classification module and extraction module; The acquisition module is used to acquire at least one first event element text; The marking module is used to determine a first marking result corresponding to each first event element text according to at least one first event element text, wherein the first marking result is a weight corresponding to each word in the first event element text; The classification module is used to determine a first classification result corresponding to each of the first target texts based on each of the first event element texts with the first marking result as the first target text, wherein the first classification result is whether the first target text contains a preset event element or does not contain a preset event element; The extraction module is used to determine a target extraction result corresponding to each of the first target texts containing the preset event elements as the second target text, wherein the target extraction result is the preset event elements contained in the second target text; The classification module is specifically used for: Taking each of the first event element texts with the first marking result as the first target text, inputting each of the first target texts into a text classification model, and outputting a first classification result corresponding to each of the first target texts through the text classification model, wherein the first classification result is whether the first target text contains a preset event element or does not contain a preset event element; The extraction module is specifically used for: Taking each of the first target texts containing preset event elements as the second target text, inputting each of the second target texts into the event extraction model, and determining the target extraction result corresponding to each of the second target texts through the event extraction model, wherein the target extraction result is the preset event element contained in the second target text; The text classification model and the event extraction model are trained in a joint training manner: S31, obtaining at least one third event element text, each of which carries a third marking result, and for each of which, the third marking result represents a weight corresponding to each word in the third event element text; S32, taking each of the third event element texts with the third marking result as a second training sample, inputting it into a second initial model, and obtaining a first prediction classification result for each of the third event element texts in the second training set, wherein for each of the third event element texts, the first prediction classification result is whether the third event element text contains a preset event element or does not contain a preset event element; S33, for each of the third event element texts in the second training set, determining a second loss value according to the first prediction classification result and the third labeling result of the third event element text; S34, obtaining at least one fourth event element text, each of which carries a second classification result, and for each of which, the second classification result indicates whether the fourth event element text contains a preset event element or does not contain a preset event element; S35, taking each of the fourth event element texts with the second classification result as a third training sample, inputting it into a third initial model, and obtaining a prediction extraction result of each of the fourth event element texts in the third training set, wherein for each of the fourth event element texts, the prediction extraction result is the preset event element contained in the fourth event element text; S36, for each of the fourth event element texts in the third training set, determining a third loss value according to the prediction extraction result and the second classification result of the fourth event element text; S37. Determine a second total loss value according to the second loss value corresponding to each of the third event element texts in the second training set and the third loss value corresponding to each of the fourth event element texts in the third training set. If the second total loss value meets the preset second training end condition, the second initial model that meets the second training end condition is used as the text classification model, and the third initial model that meets the second training end condition is used as the event extraction model. If the second total loss value does not meet the training end condition, adjust the parameters of the second initial model and the third initial model, and retrain the second initial model and the third initial model according to the adjusted parameters until the second total loss value meets the second training end condition.

7. An electronic device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the steps of an event element extraction method as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the steps of an event element extraction method as described in any one of claims 1 to 5.