Event information extraction method and device, electronic equipment and storage medium

Multi-task learning is carried out through a large language model, combining event type detection and event entity extraction, and solving the problem of low accuracy of event information extraction results in the prior art, achieving a more efficient event information extraction effect.

CN119441382AInactive Publication Date: 2025-02-14CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411456293.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing event information extraction methods are difficult to fully capture the dependencies between event information, resulting in low accuracy of the extraction results.

Method used

A large language model is used for multi-task learning, combining event type detection and event entity extraction, and analyzing the to-process text through a pre-trained large language model to obtain event types and event entities.

Benefits of technology

Improve the accuracy of event information extraction results, simplify the processing process, eliminate the need to deploy multiple models, and make full use of the modeling ability of large language models to model long texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441382A_ABST
    Figure CN119441382A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an event information extraction method and device, electronic equipment and a storage medium. The event information extraction method comprises the following steps: forming first input information by using a to-be-processed text and event type detection prompt information, analyzing the first input information by utilizing a pre-trained large language model to obtain first output information, and obtaining an event type of the to-be-processed text based on the first output information; obtaining event entity extraction prompt information corresponding to the event type of the to-be-processed text, and taking the event entity extraction prompt information as first event entity extraction prompt information; and extracting prompt information for each first event entity, forming second input information by using the to-be-processed text and the first event entity extraction prompt information, analyzing the second input information by using the large language model to obtain second output information, and obtaining the event entity of the to-be-processed text based on the second output information. According to the embodiment of the invention, the accuracy of the event information extraction result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to an event information extraction method, device, electronic device and storage medium. Background Art

[0002] In the field of natural language processing, the purpose of the event information extraction task is to automatically identify the event type from the unstructured natural language text containing event information, and extract valuable event data such as event trigger words and event element entities related to specific events, and store them in the form of structured information.

[0003] In the current event extraction method, a corresponding model is usually set for each type of event information extraction task, and a single model is used to handle a single event information extraction task. However, this method is limited by the task form and it is difficult to fully capture the dependency relationship between event information, resulting in low accuracy of event information extraction results. Summary of the invention

[0004] In view of the above problems, the embodiments of the present application propose an event information extraction method, device, electronic device and storage medium to solve the problem of low accuracy of event information extraction results.

[0005] According to one aspect of an embodiment of the present application, a method for extracting event information is provided, the method comprising:

[0006] The text to be processed and the event type detection prompt information are combined into first input information, the first input information is analyzed by using a pre-trained large language model to obtain first output information, and the event type of the text to be processed is obtained based on the first output information;

[0007] Acquire event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information;

[0008] Extract prompt information for each first event entity, combine the text to be processed and the first event entity extraction prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

[0009] Optionally, the event entity extraction prompt information includes event trigger word extraction prompt information and event element extraction prompt information.

[0010] Optionally, the event element extraction prompt information includes sentence completion prompt information, event element keyword extraction prompt information and event element role classification prompt information.

[0011] Optionally, obtaining the event type of the text to be processed based on the first output information includes: matching the first output information with the event type detection prompt information, and extracting from the first output information, information corresponding to the event type placeholder in the event type detection prompt information, as the event type of the text to be processed.

[0012] Optionally, obtaining the event entity of the text to be processed based on the second output information includes: matching the second output information with the first event entity extraction prompt information, and extracting from the second output information, information corresponding to the event entity placeholder in the first event entity extraction prompt information, as the event entity of the text to be processed.

[0013] Optionally, the large language model is trained in the following manner:

[0014] Acquire sample text and annotation event information of the sample text;

[0015] The sample text and the event type detection prompt information are combined into third input information, the third input information is analyzed using the initial large language model to obtain third output information, and the predicted event type of the text to be processed is obtained based on the third output information;

[0016] Acquire event entity extraction prompt information corresponding to the predicted event type as second event entity extraction prompt information;

[0017] For each second event entity extraction prompt information, the sample text and the second event entity extraction prompt information are combined into fourth input information, and the fourth input information is analyzed by using the initial large language model to obtain fourth output information;

[0018] Based on the third output information, the fourth output information and the labeled event information, it is determined whether the initial large language model has been trained, and the large language model is obtained after the training is completed.

[0019] Optionally, the method further includes: converting the event type of the text to be processed into a structured event type, converting the event entity of the text to be processed into a structured event entity, and merging the structured event type and the structured event entity as event information of the text to be processed.

[0020] According to another aspect of an embodiment of the present application, there is provided an event information extraction device, the device comprising:

