Event extraction, model training method and device, equipment and storage medium
By using a jointly trained neural network model to process the probability distribution of event trigger words and entity types, the problem of error propagation in event extraction in judicial scenarios is solved, and more efficient event extraction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA INNOVATION PRIVATE LIMITED
- Filing Date
- 2021-04-01
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, event extraction products suffer from error propagation problems in judicial scenarios, resulting in inefficient event extraction.
A first and second neural network, trained jointly, are used to process the probability distributions of event trigger word types and event entity types, respectively, to avoid error accumulation and improve extraction accuracy.
By using a jointly trained neural network model, the accuracy of event extraction is improved, ensuring accurate identification of event trigger words and entity types.
Smart Images

Figure CN115168530B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an event extraction, model training method, apparatus, device and storage medium. Background Technology
[0002] Smart justice provides powerful technological and data support for users, businesses, and institutions. The analysis of legal documents such as judgments, court transcripts, and original evidence materials is a crucial and fundamental capability in the application of natural language processing technology in smart justice.
[0003] The key to legal document analysis lies in reliable event extraction. In the existing technology, there is an event extraction product for judicial scenarios that uses a pipeline system to solve problems such as event type prediction, corresponding trigger word recognition, entity recognition, and semantic role recognition in sequence.
[0004] Specifically, this event extraction product categorizes events corresponding to trigger words, and then extracts entities and arguments based on the results of the event classification. However, this causes errors in the predictions made by the previous module to propagate to subsequent tasks without being corrected, thus hindering efficient event extraction. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an event extraction, model training method, apparatus, device, and storage medium to solve or alleviate the above-mentioned problems.
[0006] According to a first aspect of the present invention, an event extraction method is provided, comprising: acquiring subtext in an event description text; inputting the subtext into a first neural network and a second neural network in an event extraction model respectively, thereby obtaining a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types, wherein the first neural network and the second neural network are obtained through joint training; and extracting events from the event description text based at least on the first probability distribution and the second probability distribution.
[0007] According to a second aspect of the present invention, a model training method is provided, comprising: acquiring training samples, the training samples including event description text; jointly training an event extraction model based on at least subtext of the event description text as input, and event trigger word type labels of the subtext as output of a first neural network, and event entity type labels of the subtext as output of a second neural network, the event extraction model including the first neural network and the second neural network.
[0008] According to a third aspect of the present invention, an event extraction apparatus is provided, comprising: an acquisition module for acquiring subtext in an event description text; a model inference module for inputting the subtext into a first neural network and a second neural network in an event extraction model, respectively, to obtain a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types, wherein the first neural network and the second neural network are obtained through joint training; and an event extraction module for extracting events from the event description text based at least on the first probability distribution and the second probability distribution.
[0009] According to a fourth aspect of the present invention, a model training apparatus is provided, comprising: an acquisition module for acquiring training samples, the training samples including event description text; and a training module for jointly training an event extraction model based on at least subtext of the event description text as input, and based on event trigger word type labels of the subtext as output of a first neural network, and based on event entity type labels of the subtext as output of a second neural network, the event extraction model including the first neural network and the second neural network.
[0010] According to a fifth aspect of the present invention, an electronic device is provided, the device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, the executable instruction causing the processor to perform an operation corresponding to the method described in the first or second aspect.
[0011] According to a sixth aspect of the present invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in the first or second aspect.
[0012] In the embodiment of the present invention, since the first neural network and the second neural network are obtained through joint training, the first probability distribution of the subtext based on multiple event trigger word types is obtained through the first neural network, and the second probability distribution of the subtext based on multiple event entity types is obtained through the second neural network. This avoids the accumulation of errors caused by processing the event trigger word types and event entity types sequentially, thereby improving the accuracy of event extraction. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0014] Figure 1 A schematic diagram of a typical example of a judicial document service platform;
[0015] Figure 2 This is a schematic flowchart illustrating an event extraction method according to an embodiment of the present invention.
[0016] Figure 3 This is a schematic flowchart illustrating an event extraction method according to another embodiment of the present invention.
[0017] Figure 4 A schematic flowchart illustrating a model training method according to another embodiment of the present invention;
[0018] Figure 5 This is a schematic block diagram of an event extraction device according to another embodiment of the present invention;
[0019] Figure 6 A schematic block diagram of a model training apparatus according to another embodiment of the present invention; and
[0020] Figure 7 The hardware structure of an electronic device is shown in another embodiment of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.
[0022] The specific implementation of the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0023] Figure 1This diagram illustrates a typical example of a judicial document service platform. The analysis of documents such as judgments, court transcripts, and original evidence materials is crucial in the application of natural language processing (NLP) technology in intelligent justice. The judicial document service platform, built upon NLP technology, comprises upper-layer applications and lower-layer algorithms. The lower-layer algorithms accelerate the structured analysis of various factual content mentioned in the documents, forming the basis for upstream tasks such as judicial graph generation, intelligent text answering, and evidence chain generation. Upper-layer applications include case visualization, case summarization, fact chain generation, case prediction, case summary generation, and event knowledge question answering. Lower-layer algorithms include element extraction, event extraction, and database support such as knowledge bases.
[0024] Specifically, event extraction technology can extract independent sub-events containing time, people, locations, and descriptions from legal descriptive texts such as judgments and case files using natural language processing techniques such as sequence labeling. Based on the temporal relationships, common references, and causal relationships of these sub-events, it can organize them to form a case timeline and chain of evidence corresponding to the legal text. This helps users quickly clarify the facts of a case and understand its development. Therefore, event extraction is a crucial step in the analysis of judicial documents.
[0025] In the field of legal document parsing and analysis, the difficulty of event extraction is even greater due to the need for strong professional knowledge barriers and the combination of algorithms with the unique characteristics of documents.
[0026] In addition to legal document processing, event extraction is also widely used in other industries such as news and finance.
[0027] Figure 2 This is a schematic flowchart illustrating an event extraction method according to an embodiment of the present invention. The solution of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, tablets, etc.), and PCs. Figure 1 The event extraction methods include:
[0028] 210: Retrieves a subtext from the event description text.
[0029] It should be understood that event extraction in this text refers to presenting unstructured text containing event information in a structured form. Event extraction is applicable to many application scenarios, such as automatic summarization and automatic question-and-answer information retrieval.
[0030] It should also be understood that subtext can be a text sentence or a text character such as a word or sub.
[0031] 220: The subtext is input into the first neural network and the second neural network in the event extraction model respectively, and a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types are obtained accordingly, wherein the first neural network and the second neural network are obtained through joint training.
[0032] It should be understood that multiple event entity types can be constructed into an event entity type vector, which may include padding event entity types. Similarly, multiple event trigger word types can be implemented as an event trigger word vector, which may include padding event trigger word types.
[0033] It should also be understood that the dimensions of the first probability distribution and the second probability distribution can be different. The first or second probability distribution can be represented as a vector, for example, a first probability vector and a second probability vector. The elements in these probability vectors can be normalized or not.
[0034] It should also be understood that, as an example, in a judicial setting, the event description text may include judicial documents, wherein the multiple event entity types include at least two of the following: time, value, location, injured part, property, victim, subjective state, drugs, result, frequency, perpetrator, and sentencing factors.
[0035] It should also be understood that, as another example, the event description text may include legal documents, wherein the plurality of event trigger word types include at least two of social, property, official, and personal. The plurality of event trigger word types may include at least two of fraud, embezzlement, theft, robbery, extortion, sexual assault, violation of personal liberty, human trafficking, assault, traffic offenses, smuggling, tax evasion, mob violence, gambling, drug offenses, obscenity, obstruction of official duties, and bribery.
[0036] 230: At least based on the first probability distribution and the second probability distribution, perform event extraction on the event description text.
[0037] It should be understood that event extraction from the event description text can be performed based on the obtained event trigger words and event entities. For example, event extraction can be performed based on the obtained event trigger words and event entities, the order of multiple events can be determined, and the output event extraction result can be generated based on the order.
[0038] In the embodiment of the present invention, since the first neural network and the second neural network are obtained through joint training, the first probability distribution of the subtext based on multiple event trigger word types is obtained through the first neural network, and the second probability distribution of the subtext based on multiple event entity types is obtained through the second neural network. This avoids the accumulation of errors caused by processing the event trigger word types and event entity types sequentially, thereby improving the accuracy of event extraction.
[0039] Application Scenario 1: Penalty rules and complaint handling on e-commerce platforms;
[0040] When a customer files a complaint on an e-commerce platform, the platform obtains the text of the complaint content to be extracted. Then, the platform uses an event extraction model in a machine learning model to extract the complaint content text, resulting in a complaint event extraction result. The complaint event extraction result includes the complaint event trigger words and complaint event entities in the text to be extracted. The complaint event trigger words and complaint event entities are obtained by using the first probability distribution and the second probability distribution determined by the first neural network and the second neural network obtained through joint training of the event extraction model.
[0041] For example, a customer purchases product A from an online store on an e-commerce platform, with a 14-day no-questions-asked refund policy. However, upon receiving the package, the customer discovers that product A's actual effects are significantly different from those advertised in the online store. When the customer requests a refund, the online store consistently refuses. In this case, when the customer complains to the e-commerce platform, the platform can use the aforementioned event extraction model to extract text from the customer's complaint. During extraction, the event extraction model can determine the penalty rules applicable to the extracted complaint events, including the trigger words for the complaint events and the corresponding complaint event entities, and identify whether the online store infringed upon customer A's interests during the purchase. The e-commerce platform can then reasonably penalize the online store based on the penalty rules and the user's complaint.
[0042] Application Scenario 2: Lawyer's mock trial arguments;
[0043] Before the trial, lawyers can prepare the case information they need to defend. Then, they can use an event extraction model from a machine learning model to extract the case information, resulting in case extraction results. These results include case trigger words such as "harm" and "theft" from the text to be extracted, as well as entity information such as "time" and "location." The results may also include argument information such as "victim" and "perpetrator." The case trigger words and entities are obtained through a first probability distribution and a second probability distribution determined by a first neural network and a second neural network, respectively, obtained through joint training of the event extraction model.
[0044] For example, when a lawyer needs to defend Xiaoming, the victim in case A, the lawyer can use the event extraction model described in this article to analyze case A, determine which specific criminal acts are involved, which key elements are violated, and which rights of Xiaoming are infringed upon by the suspect. Based on the information obtained through the event extraction model, the lawyer can simulate possible arguments in court before the trial, thus enabling a targeted defense.
[0045] Application Scenario 3: The procuratorate formulates contingency plans;
[0046] Before initiating a public prosecution, the procuratorate can prepare the case content; then, it can use an event extraction model from a machine learning model to extract the case content, obtaining the case extraction results. The case extraction results include event trigger words such as "harm" and "theft," as well as entity information such as "time" and "location." The case extraction results may also include argument information such as "victim" and "perpetrator." The event trigger words and case entities are obtained through a first probability distribution and a second probability distribution determined by a first neural network and a second neural network jointly trained by the event extraction model.
[0047] When the procuratorate needs to initiate a public prosecution for a certain case, it can first use the aforementioned event extraction model to extract the case content. This involves identifying the criminal acts involved, which legal provisions these acts violate, the suspects and victims, and any statutory mitigating circumstances. This allows for the development of a preliminary plan before initiating prosecution, avoiding potential omissions of certain criminal acts or inaccurate sentencing.
[0048] Application Scenario 4: Corporate Legal Affairs;
[0049] Before launching a new business, the company's legal department can prepare the business content. Then, an event extraction model from machine learning is used to extract this content, resulting in extracted business content. This extracted content includes event trigger words such as "merger" and "acquisition," as well as entity information such as "time" and "location." It may also include argument information such as "acquirer" and "acquired party." The event trigger words and business entities are obtained through a first probability distribution and a second probability distribution determined by a first neural network and a second neural network, respectively, obtained through joint training of the event extraction model.
[0050] For example, when a company wants to launch a new business, its legal department can use the event extraction model mentioned above to extract the content of the new business, identify the legal risks involved, such as which laws the new business may violate, and thus avoid them in advance.
[0051] Application Scenario 5: Mediation and arbitration by neighborhood committees, public security bureaus, and other relevant departments;
[0052] Before mediating disputes between neighbors, the neighborhood committee can prepare the content of the dispute to be mediated. Then, it can use an event extraction model from a machine learning model to extract the dispute content, resulting in the extracted content. The extracted content includes event trigger words such as "disturbing the peace" and "occupying parking spaces," as well as entity information such as "time" and "location." The extracted content may also include argument information such as "the party whose interests are infringed" and "the party infringing on the interests of others." The event trigger words and event entities are obtained through a first probability distribution and a second probability distribution determined by a first neural network and a second neural network, respectively, obtained through joint training of the event extraction model.
[0053] For example, when the neighborhood committee mediates disputes between neighbors, it can use the aforementioned event extraction model to extract the content of the dispute. Based on the extraction results, it can determine which specific events caused the dispute, and who the parties involved in these events are, thus better mediating the relationship between the two parties.
[0054] Application Scenario 6: Check if the focus of the dispute has changed;
[0055] During the arguments between the defendant and plaintiff in court, court staff can record the arguments in real time. Then, an event extraction model within a machine learning model is used to extract the content of the arguments, resulting in extracted argument content. The extracted argument content includes event trigger words such as "harm" and "theft," as well as entity information such as "time" and "location." The extracted argument content may also include argument information such as "victim" and "perpetrator." The event trigger words and event entities are obtained through a first probability distribution and a second probability distribution determined by a first neural network and a second neural network, respectively, obtained through joint training of the event extraction model.
[0056] For example, in a court hearing, the judge can use the results of the argument extraction model to determine whether one side's lawyer is obscuring the focus of the argument, thereby improving the efficiency of the hearing.
[0057] In another implementation of the present invention, the subtext is text characters in the event description text, and the step of extracting events from the event description text based at least on the first probability distribution and the second probability distribution includes: merging characters according to the first probability distribution and the second probability distribution respectively to obtain event trigger words and event entities; and extracting events from the event description text based at least on the event trigger words and the event entities.
[0058] In another implementation of the present invention, obtaining subtext in the event description text includes: obtaining a text sentence in the event description text, the text sentence including the text character; the method further includes: inputting the text sentence into a third neural network in the event extraction model to obtain a third probability distribution of the text sentence based on multiple extraction event numbers, wherein the first neural network, the second neural network, and the third neural network are obtained through joint training; determining the number of extraction events corresponding to the text sentence according to the third probability distribution; and performing event extraction on the event description text at least based on the event trigger word and the event entity includes: performing event extraction on the event description text based on the event trigger word, the event entity, and the number of extraction events.
[0059] In another implementation of the present invention, obtaining the text sentences in the event description text includes: performing sentence segmentation on the event description text to obtain a plurality of text sentences; and inputting the sub-texts into the first neural network and the second neural network in the event extraction model respectively includes: determining the current text among the plurality of sub-texts; if the plurality of sub-texts have not been traversed, then inputting the current sub-text into the first neural network and the second neural network in the event extraction model respectively, until the plurality of sub-texts have been traversed.
[0060] In another implementation of the present invention, the step of extracting events from the event description text based on the event trigger word, the event entity, and the number of extracted events includes: extracting events based on the event trigger word, the event entity, and the number of extracted events to obtain multiple events in the event description text; and arranging the multiple events according to their chronological order to obtain the event extraction text.
[0061] In another implementation of the present invention, obtaining the text sentence in the event description text includes: inputting the event description text into a bidirectional codec model to obtain a text sentence including a sentence beginning marker and a sentence ending marker; and segmenting the portion of the text sentence between the sentence beginning marker and the sentence ending marker into the sub-text.
[0062] Figure 3 This is a schematic flowchart illustrating an event extraction method according to another embodiment of the present invention. The solution of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, tablets, etc.), and PCs. In this example, the operations of each step are illustrative and may include more or fewer steps, or alternative steps. Specifically,
[0063] In step S301, the factual description text is entered, and then the process proceeds to step S302.
[0064] In step S302, paragraphs are segmented, and then the process proceeds to step S303.
[0065] In step S303, determine whether the traversal has ended. If yes, proceed to step S304; if no, proceed to step S305.
[0066] In step S304, multiple events are arranged in chronological order.
[0067] In step S305, the event is extracted using the event extraction model, and then the process proceeds to step S306.
[0068] In step 306, one or more complete events are obtained.
[0069] Figure 4 This is a schematic flowchart illustrating a model training method according to another embodiment of the present invention. The solutions of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, tablets, etc.), and PCs. Figure 4 Model training methods include:
[0070] 410: Obtain training samples, which include event description text.
[0071] 420: At least based on the subtext of the event description text as input, and based on the event trigger word type label of the subtext as the output of the first neural network, and based on the event entity type label of the subtext as the output of the second neural network, the event extraction model is jointly trained, the event extraction model including the first neural network and the second neural network.
[0072] In another implementation of the present invention, the first neural network includes a first fully connected layer and a first normalized layer, the input of the first fully connected layer being connected to the input of the first normalized layer; the second neural network includes a second fully connected layer and a second normalized layer, the input of the second fully connected layer being connected to the input of the second normalized layer; the joint training of the event extraction model includes: determining a first loss function of the first neural network based at least on subtext of the event description text as input to the first fully connected layer and a first probability distribution label of the subtext corresponding to multiple event trigger word types as output of the first normalized layer; determining a second loss function of the second neural network based at least on the subtext as input to the second fully connected layer and a second probability distribution label of the subtext corresponding to multiple event entity types as output of the second normalized layer; and performing joint training at least by combining the loss function obtained by the first loss function and the second loss function.
[0073] In another implementation of the present invention, the event description text includes a text sentence, the subtext is a text character, the text sentence includes multiple text characters, the event extraction model further includes a third neural network, the joint training of the event extraction model further includes: determining a third loss function of the third neural network based on the text sentence as input and based on the number of extracted events corresponding to the text sentence, the joint training at least by combining the loss function obtained by the first loss function and the second loss function includes: joint training by combining the loss function obtained by the first loss function, the second loss function and the third loss function.
[0074] In another implementation of the present invention, the event extraction model includes a pre-trained model, and the joint training of the event extraction model further includes: adjusting the parameters of the training model based on the event description text as input and the text sentence obtained by adjusting through the loss function as output.
[0075] Specifically, the pre-trained language model mentioned in the text can be arbitrary. For example, the pre-trained model can be a Bidirectional Encoder Representation from Transformers (BERT) model. The BERT model is pre-trained on a large amount of corpus using a language model loss function and has achieved powerful results in a series of natural language processing (NLP) tasks.
[0076] Figure 5This is a schematic block diagram of an event extraction device according to another embodiment of the present invention. The solutions of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, tablets, etc.), and PCs. Figure 5 The event extraction device includes:
[0077] Get module 510, retrieve subtext from the event description text;
[0078] The model inference module 520 inputs the subtext into the first neural network and the second neural network in the event extraction model, respectively, and obtains the first probability distribution of the subtext based on multiple event trigger word types and the second probability distribution of the subtext based on multiple event entity types, wherein the first neural network and the second neural network are obtained through joint training;
[0079] The event extraction module 530 extracts events from the event description text based at least on the first probability distribution and the second probability distribution.
[0080] In the embodiment of the present invention, since the first neural network and the second neural network are obtained through joint training, the first probability distribution of the subtext based on multiple event trigger word types is obtained through the first neural network, and the second probability distribution of the subtext based on multiple event entity types is obtained through the second neural network. This avoids the accumulation of errors caused by processing the event trigger word types and event entity types sequentially, thereby improving the accuracy of event extraction.
[0081] In another implementation of the present invention, the event extraction module is specifically used to: merge characters according to the first probability distribution and the second probability distribution respectively to obtain event trigger words and event entities; and extract events from the event description text based at least on the event trigger words and the event entities.
[0082] In another implementation of the present invention, the acquisition module is specifically used to: acquire a text sentence in the event description text, the text sentence including the text characters; the model inference module is further used to: input the text sentence into a third neural network in the event extraction model to obtain a third probability distribution of the text sentence based on the number of extracted events, wherein the first neural network, the second neural network and the third neural network are obtained through joint training; determine the number of extracted events corresponding to the text sentence according to the third probability distribution; and the event extraction module is specifically used to: extract events from the event description text according to the event trigger word, the event entity and the number of extracted events.
[0083] In another implementation of the present invention, the acquisition module is specifically used to: perform sentence segmentation on the event description text to obtain multiple text sentences, and the model inference module is specifically used to: determine the current text among the multiple sub-texts; if the multiple sub-texts have not been traversed, then the current sub-text is input into the first neural network and the second neural network in the event extraction model respectively, until the multiple sub-texts are traversed.
[0084] In another implementation of the present invention, the event extraction module is specifically used to: extract events based on the event trigger word, the event entity, and the number of events to obtain multiple events in the event description text; and arrange the multiple events according to their time order to obtain the event extraction text.
[0085] In another implementation of the present invention, the acquisition module is specifically used to: input the event description text into a bidirectional codec model to obtain a text sentence including a sentence beginning marker and a sentence ending marker; and segment the portion of the text sentence between the sentence beginning marker and the sentence ending marker into the sub-text.
[0086] In another implementation of the present invention, the event description text is a judicial document, wherein the plurality of event entity types include at least two types among time, value, location, injured part, property, victim, subjective state, drugs, result, frequency, perpetrator and sentencing factors.
[0087] In another implementation of the present invention, the event description text is a judicial document, wherein the plurality of event trigger word types include at least two of social, property, official duties, and personal; or, the plurality of event trigger word types include at least two of fraud, embezzlement, theft, robbery, extortion, sexual assault, violation of personal freedom, human trafficking, assault, traffic offenses, smuggling, tax evasion, mob violence, gambling, drug offenses, obscenity, obstruction of official duties, and bribery.
[0088] The apparatus of this embodiment is used to implement the corresponding methods in the foregoing method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. Furthermore, the functional implementation of each module in the apparatus of this embodiment can be referred to the description of the corresponding part in the foregoing method embodiments, which will also not be repeated here.
[0089] Figure 6 This is a schematic block diagram of a model training apparatus according to another embodiment of the present invention. The solutions of this embodiment can be applied to any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, tablets, etc.), and PCs. Figure 6The model training apparatus includes:
[0090] The acquisition module 610 acquires training samples, wherein the training samples include event description text;
[0091] The training module 620, based at least on the subtext of the event description text as input, and based on the event trigger word type label of the subtext as the output of the first neural network, and based on the event entity type label of the subtext as the output of the second neural network, jointly trains the event extraction model, which includes the first neural network and the second neural network.
[0092] In another implementation of the present invention, the first neural network includes a first fully connected layer and a first normalized layer, the input of the first fully connected layer being connected to the input of the first normalized layer; the second neural network includes a second fully connected layer and a second normalized layer, the input of the second fully connected layer being connected to the input of the second normalized layer. The training module is specifically configured to: determine a first loss function for the first neural network based at least on subtext of the event description text as input to the first fully connected layer and a first probability distribution label of the subtext corresponding to multiple event trigger word types as output of the first normalized layer; and determine a second loss function for the second neural network based at least on the subtext as input to the second fully connected layer and a second probability distribution label of the subtext corresponding to multiple event entity types as output of the second normalized layer; and perform joint training at least by combining the loss function obtained by the first loss function and the second loss function.
[0093] In another implementation of the present invention, the event description text includes a text sentence, the subtext is a text character, and the text sentence includes multiple text characters. The event extraction model further includes a third neural network. The training module is further configured to: determine a third loss function for the third neural network based on the text sentence as input and based on the number of extracted events corresponding to the text sentence; and perform joint training by combining the first loss function, the second loss function, and the third loss function to obtain a loss function.
[0094] In another implementation of the invention, the event extraction model includes a pre-trained model. The training module is further configured to: adjust the parameters of the trained model based on the event description text as input and the text sentence obtained by adjusting the loss function as output.
[0095] Figure 7 The hardware structure of an electronic device according to another embodiment of the present invention; such as Figure 7As shown, the hardware structure of the electronic device may include: a processor 701, a communication interface 702, a storage medium 703, and a communication bus 704.
[0096] The processor 701, communication interface 702, and storage medium 703 communicate with each other through the communication bus 704.
[0097] Optionally, the communication interface 702 can be an interface of a communication module;
[0098] Specifically, the processor 701 can be configured to: acquire subtext from the event description text; input the subtext into a first neural network and a second neural network in the event extraction model, respectively, to obtain a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types, wherein the first neural network and the second neural network are obtained through joint training; and extract events from the event description text based at least on the first probability distribution and the second probability distribution.
[0099] Alternatively, a training sample is obtained, which includes event description text; at least the subtext of the event description text is used as input, and the event trigger word type label of the subtext is used as the output of the first neural network, and the event entity type label of the subtext is used as the output of the second neural network, and the event extraction model is jointly trained, which includes the first neural network and the second neural network.
[0100] The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), an On-Premises Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0101] The aforementioned storage media may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0102] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a storage medium, the computer program containing program code configured to perform the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined in the methods of this invention. It should be noted that the storage medium described in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access storage media (RAM), read-only storage media (ROM), erasable programmable read-only storage media (EPROM or flash memory), optical fibers, portable compact disk read-only storage media (CD-ROM), optical storage media, magnetic storage media, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any storage medium other than a computer-readable storage medium that can send, propagate, or transmit a program configured for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0103] Computer program code configured to perform the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0104] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions configured to perform a specified logical function. Specific sequences are present in the above specific embodiments, but these sequences are merely exemplary, and in actual implementations, these steps may be fewer, more, or executed in a different order. That is, in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0105] The modules described in the embodiments of this invention can be implemented in software or hardware. The names of these modules do not necessarily limit the module itself.
[0106] In another aspect, the present invention also provides a storage medium having a computer program stored thereon that, when executed by a processor, implements the method as described in the above embodiments.
[0107] In another aspect, the present invention also provides a storage medium, which may be included in the apparatus described in the above embodiments; or it may exist independently and not assembled into the apparatus. The storage medium carries one or more programs that, when executed by the apparatus, cause the apparatus to: acquire subtext from an event description text; input the subtext into a first neural network and a second neural network in an event extraction model, respectively, to obtain a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types, wherein the first neural network and the second neural network are obtained through joint training; and extract events from the event description text based at least on the first probability distribution and the second probability distribution.
[0108] Alternatively, a training sample is obtained, which includes event description text; at least the subtext of the event description text is used as input, and the event trigger word type label of the subtext is used as the output of the first neural network, and the event entity type label of the subtext is used as the output of the second neural network, and the event extraction model is jointly trained, which includes the first neural network and the second neural network.
[0109] The terms "first," "second," "first," or "second" as used in the various embodiments of this disclosure may modify various components regardless of their order and / or importance, but these terms do not limit the corresponding components. The above terms are configured only for the purpose of distinguishing an element from other elements. For example, "first user equipment" and "second user equipment" refer to different user equipments, although both are user equipment. For example, without departing from the scope of this disclosure, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element.
[0110] When a component (e.g., a first component) is referred to as being "(operably or communicatively) coupled" or "(operably or communicatively) coupled to" or "connected to" another component (e.g., a second component), it should be understood that the first component is directly connected to the second component or that the first component is indirectly connected to the second component via yet another component (e.g., a third component). Conversely, it can be understood that when a component (e.g., a first component) is referred to as being "directly connected" or "directly coupled" to another component (the second component), no component (e.g., a third component) is inserted between the two.
[0111] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. An event extraction method, comprising: Obtain subtext and text sentences from the event description text, wherein the subtext is text characters in the event description text, and the text sentences include the text characters; The subtext is input into the first neural network and the second neural network in the event extraction model, respectively, to obtain a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types. At least based on the first probability distribution and the second probability distribution, event trigger words and event entities are obtained. The text sentence is input into the third neural network in the event extraction model to determine the number of extracted events corresponding to the text sentence. The first neural network, the second neural network, and the third neural network are obtained through joint training. Based on the event trigger word, the event entity, and the number of events extracted, the event description text is used to extract events.
2. The method according to claim 1, wherein, The process of obtaining the event trigger word and event entity based at least on the first probability distribution and the second probability distribution includes: Based on the first probability distribution and the second probability distribution respectively, characters are merged to obtain the event trigger word and the event entity.
3. The method according to claim 1, wherein, The step of inputting the text sentence into the third neural network of the event extraction model to determine the number of extracted events corresponding to the text sentence includes: The text sentence is input into the third neural network to obtain a third probability distribution of the text sentence based on the number of multiple extracted events; The number of events to be extracted is determined based on the third probability distribution.
4. The method of claim 1, wherein, The step of obtaining the text sentence in the event description text includes: The event description text is segmented into sentences to obtain multiple text sentences. The step of inputting the subtext into the first neural network and the second neural network in the event extraction model includes: Determine the current text among the multiple sub-texts; If multiple subtexts have not been traversed, the current subtext is input into the first neural network and the second neural network in the event extraction model, respectively, until multiple subtexts have been traversed.
5. The method of claim 1, wherein, The step of extracting events from the event description text based on the event trigger word, the event entity, and the number of events extracted includes: Based on the event trigger word, the event entity, and the number of events extracted, event extraction is performed to obtain multiple events in the event description text; The event extraction text is obtained by arranging the multiple events in chronological order.
6. The method of claim 1, wherein, The step of obtaining subtext from the event description text includes: The event description text is input into a bidirectional codec model to obtain a text sentence including sentence beginning markers and sentence ending markers; The portion of the text sentence between the sentence beginning marker and the sentence ending marker is divided into sub-text.
7. A model training method, comprising: Obtain training samples, which include event description text; The event extraction model is jointly trained based on at least the subtext of the event description text as input, and the event trigger word type label of the subtext as the output of the first neural network, and the event entity type label of the subtext as the output of the second neural network. The event extraction model includes the first neural network and the second neural network, and the event extraction model is used to perform the event extraction method according to any one of claims 1 to 6.
8. The method of claim 7, wherein, The first neural network includes a first fully connected layer and a first normalized layer, with the input of the first fully connected layer connected to the input of the first normalized layer. The second neural network includes a second fully connected layer and a second normalized layer, with the input of the second fully connected layer connected to the input of the second normalized layer. The joint training of the event extraction model includes: The first loss function of the first neural network is determined by using at least a subtext of the event description text as input to the first fully connected layer, and using a first probability distribution label of the subtext corresponding to multiple event trigger word types as output to the first normalized layer; and The second loss function of the second neural network is determined based at least on the subtext as input to the second fully connected layer and on the second probability distribution labels of the subtext corresponding to multiple event entity types as output of the second normalization layer. At least the loss function obtained by combining the first loss function and the second loss function is jointly trained.
9. An event extraction device, comprising: The acquisition module acquires sub-text and text sentences from the event description text, wherein the sub-text is the text characters in the event description text, and the text sentences include the text characters; The model inference module inputs the subtext into the first and second neural networks in the event extraction model, respectively, to obtain a first probability distribution of the subtext based on multiple event trigger word types and a second probability distribution of the subtext based on multiple event entity types. Based at least on the first and second probability distributions, event trigger words and event entities are obtained. The text sentence is then input into the third neural network in the event extraction model to determine the number of extracted events corresponding to the text sentence. The first, second, and third neural networks are obtained through joint training. The event extraction module extracts events from the event description text based on the event trigger words, the event entities, and the number of events to be extracted.
10. A model training device, comprising: The acquisition module acquires training samples, which include event description text. The training module, based at least on the subtext of the event description text as input, and based on the event trigger word type label of the subtext as the output of the first neural network, and based on the event entity type label of the subtext as the output of the second neural network, jointly trains the event extraction model, the event extraction model including the first neural network and the second neural network, the event extraction model being used to execute the event extraction method according to any one of claims 1 to 6.
11. An electronic device, the device comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the method as described in any one of claims 1-8.
12. A storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-8.