Event information extraction method and event information extraction device
By combining deep learning and syntactic analysis into an event extraction model, the problems of low recall and high computational cost in existing technologies are solved, achieving more efficient event information extraction.
Patent Information
- Application Number
- CN202211648974.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-12-21
AI Technical Summary
In the existing technology, the event extraction method based on syntactic analysis has a low recall rate and cannot accurately locate event arguments. The event extraction method based on deep learning has a long calculation cycle and high cost, resulting in low overall accuracy and recall rates.
By combining an event extraction model based on deep learning and syntactic analysis, the target sentence is input into both the deep learning and syntactic analysis models, and the event information output by both models is merged to form a more accurate event extraction result.
It improves the accuracy and recall of event extraction, addresses the shortcomings of a single model, and achieves more efficient event information extraction.
Smart Images

Figure CN115965003B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of event information extraction, and particularly relates to an event information extraction method and an event information extraction device. BACKGROUND
[0002] Information extraction directly extracts factual information from natural language texts and describes the information in a structured form to provide a powerful tool for information acquisition. Event extraction is an important part of information extraction, which extracts factual information from unstructured texts and saves the information in a structured form for subsequent analysis and application, and has a wide range of applications in automatic summarization, automatic question answering, information retrieval and other fields. In recent years, with the rapid development of computer technology and the Internet, more and more information is stored and processed in computers in the form of electronic documents. Therefore, how to more accurately extract event information has become an important research topic in the field. SUMMARY
[0003] The embodiments of the present application provide an event information extraction method and an event information extraction device, which can more accurately extract event information.
[0004] The embodiments of the present application provide an event information extraction method and an event information extraction device, which can more accurately extract event information.
[0005] In some embodiments, the first event argument includes at least two groups of first key-value pairs, the first key-value pair including a first key and a first value, the third event argument includes at least two groups of third key-value pairs, the third key-value pair including a third key and a third value, the first key and the first value, the third key and the third value correspond one-to-one; merging the first event argument and the third event argument to obtain a fourth event argument, including: comparing a plurality of first keys and a plurality of third keys; in the case that any first key is equal to any third key, determining that the corresponding third key-value pair is a fourth key-value pair; in the case that any first key is not equal to a plurality of third keys, determining that the corresponding first key-value pair is a fourth key-value pair; determining that a set of a plurality of fourth key-value pairs is a fourth event argument.
[0006] In some embodiments, before the target sentence is input into the deep learning-based event extraction model for event information extraction, the event information extraction method further includes: obtaining text data, the text data including valid sentences and annotation information of the valid sentences, the valid sentences including a plurality of unit characters, the annotation information including at least one annotation type, a plurality of annotation triggers, and a plurality of annotation arguments, each annotation type corresponding to at least one annotation trigger, and the annotation trigger corresponding to at least one annotation argument; vectorizing the valid sentences to obtain corresponding vector information, the vector information including a plurality of word-mixed vectors corresponding to the plurality of unit characters, and a plurality of position vectors corresponding to positions of the plurality of unit characters in the valid sentences; and performing convolution on the annotation information and the vector information to obtain the deep learning-based event extraction model.
[0007] In some embodiments, the convolution on the annotation information and the vector information to obtain the deep learning-based event extraction model includes: performing dilated gate convolution on the vector information to obtain a corresponding encoding sequence; inputting the encoding sequence into a first self-attention mechanism to perform convolution to obtain at least one event type and a plurality of triggers, each event type corresponding to at least one trigger; selecting a first selected trigger from the plurality of triggers, the first selected trigger being included in the plurality of annotation triggers; obtaining a vector sequence corresponding to the first selected trigger according to the first selected trigger; obtaining a plurality of event arguments corresponding to the first selected trigger according to the encoding sequence and the vector sequence, the trigger corresponding to at least one event argument; and obtaining the deep learning-based event extraction model in the case that the at least one event type, the plurality of triggers, and the plurality of event arguments correspond to the at least one annotation type, the plurality of annotation triggers, and the plurality of annotation arguments, respectively.
[0008] In some embodiments, according to the first selection trigger word, obtaining the vector sequence corresponding to the first selection trigger word comprises: obtaining a subsequence corresponding to the first selection trigger word according to the first selection trigger word and the encoding sequence; inputting the subsequence into a long short-term memory network to obtain a corresponding encoding vector; obtaining a position vector of the first selection trigger word; and obtaining the corresponding vector sequence according to the encoding vector and the position vector.
[0009] In some embodiments, according to the encoding sequence and the vector sequence, obtaining the plurality of event arguments comprises: inputting the encoding sequence into a second self-attention mechanism; and performing convolution on the vector sequence and the encoding sequence input into the second self-attention mechanism to obtain the plurality of event arguments.
[0010] In some embodiments, before inputting the target sentence into the syntax-based event extraction model to extract event information, the event information extraction method further comprises: obtaining at least one extraction type, a plurality of extraction trigger words, and a plurality of extraction arguments, each extraction type corresponding to at least one extraction trigger word, and the extraction trigger word corresponding to at least one extraction argument; concatenating the plurality of extraction trigger words corresponding to each extraction type according to the extraction type to obtain an extraction trigger word list; performing entity extraction on the valid sentence to obtain an entity word list, the entity word list comprising a plurality of entities corresponding to a plurality of unit characters; and obtaining the syntax-based event extraction model according to the extraction trigger word list and the entity word list.
[0011] In some embodiments, before inputting the target sentence into the syntax-based event extraction model to extract event information, the event information extraction method further comprises: inputting the extraction trigger word list into a first model to obtain an extraction trigger word vector list; wherein the extraction trigger word vector list comprises a plurality of extraction trigger word vectors, each extraction trigger word vector corresponding to an extraction event type.
[0012] In some embodiments, obtaining the syntax-based event extraction model according to the extraction trigger word list and the entity word list comprises: obtaining a second selection trigger word included in the extraction trigger word list and the entity word list according to the extraction trigger word list and the entity word list, determining that the second selection trigger word is a trigger word; determining whether the second selection trigger word corresponds to a plurality of extraction types; in the case that the second selection trigger word corresponds to the plurality of extraction types, inputting the valid sentence into the first model to obtain a valid sentence vector; calculating a cosine similarity of the valid sentence vector and the plurality of extraction trigger word vectors; and determining that an extraction event type corresponding to an extraction trigger word vector with the largest cosine similarity is the event type.
[0013] In some embodiments, after determining whether the second selected trigger word corresponds to multiple extraction types, the event extraction model based on the syntax analysis is obtained according to the extraction trigger word list and the entity word list, and further includes: in a case where the second selected trigger word does not correspond to multiple extraction event types, determining that the extraction type corresponding to the second selected trigger word is an event type.
[0014] In some embodiments, the event extraction model based on the syntax analysis is obtained according to the extraction trigger word list and the entity word list, and further includes: determining whether the second selected trigger word is a verb; in a case where the second selected trigger word is a verb, obtaining, according to the syntax dependency tree, multiple first dependency words within a two-degree dependency range of the second selected trigger word; and in a case where the multiple first dependency words include any entity or the multiple entities contain any first dependency word, determining that the entity is an event argument.
[0015] In some embodiments, after determining whether the second selected trigger word is a verb, the event extraction model based on the syntax analysis is obtained according to the extraction trigger word list and the entity word list, and further includes: in a case where the second selected trigger word is not a verb, obtaining, according to the syntax dependency tree, multiple one-degree dependency words within a one-degree dependency range of the second selected trigger word; determining, according to the syntax dependency tree, that a one-degree dependency word closest to the second selected trigger word in the multiple one-degree dependency words is a second dependency word, and the second dependency word is a verb; obtaining, according to the syntax dependency tree, multiple third dependency words within a three-degree dependency range of the second dependency word; and in a case where the multiple third dependency words include any entity or the multiple entities contain any third dependency word, determining that the entity is an event argument.
[0016] In some embodiments, the event extraction model based on the syntax analysis is obtained according to the extraction trigger word list and the entity word list, and further includes: in a case where at least one event type, multiple trigger words and multiple event arguments correspond to at least one extraction type, multiple extraction trigger words and multiple extraction arguments respectively, the event extraction model based on the syntax analysis is obtained.
[0017] In another aspect, an event information extraction device is provided. The device comprises a first extraction module configured to input a target sentence into a deep learning-based event extraction model to extract event information to obtain first event information, the first event information comprising a first event type, a first trigger word, and a first event argument; and in a case where the first trigger word is different from a second trigger word, input the first trigger word into a syntax analysis-based event extraction model to obtain third event information, the third event information comprising a third event argument. The device further comprises a second extraction module configured to input the target sentence into the syntax analysis-based event extraction model to extract event information to obtain second event information, the second event information comprising a second event type, a second trigger word, and a second event argument. The device further comprises a merging module configured to merge the first event argument and the third event argument to obtain a fourth event argument. The device further comprises an output module configured to output the second event information and fourth event information, the fourth event information comprising the first event type, the first trigger word, and the fourth event argument.
[0018] In yet another aspect, an electronic device is provided. The electronic device comprises a processor and a memory storing computer program instructions. The processor implements the event information extraction method as described above when executing the computer program instructions.
[0019] In yet another aspect, a computer readable storage medium is provided. The computer readable storage medium stores computer program instructions. The computer program instructions are executed by a processor to implement the event information extraction method as described above.
[0020] The event information extraction method provided by the embodiments of the present application extracts event information by inputting a target sentence into a deep learning-based event extraction model and a syntax analysis-based event extraction model, respectively, to obtain first event information and second event information. In a case where a first trigger word of the first event information is different from a second trigger word of the second event information, the first trigger word is input into the syntax analysis-based event extraction model to obtain third event information. The first event argument of the first event information and the third event argument of the third event information are merged to obtain a fourth event argument of fourth event information. Finally, the fourth event information is output. The embodiments of the present application combine the deep learning-based event extraction model and the syntax analysis-based event extraction model to more accurately extract events. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0022] Figure 1 is a structural schematic diagram of an event information extraction device according to an embodiment of the present application;
[0023] Figure 2 is a flowchart of an event information extraction method according to an embodiment of the present application;
[0024] Figure 3 shows Figure 2 is an exemplary schematic diagram of some steps in the flowchart shown;
[0025] Figure 4 shows Figure 2 is an exemplary schematic diagram of some steps in the flowchart shown;
[0026] Figure 5 shows Figure 4 is an exemplary schematic diagram of some steps in the flowchart shown;
[0027] Figure 6 shows Figure 5 is an exemplary schematic diagram of some steps in the flowchart shown;
[0028] Figure 7 shows Figure 5 is an exemplary schematic diagram of some steps in the flowchart shown;
[0029] Figure 8 shows Figure 2 is an exemplary schematic diagram of some steps in the flowchart shown;
[0030] Figure 9 shows Figure 8 is an exemplary schematic diagram of some steps in the flowchart shown;
[0031] Figure 10 shows Figure 8 is an exemplary schematic diagram of some steps in the flowchart shown;
[0032] Figure 11 shows Figure 10 is an exemplary schematic diagram of some steps in the flowchart shown;
[0033] Figure 12 shows Figure 8 is another exemplary schematic diagram of some steps in the flowchart shown.
[0034] In the drawings:
[0035] 100 - event information extraction device; 1 - first extraction module; 2 - second extraction module; 3 - merging module; 4 - output module. DETAILED DESCRIPTION
[0036] In order to enable every intended person to understand the above objects, features and advantages of the present application more clearly, the schemes according to the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0037] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other different manners from those described herein; obviously, the embodiments described in the specification are only a part of the embodiments of the present application, and not all the embodiments.
[0038] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in the embodiments of the present application should be understood as the usual meanings understood by the persons skilled in the art to which the embodiments of the present application belong.
[0039] In addition, the technical terms "first", "second" and the like are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified and limited.
[0040] In the description of the embodiments of the present application, unless otherwise explicitly specified and limited, the technical terms "mounting", "connection", "connection", "fixing" and the like should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integral; it can be mechanical connection, or electrical connection; it can be direct connection, or indirect connection through an intermediate medium, or internal communication of two elements or interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0041] In the related art, the event extraction method is mainly divided into event extraction based on syntactic analysis and event extraction based on deep learning. In the event extraction based on syntactic analysis, since an event often includes multiple trigger words, the event is obtained only by trigger word matching, which cannot be combined with semantics, resulting in low recall rate; and in the case that a same trigger word corresponds to multiple event types, only one event type can be randomly selected from the multiple event types; and the position of the event argument in the sentence cannot be accurately located according to the trigger word. And in the event extraction based on deep learning, since the algorithm model needs a large amount of manually annotated data, the calculation period is long and the cost is high; the event extraction based on deep learning is the joint extraction of event type, trigger word and event argument, and the algorithm error is transmitted step by step, resulting in low overall accuracy and recall rate.
[0042] In view of this, the embodiment of the present application provides an event information extraction method, which extracts event information by inputting the obtained target sentence into a deep learning-based event extraction model and a syntax analysis-based event extraction model, obtains first event information and second event information, inputs the first trigger word into the syntax analysis-based event extraction model for processing to obtain third event information in the case where the first trigger word of the first event information is different from the second trigger word of the second event information, merges the first event argument of the first event information and the third event argument of the third event information to obtain a fourth event argument of fourth event information, and finally outputs the fourth event information. The embodiment of the present application can more accurately extract events by combining the deep learning-based event extraction model and the syntax analysis-based event extraction model.
[0043] Figure 1 FIG. 1 is a structural schematic diagram of an event information extraction device 100 according to an embodiment of the present application. As shown in FIG. 1, the event information extraction device 100 comprises a first extraction module 1, a second extraction module 2, a merging module 3 and an output module 4. Figure 1
[0044] The first extraction module 1 inputs the target sentence into the deep learning-based event extraction model to extract event information to obtain first event information, the first event information comprising a first event type, a first trigger word and a first event argument, and inputs the first trigger word into the syntax analysis-based event extraction model to process to obtain third event information in the case where the first trigger word is different from the second trigger word. The second extraction module 2 inputs the target sentence into the syntax analysis-based event extraction model to extract event information to obtain second event information, the second event information comprising a second event type, a second trigger word and a second event argument. The merging module 3 merges the first event argument and the third event argument to obtain a fourth event argument. The output module 4 outputs the second event information and the fourth event information, the fourth event information comprising the first event type, the first trigger word and the fourth event argument.
[0045] Figure 2 FIG. 2 is a flowchart of an event information extraction method according to an embodiment of the present application. As shown in FIG. 2, the event information extraction method comprises the following steps. Figure 2
[0046] S100, obtaining a target sentence.
[0047] S200, inputting the target sentence into a deep learning-based event extraction model to extract event information to obtain first event information, the first event information comprising a first event type, a first trigger word and a first event argument.
[0048] S300, input the target sentence into the syntax analysis based event extraction model to extract event information, and obtain second event information, the second event information including a second event type, a second trigger word, and a second event argument.
[0049] S400, in the case where the first trigger word is different from the second trigger word, input the first trigger word into the syntax analysis based event extraction model for processing, and obtain third event information, the third event information including a third event argument.
[0050] S500, merge the first event argument and the third event argument to obtain a fourth event argument.
[0051] S600, output fourth event information, the fourth event information including a first event type, a first trigger word, and a fourth event argument.
[0052] In step S100, the event information extraction device 100 can obtain the target sentence from other modules, devices or equipment connected thereto, or from a server. In the case of obtaining the target sentence from the server, the event information extraction device 100 can communicate with the server through any module having communication function to receive the target sentence. In one example, the event information extraction device 100 can first obtain text data, and then process the text data according to certain rules, for example, separate multiple sentences in the text data according to the full stop to obtain multiple target sentences.
[0053] In step S200, after obtaining the target sentence, the target sentence is input into the first extraction module 1, the first extraction module 1 including a deep learning based event extraction model to extract event information from the target sentence to obtain first event information. The first event information includes a first event type, a first trigger word and a first event argument. The event type is the category of the event occurring in the target sentence, the event trigger word is the core word indicating the occurrence of the event, and the event argument is the participant of the event. One event type can correspond to multiple trigger words, and one trigger word can correspond to multiple event arguments. In the case of obtaining the trigger word, the event type can be determined by the trigger word, and the event argument can be obtained by the trigger word. Therefore, in the first event information, the first event argument can include multiple objects.
[0054] In step S300, similar to step S200, the target sentence is input into the second extraction module 2, the second extraction module 2 including a syntax analysis based event extraction model to extract event information from the target sentence to obtain second event information. Similar to the first event information, the second event information includes a second event type, a second trigger word and a second event argument.
[0055] In step S400, in the case that the target sentence input the first extraction module 1 and the second extraction module 2 obtains different trigger words, it is explained that the first event information and the second event information obtained by the event extraction model based on deep learning and the event extraction model based on syntax analysis may not correspond to each other. Since one event type can correspond to multiple trigger words, in one example, the first trigger word and the second trigger word are different, but the event type corresponding to the first trigger word and the second trigger word is the same, in another example, the first trigger word and the second trigger word are different, and the event types corresponding to the two are also different. Since one trigger word can correspond to multiple event arguments, multiple objects in the event arguments of the first event information and the second event information can at least partially overlap or have no overlap. In order to integrate the event information extracted by the event extraction model based on deep learning and the event extraction model based on syntax analysis, the event type and the event argument can be obtained again according to the trigger word, that is, the trigger word obtained by one of the event extraction models is input into the other model to obtain new event information. In the embodiment of the present application, the first trigger word is input into the second extraction module 2 again, and the third event information is obtained by the event extraction model based on syntax analysis. In the case that the first trigger word is determined, the third event information includes the first event type, the first trigger word and the third event argument, wherein the third event argument can also include multiple objects.
[0056] In step S500, the first event argument and the third event argument are merged by the merging module 3 to obtain the fourth event argument. Since the first event argument and the third event argument both include multiple objects, in one example, the multiple objects can completely overlap, in another example, the multiple objects can at least partially overlap, and in another example, the multiple objects can not overlap at all. Since the first event argument and the third event argument are obtained by inputting the first trigger word into the event extraction model based on deep learning and the event extraction model based on syntax analysis respectively, that is, the target sentence is input into the two event extraction models for integrated extraction, the first event argument and the third event argument are merged to obtain the event argument that can completely reflect the event participant objects under the first trigger word, that is, the fourth event argument.
[0057] In step S600, the fourth event information is output by the output module 4, and the fourth event information includes the first event type, the first trigger word and the fourth event argument. The fourth event information is obtained by inputting the target sentence into the event extraction model based on deep learning and the event extraction model based on syntax analysis. Therefore, the fourth event information is the more accurate event extraction information.
[0058] Figure 3 It is shown Figure 2An exemplary schematic diagram of some steps in the flowchart is shown. As Figure 3 As shown, in the embodiment of the present application, step S500 includes the following steps.
[0059] S510, compare the plurality of first keys and the plurality of third keys.
[0060] S520, in the case where any first key is equal to any third key, determine the corresponding third key-value pair as the fourth key-value pair.
[0061] S530, in the case where any first key is not equal to the plurality of third keys, determine the corresponding first key-value pair as the fourth key-value pair.
[0062] S540, determine the set of the plurality of fourth key-value pairs as the fourth event argument.
[0063] The first event argument includes at least two groups of first key-value pairs, the first key-value pair includes a first key and a first value, the third event argument includes at least two groups of third key-value pairs, the third key-value pair includes a third key and a third value, the first key and the first value, the third key and the third value are one-to-one corresponding. Since the event argument is a dictionary structure including a plurality of key-value pairs, the first event argument, the second event argument, the third event argument and the obtained fourth event argument all include a plurality of key-value pairs, that is, a plurality of event participant objects. Each key-value pair includes two positions, a key position and a value position, the key position can be regarded as an index of the data numbered in the list, and the value position can be regarded as data in the list. In an example, the key position can be related to the nature of the value position data.
[0064] In step S510, the event information extraction device 100 can further include a comparison module to compare the plurality of first keys and the plurality of third keys, that is, to compare whether the index of the key position in the plurality of first key-value pairs and the plurality of third key-value pairs is the same.
[0065] In step S520, in the case where any first key is equal to any third key, the corresponding third key-value pair is determined as the fourth key-value pair. That is, in the case where the key position index of the first key and the third key in any first key-value pair and third key-value pair is the same, the current key position index can be taken as the key position of the fourth key-value pair, that is, the fourth key, and the data of the third value in the third key-value pair is taken as the fourth value, thereby obtaining the fourth key-value pair. In the case where the key positions are the same, the third key-value pair is taken as the fourth key-value pair, so that the event argument obtained by inputting the first trigger word into the syntax analysis-based event extraction model is merged into the fourth event argument.
[0066] In step S530, when any first key is not equal to a plurality of third keys, the corresponding first key-value pair and the third key value are determined to be two fourth key-value pairs. That is to say, in the first key-value pair and the third key-value pair, if there are different key position superscripts, that is, when the first key and the plurality of third keys are all different, the key position superscript of the current first key can be used as the key position of the fourth key-value pair, that is, the fourth key, and at the same time, the data of the first value in the first key-value pair is used as the fourth value, thereby obtaining the fourth key-value pair. In the case of different key positions, the first key-value pair is used as the fourth key-value pair, so that the event argument obtained by inputting the first trigger word into the event extraction model based on deep learning is merged into the fourth event argument.
[0067] In step S540, at this time, the fourth event argument includes all key-value pairs obtained by the first trigger word input based on the event extraction model based on deep learning and the event extraction model based on syntactic analysis, and thus includes all event arguments that can fully reflect the event participating objects.
[0068] Optionally, step S520 and step S530 may be performed in the order described above, or may be performed in an alternate order or simultaneously, and this embodiment of the present application does not impose any limitation on this.
[0069] Figure 4 Shown Figure 2 An exemplary schematic diagram of the flow diagram shown in FIG. Figure 4 As shown, in an embodiment of the present application, before step S200, the method for extracting event information further includes the following steps to train an event extraction model based on deep learning.
[0070] S01. Obtain text data.
[0071] S02. Vectorize the valid statements to obtain corresponding vector information.
[0072] S03. Convolve the annotation information and vector information to obtain an event extraction model based on deep learning.
[0073] In step S01, the event information extraction device 100 can obtain text data from other modules, devices, or equipment connected thereto, or can obtain text data from a server. The text data includes valid sentences and annotation information for the valid sentences. The annotation information includes at least one annotation type, multiple annotation trigger words, and multiple annotation arguments. Each annotation type corresponds to at least one annotation trigger word, and each annotation trigger word corresponds to at least one annotation argument. In other words, the text data can be manually annotated information. In the case of manual annotating, the text data is divided into multiple valid sentences, each of which includes corresponding annotation information.
[0074] In step S02, the valid sentence is vectorized to obtain corresponding vector information. The valid sentence includes a plurality of unit characters, and the vector information includes a plurality of word-mixed vectors corresponding to the plurality of unit characters, and a plurality of position vectors corresponding to positions of the plurality of unit characters in the valid sentence. The word-mixed vector can be regarded as a mixed sequence of a word vector of a word in which the unit character is located in the valid sentence and a character vector corresponding to the unit character, and the word vector and the character vector can be combined with each other through matrix transformation. The position vector can be regarded as a vector obtained according to the position of the unit character in the valid sentence. The position vector can be combined with the word-mixed vector to obtain the vector information.
[0075] In step S03, the annotation information and the vector information are convolved to obtain the event extraction model based on deep learning.
[0076] Figure 5 An exemplary schematic diagram of some steps in the flowchart is shown. Figure 4 As shown, in the embodiment of the present application, step S03 includes the following steps. Figure 5
[0077] S031, the vector information is dilated gate convolution to obtain a corresponding encoding sequence.
[0078] S032, the encoding sequence is input to the first self-attention mechanism to obtain at least one event type and a plurality of trigger words, each event type corresponding to at least one trigger word.
[0079] S033, a first selected trigger word is selected from the plurality of trigger words, and the first selected trigger word is included in the plurality of labeled trigger words.
[0080] S034, according to the first selected trigger word, a vector sequence corresponding to the first selected trigger word is obtained.
[0081] S035, according to the encoding sequence and the vector sequence, a plurality of event arguments are obtained, and the trigger word corresponds to at least one event argument.
[0082] S036, in the case that the at least one event type, the plurality of trigger words and the plurality of event arguments correspond to the at least one labeled type, the plurality of labeled trigger words and the plurality of labeled arguments respectively, an event extraction model based on deep learning is obtained.
[0083] In step S031, dilated gate convolution (DGCNN, Dilate Gated Convolutional Neural Network) is a convolution method combining dilated convolution and gate convolution, which encodes the vector information through dilated gate convolution to obtain an encoding sequence.
[0084] In step S032, the self-attention mechanism is an attention mechanism between input elements or between output elements. The encoded sequence is input into a layer of self-attention mechanism for convolution to obtain at least one event type and a plurality of trigger words.
[0085] In step S033, a first selected trigger word is selected, which is included in the trigger words obtained in step S032 and the annotated trigger words. Alternatively, the first selected trigger word is obtained by random sampling from the plurality of trigger words.
[0086] In step S034, a vector sequence corresponding to the first selected trigger word is obtained, which can be a combination of an encoded vector corresponding to the first selected trigger word and a position vector of the first selected trigger word.
[0087] In step S035, a plurality of event arguments are obtained according to the encoded sequence obtained in step S031 and the vector sequence obtained in step S034.
[0088] In step S036, when the at least one event type, the plurality of trigger words, and the plurality of event arguments correspond to the at least one annotated type, the plurality of annotated trigger words, and the plurality of annotated arguments respectively, it can be considered that the training of the deep learning-based event extraction model reaches the expected training effect, and thus the deep learning-based event extraction model can be obtained.
[0089] Figure 6 An example of some steps in the flowchart is shown. Figure 5 As shown, in the embodiment of the present application, step S034 includes the following steps. Figure 6
[0090] S0341, obtaining a subsequence corresponding to the first selected trigger word according to the first selected trigger word and the encoded sequence.
[0091] S0342, inputting the subsequence into a long short-term memory network to obtain a corresponding encoded vector.
[0092] S0343, obtaining a position vector of the first selected trigger word.
[0093] S0344, obtaining a corresponding vector sequence according to the encoded vector and the position vector.
[0094] In step S0341, a subsequence corresponding to the first selected trigger word is obtained according to the first selected trigger word and the encoded sequence.
[0095] In step S0342, a long short-term memory (LSTM) network is a variant of a recurrent neural network that can continuously pass relevant information during sequence processing to overcome the influence of short-term memory. The subsequence is input into the LSTM network to obtain the corresponding encoding vector.
[0096] In step S0343, the position vector of the first selected trigger word corresponding to the position in the valid sentence is obtained.
[0097] In step S0344, the encoding vector obtained in step S0342 and the position vector obtained in step S0343 may be concatenated to obtain a vector sequence.
[0098] Figure 7 Shown Figure 5 An exemplary schematic diagram of some steps in the flowchart shown in FIG. Figure 7 As shown, in the embodiment of the present application, step S035 includes the following steps.
[0099] S0351. Input the encoded sequence into the second self-attention mechanism.
[0100] S0352. Convolve the vector sequence and the encoding sequence input into the second sub-attention mechanism to obtain multiple event arguments.
[0101] In step S0351, the encoded sequence is input into another layer of self-attention mechanism.
[0102] In step S0352, convolution is performed on the vector sequence and the encoding sequence obtained from the first selected trigger word to obtain the event argument.
[0103] Figure 8 Shown Figure 2 An exemplary schematic diagram of the flow diagram shown in FIG. Figure 8 As shown, in the embodiment of the present application, before step S200, the method for extracting event information further includes the following steps to train the event extraction model based on syntactic analysis.
[0104] S04. Obtain at least one extraction type, multiple extraction trigger words, and multiple extraction arguments, where each extraction type corresponds to at least one extraction trigger word, and each extraction trigger word corresponds to at least one extraction argument.
[0105] S05. According to the extraction type, multiple extraction trigger words corresponding to each extraction type are concatenated to obtain an extraction trigger word list.
[0106] S06. Entity extraction is performed on the valid sentence to obtain an entity word list, where the entity word list includes multiple entities corresponding to multiple unit characters.
[0107] S07. According to the extracted trigger word list and entity word list, an event extraction model based on syntactic analysis is obtained.
[0108] In step S04 , the obtained at least one extraction type, multiple extraction trigger words, and multiple extraction arguments may be regarded as a dictionary for obtaining extraction types, and each extraction type dictionary includes an extraction trigger word dictionary and an extraction argument dictionary.
[0109] In step S05, multiple trigger words in the extraction trigger word dictionary contained in each extraction type dictionary are spliced together to form an extraction trigger word list according to the extraction type. This can be regarded as combining multiple trigger words into a matrix, arranging them with the extraction type as the matrix column, and multiple trigger words are arranged in the corresponding matrix columns.
[0110] In step S06, entity extraction, also known as named entity recognition (NER), is performed to identify the textual scope of named entities and classify them into predefined categories. Entity extraction for a valid sentence can be considered as combining multiple entities in the sentence into a list of entity terms.
[0111] In step S07, an event extraction model based on syntactic analysis is obtained according to the extracted trigger word list and entity word list.
[0112] Figure 9 Shown Figure 8 An exemplary schematic diagram of the flow diagram shown in FIG. Figure 9 As shown, in the embodiment of the present application, after step S05, the method for extracting event information further includes the following steps.
[0113] S08. Input the extracted trigger word list into the first model to obtain an extracted trigger word vector list.
[0114] In step S08, the first model is the Bert-Service model, which can quickly generate a vector list by calling the service without having to pay attention to the details of the input list. The extraction trigger word vector list includes multiple extraction trigger word vectors, each of which corresponds to an extraction event type. In other words, the extraction trigger word list can be regarded as a matrix consisting of multiple extraction trigger word vectors obtained after the multiple extraction trigger words corresponding to each extraction event type are vectorized.
[0115] Figure 10 Shown Figure 8 An exemplary schematic diagram of some steps in the flowchart shown in FIG. Figure 10 As shown, in some optional embodiments, step S07 includes the following steps.
[0116] S071、According to the extraction trigger word list and the entity word list, a second selected trigger word contained in the extraction trigger word list and the entity word list is obtained, and the second selected trigger word is determined as a trigger word.
[0117] S072、It is judged whether the second selected trigger word corresponds to multiple extraction types.
[0118] S073、In the case where the second selected trigger word corresponds to multiple extraction types, the valid sentence is input into the first model to obtain a valid sentence vector.
[0119] S074、The cosine similarity of the valid sentence vector and the multiple extraction trigger word vectors is calculated.
[0120] S075、The extraction event type corresponding to the extraction trigger word vector with the maximum cosine similarity is determined as the event type.
[0121] In step S071, the second selected trigger word is selected, and the second selected trigger word is contained in the extraction trigger word list obtained in step S05 and the entity word list obtained in step S06. That is to say, the second selected trigger word is an entity word that can become a trigger word in the current valid sentence.
[0122] In step S072, it is judged whether the second selected trigger word can correspond to multiple extraction types.
[0123] In step S073, in the case where the second selected trigger word corresponds to multiple extraction types, the valid sentence is input into the Bert-Service model to obtain a valid sentence vector.
[0124] In step S074, the cosine similarity is obtained by calculating the cosine value of the included angle of two vectors, and is a parameter for evaluating the similarity of the two. The cosine similarity of the valid sentence vector and the multiple extraction trigger word vectors is calculated, that is, the similarity of the valid sentence vector and the extraction trigger word vector is judged.
[0125] In step S075, since each extraction trigger word vector corresponds to an event type, the greater the cosine similarity between the valid sentence vector and the extraction trigger word vector, the more extraction trigger words of this extraction type are contained in the valid sentence. Therefore, in the case where the cosine similarity between the valid sentence vector and the extraction trigger word vector is the maximum, the valid sentence contains the most extraction trigger words of this extraction type, that is, it can be determined that the extraction event type corresponding to the extraction trigger word vector is the desired event type.
[0126] In some other optional embodiments, after step S072, step S07 further includes the following steps.
[0127] S073', in the case that the second selection trigger word does not correspond to a plurality of extraction event types, determining that the extraction type corresponding to the second selection trigger word is an event type.
[0128] In step S073', since the second selection trigger word only corresponds to one extraction type, the current extraction type is an event type.
[0129] Figure 11 An exemplary schematic diagram is shown in the flowchart. Figure 10 As shown, in some optional embodiments, after step S075 or S073', step S07 further includes the following steps. Figure 11 As shown, in some optional embodiments, after step S075 or S073', step S07 further includes the following steps.
[0130] S076, determining whether the second selection trigger word is a verb.
[0131] S0761, in the case that the second selection trigger word is a verb, obtaining a plurality of first dependent words within the second degree dependency range of the second selection trigger word according to the syntactic dependency tree.
[0132] S0762, in the case that the plurality of first dependent words include any entity, or the plurality of entities contain any first dependent word, determining that the entity is an event argument.
[0133] In step S076, the dependency grammar theory considers that if one word modifies another word, the modifying word can be called a dependent word, and the modified word is called a governing word. The grammatical relationship between the two is called dependency relationship. In the case that the second selection trigger word is a verb or a non-verb, the dependent words within the certain dependency range of the second selection trigger word can be different, therefore, it is necessary to determine the part of speech of the second selection trigger word.
[0134] In step S0761, since the dependency structure focuses on the dependency relationship between lexical units, the complex relationship between words often eventually forms a tree structure, which is called a syntactic dependency tree. In the embodiments of the present application, the second selection trigger word is the root of the syntactic dependency tree, and the second degree dependency range of the second selection trigger word can be regarded as the second dependency level on the syntactic level starting from the second selection trigger word, and the plurality of words within the second dependency level are the plurality of first dependent words.
[0135] In step S0762, in a case where the first dependent word includes any entity in the entity word list, or any entity includes the first dependent word, that is, in a case where the second selected trigger word is a verb, the first dependent word in the second dependency level can be regarded as a participant of the event triggered by the second selected trigger word. Therefore, if multiple entities in the valid sentence have a containing and contained relationship with multiple first dependent words in the second dependency level of the second selected trigger word, the entity can be regarded as an argument of the event. Alternatively, the entity can include multiple entities.
[0136] In some optional embodiments, after step S076, step S07 further includes the following steps.
[0137] S0761', in a case where the second selected trigger word is not a verb, obtaining multiple first dependent words in a first dependency range of the second selected trigger word according to the syntactic dependency tree.
[0138] S0762', determining, according to the syntactic dependency tree, a first dependent word closest to the second selected trigger word in the multiple first dependent words as a second dependent word. The second dependent word is a verb.
[0139] S0763', obtaining multiple third dependent words in a third dependency range of the second dependent word according to the syntactic dependency tree.
[0140] S0764', in a case where the multiple third dependent words include any entity, or the multiple entities contain any third dependent word, determining that the entity is an argument of the event.
[0141] In step S0761', similar to step S761, in the embodiments of the present application, the second selected trigger word is the root of the syntactic dependency tree, the first dependency range of the second selected trigger word can be regarded as the first dependency level in the syntactic layer starting from the second selected trigger word, and the multiple words in the first dependency level are the multiple first dependent words.
[0142] In step S0762', the first dependent word closest to the second selected trigger word in the multiple first dependent words is determined as the second dependent word. The second dependent word is a verb.
[0143] In step S0763', the second dependent word is the root of the syntactic dependency tree, and the third dependency range of the second dependent word can be regarded as the third dependency level in the syntactic layer starting from the second dependent word, and the multiple words in the third dependency level are the multiple third dependent words.
[0144] In step S0764', similar to step S0762, if the plurality of entities in the valid sentence have a containing and contained relationship with the plurality of third dependency words in the third dependency level of the second dependency word, the entity can be regarded as an event argument. Alternatively, the entity can include a plurality of entities.
[0145] Figure 12 It is shown Figure 8 Another exemplary schematic diagram in the flowchart is shown. As Figure 12 As shown, after step S0762 or step S0764', step S07 can further include the following steps.
[0146] Step S077, obtaining the syntax-based event extraction model corresponding to the at least one event type, the plurality of trigger words and the plurality of event arguments, and the at least one extraction type, the plurality of extraction trigger words and the plurality of extraction arguments, respectively.
[0147] In step S077, similar to step S036, when the at least one event type, the plurality of trigger words and the plurality of event arguments correspond to the at least one extraction type, the plurality of extraction trigger words and the plurality of extraction arguments, respectively, it can be considered that the training of the syntax-based event extraction model reaches the expected training effect, and thus the syntax-based event extraction model can be obtained.
[0148] Based on the above description, the embodiments of the present application further provide an electronic device, which includes a processor and a memory storing computer program instructions. The processor implements the above event information extraction method when executing the computer program instructions.
[0149] The processor can include a central processing unit (CPU), or a specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement the embodiments of the present application.
[0150] The memory can include a mass storage for data or instructions. For example, the memory can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. The memory can include a removable or non-removable (or fixed) medium, as appropriate. The memory can be internal or external to the integrated gateway disaster recovery device, as appropriate. In certain embodiments, the memory is a non-volatile solid-state memory.
[0151] The memory can include read-only memory (ROM), random-access memory (RAM), magnetic disk storage mediums devices, optical storage mediums devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software that, when executed (by one or more processors), is operable to perform operations described with reference to the methods according to an aspect of embodiments of the present application.
[0152] In addition, in combination with the above description, the embodiments of the present application further provide a computer storage medium. The computer readable storage medium stores computer program instructions, and the computer program instructions are executable by a processor to implement the event information extraction method described above.
[0153] To sum up, the event information extraction method according to the embodiments of the present application, by inputting the obtained target sentence into the event extraction model based on deep learning and the event extraction model based on syntax analysis respectively to extract event information, obtaining first event information and second event information, in the case that the first trigger word of the first event information is different from the second trigger word of the second event information, inputting the first trigger word into the event extraction model based on syntax analysis for processing to obtain third event information, merging the first event argument of the first event information and the third event argument of the third event information to obtain the fourth event argument of the fourth event information, and finally outputting the fourth event information. According to the embodiments of the present application, by combining the event extraction model based on deep learning and the event extraction model based on syntax analysis, the event can be extracted more accurately.
[0154] It should be noted that, in this document, relational terms such as“first” and“second”, and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms“comprises”,“comprising”,“includes”,“including” or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by“comprises a...” does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Claims
1. An extraction method of event information, characterized by, The method comprises the following steps: obtaining a target sentence; inputting the target sentence into a deep learning-based event extraction model to extract event information, obtaining first event information, the first event information comprising a first event type, a first trigger word and a first event argument; inputting the target sentence into a syntax analysis-based event extraction model to extract event information, obtaining second event information, the second event information comprising a second event type, a second trigger word and a second event argument; in the case where the first trigger word is different from the second trigger word, inputting the first trigger word into the syntax analysis-based event extraction model for processing, obtaining third event information, the third event information comprising a third event argument; merging the first event argument and the third event argument to obtain a fourth event argument; outputting fourth event information, the fourth event information comprising the first event type, the first trigger word and the fourth event argument.
2. The event information extraction method according to claim 1, characterized by, The first event argument comprises at least two groups of first key-value pairs, the first key-value pair comprising a first key and a first value, the third event argument comprises at least two groups of third key-value pairs, the third key-value pair comprising a third key and a third value, the first key and the first value, the third key and the third value corresponding one by one; merging the first event argument and the third event argument to obtain a fourth event argument, comprising: comparing a plurality of first keys and a plurality of third keys; in the case where any of the first keys is equal to any of the third keys, determining that the corresponding third key-value pair is a fourth key-value pair; in the case where any of the first keys is not equal to a plurality of third keys, determining that the corresponding first key-value pair is the fourth key-value pair; determining a set of a plurality of fourth key-value pairs as the fourth event argument.
3. The event information extraction method according to claim 1, characterized by, Before inputting the target sentence into the deep learning-based event extraction model to extract event information, the event information extraction method further comprises: obtaining text data, the text data comprising an effective sentence and annotation information of the effective sentence, the effective sentence comprising a plurality of unit characters, the annotation information comprising at least one annotation type, a plurality of annotation trigger words and a plurality of annotation arguments, each annotation type corresponding to at least one annotation trigger word, the annotation trigger word corresponding to at least one annotation argument; vectorizing the effective sentence to obtain corresponding vector information, the vector information comprising a plurality of word-mixed vectors corresponding to a plurality of unit characters, and a plurality of position vectors corresponding to positions of a plurality of unit characters in the effective sentence; convolving the annotation information and the vector information to obtain the deep learning-based event extraction model.
4. The event information extraction method according to claim 3, characterized by, The convolution of the annotation information and the vector information to obtain the deep learning-based event extraction model comprises: performing dilated gate convolution on the vector information to obtain a corresponding encoding sequence; inputting the encoding sequence into a first self-attention mechanism to obtain at least one of the event types and a plurality of the trigger words, each of the event types corresponding to at least one of the trigger words; selecting a first selected trigger word from the plurality of the trigger words, the first selected trigger word being included in the plurality of the labeled trigger words; obtaining a vector sequence corresponding to the first selected trigger word according to the first selected trigger word; obtaining a plurality of the argument of events according to the encoding sequence and the vector sequence, the trigger word corresponding to at least one of the argument of events; obtaining the deep learning-based event extraction model in a case where at least one of the event types, the plurality of the trigger words and the plurality of the argument of events correspond to at least one of the labeled types, the plurality of the labeled trigger words and the plurality of the labeled argument of events, respectively.
5. The event information extraction method according to claim 4, characterized by, The obtaining of the vector sequence corresponding to the first selected trigger word according to the first selected trigger word comprises: obtaining a sub-sequence corresponding to the first selected trigger word according to the first selected trigger word and the encoding sequence; inputting the sub-sequence into a long short-term memory network to obtain a corresponding encoding vector; obtaining a position vector of the first selected trigger word; obtaining the vector sequence corresponding to the first selected trigger word according to the encoding vector and the position vector.
6. The event information extraction method according to claim 5, characterized by, The obtaining of the plurality of the argument of events according to the encoding sequence and the vector sequence comprises: inputting the encoding sequence into a second self-attention mechanism; convolving the vector sequence and the encoding sequence input into the second self-attention mechanism to obtain the plurality of the argument of events.
7. The event information extraction method according to claim 3, characterized by, Before the inputting of the target sentence into the syntax-based event extraction model to extract event information, the event information extraction method further comprises: obtaining at least one extraction type, a plurality of extraction trigger words and a plurality of extraction argument of events, each of the extraction type corresponding to at least one of the extraction trigger words, the extraction trigger word corresponding to at least one of the extraction argument of events; splicing the plurality of the extraction trigger words corresponding to each of the extraction type according to the extraction type to obtain an extraction trigger word list; performing entity extraction on the valid sentence to obtain an entity word list, the entity word list comprising a plurality of entities corresponding to the plurality of unit characters; obtaining the syntax-based event extraction model according to the extraction trigger word list and the entity word list.
8. The event information extraction method according to claim 7, characterized by, Before the inputting of the target sentence into the syntax-based event extraction model to extract event information, the event information extraction method further comprises: inputting the extraction trigger word list into a first model to obtain an extraction trigger word vector list; wherein the extraction trigger word vector list comprises a plurality of extraction trigger word vectors, each of the extraction trigger word vectors corresponding to an extraction event type.
9. The event information extraction method according to claim 8, characterized by, The obtaining of the syntax-based event extraction model according to the extraction trigger word list and the entity word list comprises: According to the extraction trigger word list and the entity word list, a second selected trigger word contained in the extraction trigger word list and the entity word list is obtained, and the second selected trigger word is determined as the trigger word; It is judged whether the second selected trigger word corresponds to multiple extraction types; In the case that the second selected trigger word corresponds to multiple extraction types, the valid sentence is input into the first model to obtain a valid sentence vector; The cosine similarity of the valid sentence vector and multiple extraction trigger word vectors is calculated; The extraction event type corresponding to the extraction trigger word vector with the maximum cosine similarity is determined as the event type.
10. The event information extraction method according to claim 9, characterized by, After judging whether the second selected trigger word corresponds to multiple extraction types, the event extraction model based on syntax analysis obtained according to the extraction trigger word list and the entity word list further includes: In the case that the second selected trigger word does not correspond to multiple extraction event types, the extraction type corresponding to the second selected trigger word is determined as the event type.
11. The event information extraction method according to claim 9 or 10, characterized by, The event extraction model based on syntax analysis obtained according to the extraction trigger word list and the entity word list further includes: It is judged whether the second selected trigger word is a verb; In the case that the second selected trigger word is a verb, multiple first dependent words in the two-degree dependency range of the second selected trigger word are obtained according to the syntax dependency tree; In the case that multiple first dependent words include any entity or multiple entities contain any first dependent word, the entity is determined as the event argument.
12. The event information extraction method according to claim 11, characterized by, After judging whether the second selected trigger word is a verb, the event extraction model based on syntax analysis obtained according to the extraction trigger word list and the entity word list further includes: In the case that the second selected trigger word is not a verb, multiple one-degree dependent words in the one-degree dependency range of the second selected trigger word are obtained according to the syntax dependency tree; According to the syntax dependency tree, the one-degree dependent word closest to the second selected trigger word among multiple one-degree dependent words is determined as a second dependent word, and the second dependent word is a verb; According to the syntax dependency tree, multiple third dependent words in the three-degree dependency range of the second dependent word are obtained; In the case that multiple third dependent words include any entity or multiple entities contain any third dependent word, the entity is determined as the event argument.
13. The event information extraction method according to claim 12, characterized by, The event extraction model based on syntax analysis obtained according to the extraction trigger word list and the entity word list further includes: In the case that at least one event type, multiple trigger words and multiple event arguments correspond to at least one extraction type, multiple extraction trigger words and multiple extraction arguments respectively, the event extraction model based on syntax analysis is obtained.
14. An event information extraction apparatus characterized by comprising: It includes: The first extraction module inputs a target sentence into a deep learning-based event extraction model to extract event information to obtain first event information, the first event information including a first event type, a first trigger word, and a first event argument, and in the case where the first trigger word is different from a second trigger word, inputs the first trigger word into a syntax analysis-based event extraction model to obtain third event information, the third event information including a third event argument; The second extraction module inputs the target sentence into the syntax analysis-based event extraction model to extract event information to obtain second event information, the second event information including a second event type, the second trigger word, and a second event argument; The merging module merges the first event argument and the third event argument to obtain a fourth event argument; The output module outputs the second event information and fourth event information, the fourth event information including the first event type, the first trigger word, and the fourth event argument.
15. An electronic device, comprising: comprise: a processor and a memory having computer program instructions stored therein; the processor executes the computer program instructions to implement the event information extraction method of any one of claims 1-13.
16. A computer-readable storage medium, characterized in that, The computer program instructions are stored on the computer readable storage medium, and when executed by the processor, implement the event information extraction method of any one of claims 1-13.
Citation Information
Patent Citations
Statement information extraction method and device and readable storage medium
CN110704598A
Question statement processing method and device, equipment and computer storage medium
CN114254593A