[0021] A first extraction module, configured to combine the text to be processed and the event type detection prompt information into first input information, analyze the first input information using a pre-trained large language model to obtain first output information, and obtain the event type of the text to be processed based on the first output information;

[0022] An acquisition module, used for acquiring event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information;

[0023] The second extraction module is used to extract prompt information for each first event entity, combine the text to be processed and the first event entity extracted prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

[0024] Optionally, the event entity extraction prompt information includes event trigger word extraction prompt information and event element extraction prompt information.

[0025] Optionally, the event element extraction prompt information includes sentence completion prompt information, event element keyword extraction prompt information and event element role classification prompt information.

[0026] Optionally, the first extraction module is specifically used to match the first output information with the event type detection prompt information, and extract information corresponding to the event type placeholder in the event type detection prompt information from the first output information as the event type of the text to be processed.

[0027] Optionally, the second extraction module is specifically used to match the second output information with the first event entity extraction prompt information, and extract from the second output information, information corresponding to the event entity placeholder in the first event entity extraction prompt information as the event entity of the text to be processed.

[0028] Optionally, the large language model is trained in the following manner:

[0029] Acquire sample text and annotation event information of the sample text;

[0030] The sample text and the event type detection prompt information are combined into third input information, the third input information is analyzed using the initial large language model to obtain third output information, and the predicted event type of the text to be processed is obtained based on the third output information;

[0031] Acquire event entity extraction prompt information corresponding to the predicted event type as second event entity extraction prompt information;

[0032] For each second event entity extraction prompt information, the sample text and the second event entity extraction prompt information are combined into fourth input information, and the fourth input information is analyzed by using the initial large language model to obtain fourth output information;

[0033] Based on the third output information, the fourth output information and the labeled event information, it is determined whether the initial large language model has been trained, and the large language model is obtained after the training is completed.

[0034] Optionally, the device also includes: a conversion module, used to convert the event type of the text to be processed into a structured event type, convert the event entity of the text to be processed into a structured event entity, and merge the structured event type and the structured event entity as event information of the text to be processed.

[0035] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the event information extraction method as described in any one of the above items.

[0036] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the event information extraction method as described in any one of the above items.

[0037] In the embodiments of the present application, a large language model is used for multi-task learning to perform event type detection and event entity extraction. This can not only fully utilize the large language model's modeling capabilities for long texts, but also because event type detection and event entity extraction themselves have a strong correlation, multi-task learning can be used to learn the correlation between different tasks, thereby improving the processing performance of each task. Therefore, the accuracy of the event information extraction results can be improved, and when the system is deployed in actual applications, there is no need to deploy multiple models, which can simplify the processing process.

[0038] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solution of the embodiment of the present application, the drawings required for use in the description of the embodiment of the present application will be briefly introduced below. Obviously, the drawings described below are only some drawings of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 It is a flowchart of the steps of an event information extraction method according to an embodiment of the present application;

[0041] Figure 2 is a schematic diagram of an event information extraction framework of an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of an event information extraction process of an embodiment of the present application;

[0043] Figure 4 is a structural block diagram of an event information extraction device according to an embodiment of the present application;

[0044] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application;

[0045] Figure 6 It is a structural block diagram of a computer-readable storage medium in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] First, the technical terms mentioned in the embodiments of the present application are explained.

[0048] Event Detection (ED): A key link in the event information extraction task, its purpose is to identify specific types of event instances from unstructured text.

[0049] Event Argument Extraction (EAE): A key step in the event information extraction task, which aims to extract the key element entities corresponding to the event after detecting the event type contained in the unstructured text.

[0050] Event Argument Extraction (EAE): A key step in the event information extraction task. Its purpose is to detect the event type contained in the unstructured text and then extract the key trigger word entity corresponding to the event.

[0051] Event Type: A set of predefined event categories used to classify the events to be extracted. Event types are usually pre-set by domain experts or data annotators.

[0052] Event Trigger: refers to a word that can express and trigger a specific event, usually a verb or a noun.

[0053] Event Argument: An important entity related to an event, such as time, place, people and other information units, which are the core components required to constitute a complete event.

[0054] Event Argument Role: refers to the semantic role played by an event argument in the event. The roles corresponding to event arguments may be different for different event types.

[0055] Large Language Model (LLM): refers to a machine learning model with a large number of parameters and complex structure. They can process massive data and complete various complex tasks, such as natural language processing, computer vision, and speech recognition.

[0056] Prompt Learning: A method that adds specific instructions or context (i.e., "prompts") as prompt information at the model input, allowing the model to better understand and perform specific tasks. This method can significantly reduce the need for large amounts of labeled data and can perform well on multiple tasks.

[0057] Generative Pre-trained (GPT): Captures the statistical properties of language through unsupervised learning on a large amount of unlabeled text data and is able to generate new, coherent text. These models are usually based on neural network architectures, especially Transformer architectures, which can perform well in various natural language processing tasks.

[0058] Encoder-Decoder framework: An architecture widely used in natural language processing and other sequence-to-sequence (Seq2Seq) tasks. This framework is mainly used to deal with problems where the length of the input sequence and the output sequence are not fixed, such as machine translation, text summarization, dialogue systems, question-answering systems, and event extraction. The main task of the encoder is to convert the input sequence into a fixed-length vector, and the decoder is responsible for converting the vector generated by the encoder into the target sequence. It also generates the output sequence in an element-by-element manner.

[0059] Multi-task Learning: Multiple related tasks are learned simultaneously. In this setting, a single model is trained to solve multiple tasks, rather than training separate models for each task. The core idea of ​​multi-task learning is to improve learning efficiency and generalization across tasks and knowledge sharing through shared representations, especially when some task data is scarce. Multi-task learning is even more important.

[0060] In the embodiment of the present application, based on a large language model, a multi-task learning method is used to solve the problem that the extraction result is easily limited by the quality of the single template design and the task form, and it is difficult to fully capture the structure and dependency between entities, and the problem of mutual promotion between different tasks is ignored when performing multi-task learning. The purpose of the embodiment of the present application is to: use a large language model to make full use of its pre-training ability and modeling ability for long texts; reduce computational complexity; use knowledge transfer between similar tasks during multi-task learning to improve the performance of each task. Its advantage is that a large language model unifies the two links of event information extraction: event type detection and event entity extraction. When the system is deployed in actual application, there is no need to deploy multiple models, and event type detection and event entity extraction themselves have a strong correlation. Multi-task learning can learn the correlation between similar tasks, and perform knowledge transfer to improve the performance of each task.

[0061] The following is a detailed introduction to the event information extraction method in the embodiment of the present application.

[0062] Reference Figure 1 , showing a step flow chart of an event information extraction method according to an embodiment of the present application.

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

[0064] Step 101, the text to be processed and the event type detection prompt information are combined into the first input information, the first input information is analyzed by using a pre-trained large language model to obtain the first output information, and the event type of the text to be processed is obtained based on the first output information.

[0065] In the embodiment of the present application, event information is extracted based on a unified large language model, which can perform event type detection tasks and event entity extraction tasks. Among them, the event type detection task can provide context for the subsequent event entity extraction task and enhance the understanding of the overall semantics of the event.

[0066] In an embodiment of the present application, in order to enable the large language model to more accurately perform event type detection tasks and event entity extraction tasks, a prompt information library containing multiple types of task prompt information (also referred to as prompt templates) can be pre-constructed.

[0067] Exemplarily, the prompt information library may include, but is not limited to: event type detection prompt information, event entity extraction prompt information, and the like.

[0068] Among them, the event type detection prompt information is used to guide the large language model to perform relevant analysis on the input information for event type detection, so as to obtain output information related to the event type. The event entity extraction prompt information is used to guide the large language model to perform relevant analysis on the input information for event entity extraction, so as to obtain output information related to the event entity. Among them, the event type detection prompt information can be a general prompt information, and there is no need to distinguish it according to the event type. The event entity extraction prompt information is distinguished according to the event type, and different event types correspond to different event entity extraction prompt information.

[0069] In the embodiment of the present application, considering the need for event information extraction, in order to more accurately and comprehensively characterize event information, event entity extraction may include event trigger word extraction and event element extraction. Event trigger word extraction can provide support for determining the core behavior of the event. Event element extraction can provide support for determining the specific information of the event.

[0070] Exemplarily, the event entity extraction prompt information may include, but is not limited to: event trigger word extraction prompt information, event element extraction prompt information, and the like.

[0071] Among them, the event trigger word extraction prompt information is used to guide the large language model to perform relevant analysis on the input information for event trigger word extraction, so as to obtain output information related to the event trigger word. The event element extraction prompt information is used to guide the large language model to perform relevant analysis on the input information for event element extraction, so as to obtain output information related to the event element. By setting the event trigger word extraction prompt information and the event element extraction prompt information, event trigger words and event elements can be extracted, so as to more accurately and comprehensively represent the event information.

[0072] Exemplarily, the event element extraction prompt information may include but is not limited to: sentence completion prompt information, event element keyword extraction prompt information, event element role classification prompt information, and the like. The sentence completion prompt information, event element keyword extraction prompt information, and event element role classification prompt information work together to improve the event element extraction effect. Among them, the sentence completion prompt information and event element keyword extraction prompt information are used for event element extraction, and their purpose is to add more additional semantic constraints to solve the problem of diverse event element types. Event element role classification prompt information can capture the semantic relationship between event arguments, add effective clues to event element extraction, thereby capturing the intrinsic connection between different links in the event information extraction task, strengthening the complementarity and knowledge transfer between links, and thus improving the overall extraction performance.

[0073] In the implementation, the prompt information library containing multiple types of task prompt information can be stored in the form of structured JSON (JavaScript Object Notation) data. The prompt information is constructed according to predefined event types and entities to be extracted under each event type.

[0074] Taking the event type Hurt as an example, the task type and prompt information examples can be shown in the following table:

[0075] Table 1 Prompt information table

[0076]

[0077] In the embodiment of the present application, it is necessary to pre-train a large language model for event information extraction, and then use the trained large language model to extract event information. The training process of the large language model will be described in detail below.

[0078] After obtaining the text to be processed that requires event information extraction, the text to be processed can be preprocessed, which may include but is not limited to preprocessing operations such as cleaning, word segmentation, and standardization, so that the text to be processed can meet the input format required by the large language model.

[0079] After preprocessing, the text to be processed (preprocessed text to be processed) and the event type detection prompt information are combined into the first input information. Exemplarily, the text to be processed and the event type detection prompt information can be concatenated to obtain the first input information.

[0080] The first input information is analyzed using a pre-trained large language model to obtain first output information. Exemplarily, the first input information can be input into the large language model, and the large language model performs event type detection analysis on the text to be processed under the guidance of event type detection prompt information, so as to output first output information containing the event type.

[0081] In the embodiment of the present application, the large language model can adopt any applicable model. For example, a generative pre-trained model, a model based on an autoencoder, a sequence-to-sequence model, etc. can be adopted. For example, it can be a T5 (Text-to-Text Transfer Transformer) series model, a BERT (Bidirectional Encoder Representations from Transformers) model, a GPT series model, and the like.

[0082] Taking the T5-EE (Text-to-Text Transfer Transformer with Enhanced Encoder) model as an example, its internal components include but are not limited to a tokenizer, an encoder, a decoder, and the like. The first input information is input into the T5-EE model, and the tokenizer of the T5-EE model is used to perform tokenization on the first input information to obtain a vector matrix after tokenization. The vector matrix after tokenization is input into the encoder of the T5-EE model to obtain the hidden layer vector of the model. The hidden layer vector of the model is input into the decoder of the T5-EE model to obtain the first output information containing the event type.

[0083] After obtaining the first output information of the large language model, the event type of the text to be processed may be acquired based on the first output information.

[0084] Exemplarily, the event type of the text to be processed may be extracted from the first output information based on rule matching.

[0085] Exemplarily, the process of obtaining the event type of the text to be processed based on the first output information may include: matching the first output information with the event type detection prompt information, and extracting from the first output information information corresponding to the event type placeholder in the event type detection prompt information as the event type of the text to be processed. In this way, the event type of the text to be processed can be extracted from the first output information by simply performing rule matching, which can simplify the processing process.

[0086] The event type detection prompt information may include an event type placeholder, which indicates that the position in the output information is an event type. For example, the event type detection prompt information "event type is <type>"middle," <type>" is a placeholder for the event type.

[0087] Therefore, by matching the first output information with the event type detection prompt information, information in the first output information that corresponds to the event type placeholder in the event type detection prompt information can be obtained. For example, if the specific form of the first output information is the same as the specific form of the event type detection prompt information, except that the event type placeholder in the event type detection prompt information is filled with the event type in the first output information, after matching the first output information with the event type detection prompt information, information in the first output information that is different from the event type detection prompt information can be used as information corresponding to the event type placeholder in the event type detection prompt information.

[0088] Step 102: Acquire event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information.

[0089] As described above, event entity extraction prompt information is distinguished according to event types, and different event types correspond to different event entity extraction prompt information. Therefore, the event entity extraction prompt information corresponding to the event type of the text to be processed can be obtained from the prompt information library. In order to facilitate distinction, the obtained event entity extraction prompt information can be used as the first event entity extraction prompt information.

[0090] For example, when storing event entity extraction prompt information, the event type can be used as the key and the event entity extraction prompt information corresponding to the event type can be stored as the value. Therefore, the event type of the text to be processed is matched with the key, and the value corresponding to the successfully matched key is used as the event entity extraction prompt information corresponding to the event type of the text to be processed.

[0091] For another example, when storing event entity extraction prompt information, the event type can be specified in the event entity extraction prompt information. Therefore, the event type of the text to be processed is matched with the event type specified in the event entity extraction prompt information, and the successfully matched event entity extraction prompt information is used as the event entity extraction prompt information corresponding to the event type of the text to be processed.

[0092] Step 103, extract prompt information for each first event entity, combine the text to be processed and the first event entity extracted prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

[0093] After obtaining the first event entity extraction prompt information according to the event type of the text to be processed, for each first event entity extraction prompt information, the text to be processed and the first event entity extraction prompt information are combined into the second input information. Exemplarily, the text to be processed and the first event entity extraction prompt information can be spliced ​​to obtain the first input information.

[0094] The second input information is analyzed using a pre-trained large language model to obtain the second output information. Exemplarily, the second input information can be input into the large language model, and the large language model, under the guidance of the first event entity extraction prompt information, analyzes the event entity extraction of the text to be processed, thereby outputting the second output information containing the event entity. The specific processing process can refer to the relevant description above, and this embodiment will not be discussed in detail here.

[0095] After obtaining the second output information of the large language model, the event entity of the text to be processed may be obtained based on the second output information.

[0096] Exemplarily, the event entity of the text to be processed may be extracted from the second output information based on rule matching.

[0097] Exemplarily, the process of obtaining the event entity of the text to be processed based on the second output information may include: matching the second output information with the first event entity extraction prompt information, and extracting from the second output information information corresponding to the event entity placeholder in the first event entity extraction prompt information as the event entity of the text to be processed. In this way, the event entity of the text to be processed can be extracted from the second output information by simply performing rule matching, which can simplify the processing process.

[0098] The event entity extraction prompt information may include an event entity placeholder, which indicates that the position in the output information is an event entity. For example, the event trigger word extraction prompt information "event type isHurt, event trigger is <trigger>"middle," <trigger>" is the event entity placeholder.

[0099] Therefore, by matching the second output information with the event entity extraction prompt information, information in the second output information that corresponds to the event entity placeholder in the event entity extraction prompt information can be obtained. For example, if the specific form of the second output information is the same as the specific form of the event entity extraction prompt information, except that the event entity placeholder in the event entity extraction prompt information is filled with event entities in the second output information, then after matching the second output information with the event entity extraction prompt information, information in the second output information that is different from the event entity extraction prompt information can be used as information corresponding to the event entity placeholder in the event entity extraction prompt information.

[0100] In the case where the event entity extraction prompt information includes event trigger word extraction prompt information and event element extraction prompt information, the first event entity extraction prompt information includes event trigger word extraction prompt information corresponding to the event type of the text to be processed, and event element extraction prompt information corresponding to the event type of the text to be processed. For the sake of distinction, the event trigger word extraction prompt information corresponding to the event type of the text to be processed is referred to as the first event trigger word extraction prompt information, and the event element extraction prompt information corresponding to the event type of the text to be processed is referred to as the first event element extraction prompt information. Accordingly, the event entity includes event trigger words and event elements.

[0101] For the first event trigger word extraction prompt information, the text to be processed and the first event trigger word extraction prompt information are combined into second input information, the second input information is analyzed using the large language model to obtain second output information, and the event trigger word of the text to be processed is obtained based on the second output information. The specific processing process can refer to the relevant description above.

[0102] For the first event element extraction prompt information, the text to be processed and the first event element extraction prompt information are combined into second input information, the second input information is analyzed using the large language model to obtain second output information, and the event element of the text to be processed is obtained based on the second output information. The specific processing process can refer to the relevant description above.

[0103] In an optional implementation, after obtaining the event type of the text to be processed, the event type of the text to be processed can be converted into a structured event type (Event_type), and after obtaining the event entity of the text to be processed and converting it into a structured event entity, the event entity of the text to be processed can be converted into a structured event entity. Finally, the structured event type and the structured event entity are merged as the event information of the text to be processed.

[0104] In the case where the event entity includes an event trigger and event elements, the structured event entity includes a structured event trigger (Event_trigger) and structured event elements (Event_arguments).

[0105] Next, the training process of the large language model is introduced.

[0106] Exemplarily, the training process of the large language model may include:

[0107] (1) Acquire sample text and annotation event information of the sample text, wherein the annotation event information includes an annotation event type and an annotation event entity.

[0108] In this embodiment, the sample text may also be preprocessed to make it conform to the input format required by the large language model.

[0109] (2) The sample text and the event type detection prompt information are combined into third input information, the third input information is analyzed using the initial large language model to obtain third output information, and the predicted event type of the text to be processed is obtained based on the third output information.

[0110] (3) Obtaining event entity extraction prompt information corresponding to the predicted event type as second event entity extraction prompt information.

[0111] (4) For each second event entity extraction prompt information, the sample text and the second event entity extraction prompt information are combined into fourth input information, and the fourth input information is analyzed using the initial large language model to obtain fourth output information.

[0112] For the specific processes of (2), (3), and (4), reference may be made to the specific introduction to steps 101 to 103 above, and this embodiment will not be discussed in detail here.

[0113] (5) Based on the third output information, the fourth output information, and the labeled event information, it is determined whether the initial large language model has been trained, and the large language model is obtained after the training is completed.

[0114] The third output information includes the predicted event type, and the fourth output information includes the predicted event entity.

[0115] It should be noted that in order to unify the format of the predicted output (the predicted event type, the predicted event entity) and the target output (the labeled event type and the labeled event) of the large language model, the labeled event information of the sample text can be organized according to the output format of the large language model and input into the large language model. After being processed by the word segmentation parser of the large language model, a vector corresponding to the labeled event information of the sample text is obtained, specifically including a vector corresponding to the labeled event type and a vector corresponding to the labeled event entity.

[0116] Based on the third output information, the fourth output information and the labeled event information (specifically including the labeled event type and the labeled event entity), a loss function of the model may be calculated.

[0117] In the embodiment of the present application, any applicable loss function can be used, such as a cross entropy loss function, an exponential loss function, a classification loss function, etc., and this embodiment does not impose any restrictions on this.

[0118] For example, the cross entropy loss function can be used. The formula of the cross entropy loss function is as follows:

[0119]

[0120] Among them, L represents the value of the cross entropy loss function, y * represents the annotation event information (specifically including the annotation event type and the annotation event entity), z represents the prompt information (specifically including the event type detection prompt information and the event entity extraction prompt information), x represents the text to be processed, y represents the output information of the large language model (specifically including the third output information and the fourth output information), p(y|x,z) represents the probability that the output information y of the large language model belongs to the corresponding annotation event information in the case of the text to be processed x and the prompt information z, and ln() represents the natural logarithm function.

[0121] In the embodiment of the present application, the obtained loss function can be processed by the back propagation method to obtain the gradient of the large language model parameters. According to the gradient of the large language model parameters, the parameters of the large language model are updated by the stochastic gradient descent method. The above process is repeated until the loss function is less than the preset loss threshold and the number of iterations reaches the preset number of iterations (Epoch), and the trained model is obtained. The trained model is used as the large language model, otherwise the model parameters are adjusted to continue training.

[0122] In the embodiments of the present application, a large language model is used for multi-task learning to perform event type detection and event entity extraction. This can not only fully utilize the large language model's modeling capabilities for long texts, but also because event type detection and event entity extraction themselves have a strong correlation, multi-task learning can be used to learn the correlation between different tasks, thereby improving the processing performance of each task. Therefore, the accuracy of the event information extraction results can be improved, and when the system is deployed in actual applications, there is no need to deploy multiple models, which can simplify the processing process.

[0123] Reference Figure 2 , showing a schematic diagram of an event information extraction framework of an embodiment of the present application.

[0124] like Figure 2 As shown in the figure, the event information extraction framework is as follows:

[0125] In the data processing module, event extraction training data (i.e. the sample text and the sample text annotation information mentioned above) is obtained through data annotation. The text data to be processed is obtained through text crawler cleaning, and the prompt information library can also be called.

[0126] In the event extraction logic module, the large language model is trained based on the event extraction training data and the prompt information library. Text + prompt information (event type detection prompt information) is input into the large language model to obtain the event type, text + prompt information (event trigger word extraction prompt information) is input into the large language model to obtain the event trigger word, and text + prompt information (event element extraction prompt information) is input into the large language model to obtain the event element.

[0127] In the extraction result processing module, information conversion is performed on the event type, event trigger words, and event elements of the text to be processed to obtain structured event type, structured event trigger words, and structured event elements as structured event information.

[0128] Reference Figure 3 , showing a schematic diagram of an event information extraction process of an embodiment of the present application.

[0129] like Figure 3 As shown in the figure, the event information extraction process is as follows: the text to be processed and the event type detection prompt information obtained from the prompt information library are used as input to perform event type detection, and the event type is output. According to the event type, the event trigger word extraction prompt information and event element extraction prompt information are queried from the prompt information library. The text to be processed and the event trigger word extraction prompt information are used as input to perform event trigger word extraction, and the event trigger word is output. The text to be processed and the event element extraction prompt information are used as input to perform event element extraction, and the event element is output. The event type, event trigger word, and event element are summarized to obtain structured event information.

[0130] The following is an explanation using a specific example.

[0131] The text to be processed is:

[0132] "The xx City xx Bureau issued a notice that the network anchor XX committed illegal acts between 2020 and 2022. The xx City xx Bureau fined the network anchor XX in accordance with relevant laws and regulations, totaling 6.5361 million yuan."

[0133] The extracted event information is the following structured JSON data:

[0134] response={'events':[{'Event_arguments':[{'role':'FineTarget','word':'Internet anchor XXX'},{'role':'LawEnforcer','word':'xx City xx Bureau'},{'role':'FineAmount','word':'6.5361 million yuan'}],'Event_trigger':'fine','Event_type':'fine'}]}.

[0135] In the embodiment of the present application, a multi-task learning strategy is adopted to share the encoder and decoder of the model. Through multi-task joint training, the model can share knowledge at the underlying semantic representation level, avoiding the knowledge isolation caused by explicit task segmentation, so that each subtask can make full use of the information of other related tasks, and can effectively utilize information sharing across tasks, while improving the performance of multiple tasks. Using prompt information, multiple element entities are extracted at one time, avoiding the problem of high computational complexity of question-and-answer methods. A large pre-trained large language model is used in combination with prompt information to add additional semantic constraints, fully tap its generation ability, and it also has a stronger modeling and understanding ability for long texts. The method of the embodiment of the present application is universal, not only applicable to event extraction tasks of different languages ​​and different content types, but also well applicable to other information extraction tasks.

[0136] Reference Figure 4 , shows a structural block diagram of an event information extraction device according to an embodiment of the present application.

[0137] like Figure 4 As shown, the event information extraction device may include the following modules:

[0138] A first extraction module 401 is used to combine the text to be processed and the event type detection prompt information into first input information, analyze the first input information using a pre-trained large language model to obtain first output information, and obtain the event type of the text to be processed based on the first output information;

[0139] An acquisition module 402 is used to acquire event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information;

[0140] The second extraction module 403 is used to extract prompt information for each first event entity, combine the text to be processed and the first event entity extracted prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

[0141] Optionally, the event entity extraction prompt information includes event trigger word extraction prompt information and event element extraction prompt information.

[0142] Optionally, the event element extraction prompt information includes sentence completion prompt information, event element keyword extraction prompt information and event element role classification prompt information.

[0143] Optionally, the first extraction module 401 is specifically used to match the first output information with the event type detection prompt information, and extract information corresponding to the event type placeholder in the event type detection prompt information from the first output information as the event type of the text to be processed.

[0144] Optionally, the second extraction module 403 is specifically used to match the second output information with the first event entity extraction prompt information, and extract from the second output information, information corresponding to the event entity placeholder in the first event entity extraction prompt information as the event entity of the text to be processed.

[0145] Optionally, the large language model is trained in the following manner:

[0146] Acquire sample text and annotation event information of the sample text;

[0147] The sample text and the event type detection prompt information are combined into third input information, the third input information is analyzed using the initial large language model to obtain third output information, and the predicted event type of the text to be processed is obtained based on the third output information;

[0148] Acquire event entity extraction prompt information corresponding to the predicted event type as second event entity extraction prompt information;

[0149] For each second event entity extraction prompt information, the sample text and the second event entity extraction prompt information are combined into fourth input information, and the fourth input information is analyzed by using the initial large language model to obtain fourth output information;

[0150] Based on the third output information, the fourth output information and the labeled event information, it is determined whether the initial large language model has been trained, and the large language model is obtained after the training is completed.

[0151] Optionally, the device also includes: a conversion module, used to convert the event type of the text to be processed into a structured event type, convert the event entity of the text to be processed into a structured event entity, and merge the structured event type and the structured event entity as event information of the text to be processed.

[0152] In the embodiments of the present application, a large language model is used for multi-task learning to perform event type detection and event entity extraction. This can not only fully utilize the large language model's modeling capabilities for long texts, but also because event type detection and event entity extraction themselves have a strong correlation, multi-task learning can be used to learn the correlation between different tasks, thereby improving the processing performance of each task. Therefore, the accuracy of the event information extraction results can be improved, and when the system is deployed in actual applications, there is no need to deploy multiple models, which can simplify the processing process.

[0153] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0154] In an embodiment of the present application, an electronic device is also provided. The electronic device may include a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the event information extraction method of any of the above embodiments.

[0155] Reference Figure 5 , shows a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device 50 includes a processor 501 and a computer-readable storage medium 502 , on which a computer program 5021 is stored.

[0156] Processor 501 is used to execute computer program 5021 stored on computer-readable storage medium 502. When executing computer program 5021, processor 501 implements the event information extraction method of any of the above-mentioned embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0157] The processor 501 mentioned above may include but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0158] The computer-readable storage medium 502 mentioned above may include but is not limited to: read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), electronic erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.

[0159] In an embodiment of the present application, a computer-readable storage medium is also provided, on which a computer program is stored. The computer program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the event information extraction method described in any of the above embodiments.

[0160] Reference Figure 6 , shows a block diagram of a computer-readable storage medium according to an embodiment of the present application. Figure 6 As shown, a computer program 601 is stored on a computer-readable storage medium 60. When the computer program 601 is executed by a processor, the processor executes the event information extraction method described in any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0161] The various embodiments in this specification are interrelated, and each embodiment is described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.

[0162] It should be noted that all actions to obtain signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the location and with the authorization given by the owner of the corresponding device.

[0163] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0165] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0166] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0167] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0168] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0171] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. In summary, the content of this specification should not be understood as limiting the present application.< / trigger> < / trigger> < / type> < / type>

Claims

1. A method for extracting event information, characterized in that: The method comprises: The text to be processed and the event type detection prompt information are combined into first input information, the first input information is analyzed by using a pre-trained large language model to obtain first output information, and the event type of the text to be processed is obtained based on the first output information; Acquire event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information; Extract prompt information for each first event entity, combine the text to be processed and the first event entity extraction prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

2. The method according to claim 1, characterized in that The event entity extraction prompt information includes event trigger word extraction prompt information and event element extraction prompt information.

3. The method according to claim 2, characterized in that The event element extraction prompt information includes sentence filling prompt information, event element keyword extraction prompt information and event element role classification prompt information.

4. The method according to claim 1, characterized in that: The acquiring the event type of the to-be-processed text based on the first output information includes: The first output information is matched with the event type detection prompt information, and information corresponding to the event type placeholder in the event type detection prompt information is extracted from the first output information as the event type of the text to be processed.

5. The method according to claim 1, characterized in that The event entity of acquiring the text to be processed based on the second output information includes: The second output information is matched with the first event entity extraction prompt information, and information corresponding to the event entity placeholder in the first event entity extraction prompt information is extracted from the second output information as the event entity of the text to be processed.

6. The method according to claim 1, characterized in that The large language model is trained in the following way: Acquire sample text and annotation event information of the sample text; The sample text and the event type detection prompt information are combined into third input information, the third input information is analyzed using the initial large language model to obtain third output information, and the predicted event type of the text to be processed is obtained based on the third output information; Acquire event entity extraction prompt information corresponding to the predicted event type as second event entity extraction prompt information; For each second event entity extraction prompt information, the sample text and the second event entity extraction prompt information are combined into fourth input information, and the fourth input information is analyzed by using the initial large language model to obtain fourth output information; Based on the third output information, the fourth output information and the labeled event information, it is determined whether the initial large language model has been trained, and the large language model is obtained after the training is completed.

7. The method according to claim 1, characterized in that The method further comprises: The event type of the text to be processed is converted into a structured event type, the event entity of the text to be processed is converted into a structured event entity, and the structured event type and the structured event entity are merged as event information of the text to be processed.

8. An event information extraction device, characterized in that: The device comprises: A first extraction module, configured to combine the text to be processed and the event type detection prompt information into first input information, analyze the first input information using a pre-trained large language model to obtain first output information, and obtain the event type of the text to be processed based on the first output information; An acquisition module, used for acquiring event entity extraction prompt information corresponding to the event type of the text to be processed as first event entity extraction prompt information; The second extraction module is used to extract prompt information for each first event entity, combine the text to be processed and the first event entity extracted prompt information to form second input information, use the large language model to analyze the second input information to obtain second output information, and obtain the event entity of the text to be processed based on the second output information.

9. An electronic device, characterized in that: The electronic device comprises a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program; When the computer program is executed by the processor, the processor executes the event information extraction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the event information extraction method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Generative event argument extraction method and system and storage medium

    CN115238045A

  • Event element extraction method and device based on semantic analysis and prompt learning, electronic equipment and storage medium

    CN116186241A

  • Zero sample data knowledge extraction method and device based on large-scale language model

    CN117764158A

  • Event extraction method and device, electronic equipment and computer readable medium

    CN117933256A