Information extraction method, electronic device and computer readable storage medium

By constructing the information sample library of event objects and extracting and processing the text to be processed, the problem of poor coverage of event information extraction in the prior art is solved, and the accurate extraction of new event information and comprehensive improvement of information extraction is achieved.

CN118964621BActive Publication Date: 2025-02-25ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411419533.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-25
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

The prior art has poor full coverage in event information extraction, and it is impossible to accurately extract new event information that is not included in pre-notation.

Method used

By obtaining the target event in the pending text, constructing an information sample library of the event object, and using the sample library to extract information from the pending text, realizing the extraction of new event information.

Benefits of technology

It improves the comprehensiveness and accuracy of information extraction, reduces the amount of pre-noted data, and can effectively extract untrained target event information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964621B_ABST
    Figure CN118964621B_ABST
Patent Text Reader

Abstract

The present application discloses an information extraction method, an electronic device and a computer-readable storage medium, the information extraction method comprising: obtaining a text to be processed, the text to be processed including a target event; constructing an information sample library of the event object according to the event object in the target event, the information sample library including at least one object description information of the event object; performing information extraction processing on the text to be processed according to the text to be processed and each object description information in the information sample library, and obtaining event information of the target event in the text to be processed. Thus, the accuracy of information extraction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to an information extraction method, an electronic device and a computer-readable storage medium. Background Art

[0002] With the rapid development of society, the amount of event information is also increasing dramatically. Event information has important applications in public opinion detection, text summarization, automatic summarization, event extraction, and automatic construction of event graphs. Therefore, it is necessary to extract key event information from a large amount of unstructured text information to facilitate society to quickly understand the essence of the event.

[0003] Traditional information extraction methods mainly use pre-annotated event information for event extraction. However, real-world event information is diverse, and pre-annotated events usually cannot achieve full coverage, resulting in the inability to accurately extract new events that do not exist in the pre-annotated information. Summary of the invention

[0004] The main technical problem solved by the present application is to provide an information extraction method, an electronic device and a computer-readable storage medium, which can improve the comprehensiveness of information extraction.

[0005] In order to solve the above technical problems, a technical solution adopted by the present application is: providing an information extraction method, an electronic device and a computer-readable storage medium, wherein the information extraction method comprises: obtaining a text to be processed, wherein the text to be processed comprises a target event; constructing an information sample library of the event object according to the event object in the target event, wherein the information sample library comprises at least one object description information of the event object; performing information extraction processing on the text to be processed according to the text to be processed and each object description information in the information sample library, and obtaining event information of the target event in the text to be processed.

[0006] To solve the above technical problem, another technical solution adopted in the present application is: to provide an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above information extraction method.

[0007] In order to solve the above technical problem, another technical solution adopted by the present application is: providing a computer-readable storage medium including program data stored therein, wherein the program data is used to implement the above information extraction method when executed by a processor.

[0008] Compared with the traditional method of extracting information mainly based on pre-annotated event information, which leads to the problem of poor generalization ability of detecting newly added event information, the above scheme proposes an information extraction method, which includes: obtaining a text to be processed, which includes a target event; constructing an information sample library of the event object according to the event object in the target event, the information sample library including at least one object description information of the event object; performing information extraction processing on the text to be processed according to the text to be processed and the object description information in the information sample library, and obtaining the event information of the target event in the text to be processed. Thus, constructing an information sample library based on the event object of the target event in the text to be processed can not only reduce the amount of pre-annotation of data, but also, when the target event is an event type that has not been trained in advance, by constructing an information sample library of the event object corresponding to the target event, the event information extraction of the untrained target event can be realized, thereby improving the accuracy of information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0010] Figure 1 is a flowchart of an exemplary embodiment of the information extraction method shown in the present application;

[0011] Figure 2 yes Figure 1 A schematic flow chart of an exemplary embodiment of step S130 in the information extraction method is shown;

[0012] Figure 3 yes Figure 1 A flowchart of another exemplary embodiment of step S130 in the information extraction method is shown;

[0013] Figure 4 It is a schematic diagram of a framework of an exemplary embodiment of the information extraction method shown in the present application;

[0014] Figure 5 It is a specific flow chart of an exemplary embodiment of the information extraction method shown in the present application;

[0015] Figure 6 is a structural schematic diagram of an exemplary embodiment of an information extraction device shown in the present application;

[0016] Figure 7 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;

[0017] Figure 8 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0018] The technical solutions 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. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.

[0019] First of all, it should be noted that with the development of computer hardware and software, the problem of information acquisition and storage has been improved, but how to quickly and accurately extract the event information you want to pay attention to from various complex information is still a big problem. The task of event extraction is to convert the event information in unstructured text into a structured form to facilitate quick understanding of the essence of the event.

[0020] The traditional solution is to annotate real corpus in general or industry fields, then use the annotated corpus to fine-tune the model, and apply the fine-tuned model to the event extraction task. The difficulty of this method is that it requires a large amount of corpus annotation and targeted fine-tuning of the model. The fine-tuned model is limited to the event types of the annotated corpus, and the generalization effect for new event types is poor. Therefore, reducing data annotation and model training and improving the generalization of event extraction are issues that need to be urgently addressed.

[0021] Based on this, the present application proposes an information extraction method, an electronic device and a computer-readable storage medium. Figure 1 , Figure 1 It is a flowchart of an exemplary embodiment of the information extraction method shown in the present application.

[0022] The execution subject of the information extraction method may be a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The execution subject of the information extraction method may also be an information extraction device. In some possible implementations, the information extraction method may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0023] Specifically, the information extraction method of this embodiment includes the following steps:

[0024] S110: Acquire the text to be processed, where the text to be processed includes the target event.

[0025] The text to be processed may be a text from which event information needs to be extracted. The text to be processed may be a text at the chapter level or a text at the sentence level, and the language of the text to be processed may be Chinese, English, or any other language type. Exemplarily, the text to be processed may be a text in any format acquired by a computer device, for example, the text to be processed may be acquired from an online text library, a social media platform, or a professional database, or may be acquired from a location specified by a user, or may be a text to be processed submitted by a user.

[0026] The target event may be an event that needs to be detected from the text to be processed. Exemplarily, the target event can be determined according to the event information extraction requirements, which can be pre-set by the user. For example, if you want to know the events that occurred in a certain period of time for a product or multiple products, you can pre-define the events of the product to include five types: release, award, release, delisting, and recall. These five events are the target events that need to be detected from the text to be processed. Since it is necessary to extract event information from a large amount of unknown texts in practical applications, and the unknown texts have unknown nature and diversity, the text to be processed may not include the target event. Then, the event information of the target event cannot be detected from the text to be processed that does not include the target event. Based on this, a large amount of original texts obtained can be pre-processed, and the pre-processed original texts can be used as the text to be processed for information extraction. The pre-processing method can be to detect the verbs in the original text and remove the original texts that do not conform to the requirements at all.

[0027] One application scenario of this embodiment may be that the text to be processed includes a target event, and the text to be processed is classified according to the target event. For example, for a product, the text to be processed can be classified as published, awarded, released, removed from shelves, and recalled. Another application scenario may be that it is uncertain whether the text to be processed includes a target event, and the text to be processed is detected to determine whether the target event exists and the specific target event. It should be noted that a text to be processed may include multiple target events, for example, it may include both the target events of publication and release.

[0028] S120: constructing an information sample library of event objects according to the event object in the target event, wherein the information sample library includes at least one object description information of the event object.

[0029] The event object can be the event subject of the target event. For example, the event object can be a released product or a product that is shown. For example, a text to be processed is that mobile phone A was publicly released to the outside world on a certain day of a certain month of a certain year. Among them, the mobile phone is a product, so the event object is the product, and the product is a commodity or service with certain use value and meeting certain needs.

[0030] The information sample library is constructed according to the event object. The information sample library can be composed of small samples, and a large amount of data annotation is not required. In some embodiments, when the target event to be detected belongs to an unlabeled new event, an information sample library can be constructed according to the event object; and information extraction processing is performed on the text to be processed according to the information sample library; and when the target event in the acquired text to be processed belongs to a labeled event, there is no need to construct an information sample library corresponding to the event object, and information extraction is performed on the text to be processed directly according to the labeled event to obtain the event information of the target event in the text to be processed. After the information extraction processing is performed on the text to be processed according to the information sample library, the description information of each object in the information sample library is converted into a labeled event. In other embodiments, a corresponding information sample library can also be constructed for each information extraction task.

[0031] The information sample library can be constructed based on the behavioral attributes of the event object. Specifically, the information sample library is determined based on the events that may occur in the event object, and the information sample library should include the object description information of all events that occur in the event object as comprehensively as possible. For example, when the event object is a product, the events that may occur to the product include release, award, release, removal from the shelves and recall. Therefore, the information sample library of the event object of the product can be constructed based on these five events. Of course, they may not be fully listed, and this is just an example. The information sample library can also be constructed based on event information detection tasks, which can be submitted by users. For example, if a user wants to pay attention to the current product release information, award information and recall information, the information sample library can be constructed based on the product release, award and recall.

[0032] The object description information is a description of the event that occurs in the event object. Exemplarily, the object description information can be written and submitted by the user, or it can be obtained from historical event information. The object description information mainly provides event information extraction samples of the event object under different events. The object description information includes event type information and event element information. The event type information provides samples of event type detection of the event object under different events. As an example, the event type information may include a text sample, an event type in the text sample, and a trigger word in the text sample, wherein the trigger word is a verb that causes the corresponding event type to occur. The event element information provides samples of event element detection of the event object under different events. As an example, the event element information may include a text sample, an event type in the text sample, and event elements corresponding to each event type in the text sample. Each event type has at least one corresponding event type information, and each event type also has at least one corresponding event element information.

[0033] The information extraction device obtains the event object of the target event, and constructs corresponding object description information according to the behavior characteristics of the event object to obtain an information sample library.

[0034] S130: performing information extraction processing on the text to be processed according to the text to be processed and the description information of each object in the information sample library to obtain event information of the target event in the text to be processed.

[0035] The event information includes the event type of the target event, the event elements corresponding to each event type, the trigger words of the target event, etc. Exemplarily, the text to be processed and the description information of each object in the information sample library can be matched to obtain a matching result; if the matching result indicates a successful match, the corresponding object description information is determined as the event information of the target event in the text to be processed. In other embodiments, the description information of each object in the information sample library can also be learned by a model, and information extraction processing can be performed on the text to be processed according to the learned model to obtain the event information of the target event in the text to be processed.

[0036] It can be seen that the information extraction method of the embodiment of the present application obtains a text to be processed, and the text to be processed includes a target event; constructs an information sample library of the event object according to the event object in the target event, and the information sample library includes at least one object description information of the event object; performs information extraction processing on the text to be processed according to the text to be processed and each object description information in the information sample library, and obtains the event information of the target event in the text to be processed. Thus, constructing an information sample library according to the event object of the target event in the text to be processed can not only reduce the amount of pre-annotation of data, but also, when the target event is an event type that has not been trained in advance, by constructing an information sample library of the event object corresponding to the target event, the event information extraction of the untrained target event can be realized, thereby improving the accuracy of information extraction.

[0037] Based on the above embodiments, the embodiments of the present application adopt Figure 2 The flowchart details how to determine the target event type of the target event in the text to be processed based on the description information of each object in the information sample library. Figure 2 , Figure 2 yes Figure 1 The flowchart of an exemplary embodiment of step S130 in the information extraction method is shown. Specifically, step S130 performs information extraction processing on the text to be processed according to the text to be processed and the description information of each object in the information sample library, and the process of obtaining the event information of the target event in the text to be processed may include the following steps:

[0038] S210: Match the text to be processed with each event type information in the information sample library to obtain prompt event type information.

[0039] Before constructing the event type information in the information sample library, you can conduct a preliminary exploration of the event object and preset the event type and type meaning. Taking the product as the event object of the target event as an example, you can preset the event type of the following products:

[0040] (1) Release: specifically refers to the public release of a product to the public, such as the theme song of a movie, model A, etc.

[0041] (2) Awards: Awards for a film or TV work, such as the Sports Morality Award;

[0042] (3) Release: the release of a film or TV work, such as Movie A, Movie B, etc.;

[0043] (4) Delisting: a product or film or TV work is delisted, such as: C Film and TV;

[0044] (5) Recall: A product is recalled, such as a defective vehicle.

[0045] The object description information includes event type information, which is used to provide samples for event type detection and can be constructed according to the preset event type. For example, the construction format of the event type information is as follows: sent: text sample, event_type: preset event type, trigger: trigger word. An example is given based on this format:

[0046] [{'sent': 'Low-pressure fuel delivery pipe has safety hazards, and 40 imported President and Class A cars have been recalled', 'result': [{'event_type': 'Recall', 'trigger': 'Recall'}]}]

[0047] Among them, 'the low-pressure fuel delivery pipe has safety hazards and 40 imported President and Class A cars have been recalled' belongs to the text sample, 'recall' belongs to the preset event type, 'recall' belongs to the trigger word, and the trigger word belongs to the verb corresponding to the event type in the text sample.

[0048] The prompt event type information is used to help identify the event type in the text to be processed. Exemplarily, the text to be processed is matched with each event type information in the information sample library to obtain the prompt event type information. The matching processing method can be keyword matching, text feature matching, etc. As an example, the text to be processed and each event type information are encoded by a text encoder to obtain a text vector to be processed and an event type information vector of each event type information; the retrieval enhancement capability is used to perform similarity retrieval on the text vector to be processed based on each event type information vector, and the top K event type information vectors with similarity ranking from large to small are obtained; the event type information corresponding to the top K event type information vectors with similarity ranking is determined as the prompt event type vector. Among them, the text encoder can be a bge-m3 model, Word2Vec, etc., and the retrieval enhancement capability can use FAISS (Facebook AI Similarity Search, Facebook Artificial Intelligence Similarity Search), and K can be 1, 2, etc. In other embodiments, feature similarity calculations can also be performed on the text vector to be processed and the event type information vector of each event type information, and the feature similarity topk is selected as the prompt event type information. The feature similarity calculation method may include but is not limited to cosine similarity, Euclidean distance, etc. Therefore, the search enhancement capability is used to select the most suitable event type information for the processed text, and use it as the prompt event type information, improve the prompt performance through dynamic prompts, and reduce the prompt length caused by too many event types, resulting in information forgetting.

[0049] S220: Performing event type detection on the text to be processed according to the prompted event type information to obtain a target event type of the target event in the text to be processed.

[0050] The event information includes a target event type, and the target event type can be a category of a target event in the text to be processed. In some embodiments, the prompt event type information and the text to be processed can be spliced ​​to obtain a spliced ​​text to be processed; the spliced ​​text to be processed and the event types in each event type information can be spliced ​​to obtain a spliced ​​text to be detected; the spliced ​​text to be detected is input into a classification model for classification processing to determine the target event type of the target event in the text to be processed. Thus, matching prompt event type information is first selected from the information sample library, and then event type detection is performed on the text to be processed according to the prompt event type information, so that the accuracy of event type detection can be improved.

[0051] In other embodiments, the target event type of the target event in the text to be processed can also be detected by the question-answering big model. As an example, the prompt event type information and the text to be processed are input into the question-answering big model to obtain the event type of the target event in the text to be processed output by the question-answering big model; the event type of the text to be processed output by the question-answering big model is determined as the target event type of the target event in the text to be processed. Thus, the event type is detected by the question-answering big model, and a better information extraction effect can be achieved without fine-tuning the model.

[0052] The question-answering model is a large-scale artificial intelligence model used to understand and answer questions raised by users, classify the target events in the text to be processed, and obtain the event type of the target event. Exemplarily, the question-answering model may include but is not limited to GPT-3, GPT-4, Tongyi Qianwen, etc. As an example, the input of the constructed question-answering model is as follows:

[0053] Task description: You are an assistant who helps to extract the target event type and its corresponding trigger words from the text to be processed. Please extract according to the input text to be processed and the prompt event type information according to the extraction rules and event type definition.

[0054] Extraction rules:

[0055] 1. Each text to be processed should contain at least one target event;

[0056] 2. The output only contains the target event type and trigger words, and no additional explanation is required;

[0057] 3. The target event type can only be selected from the following list: [Release, Award, Release, Delisting, Recall]

[0058] 4. Your output results can only come from the text to be processed and cannot be made up randomly.

[0059] Event type definition:

[0060] Release: specifically refers to the public release of a product to the public;

[0061] Awards: Awards for a certain film or TV work;

[0062] Release: the release of a film or TV work;

[0063] Delisting: a product or film or TV work is removed from the shelves;

[0064] Recall: A product is recalled;

[0065] Output format definition: Each event contains an event type and a trigger word. The specific format is as follows: {event_type:'',trigger:''}.

[0066] The relevant prompt event type information is as follows:

[0067] Input: Low-pressure fuel delivery pipe has safety hazards, and the recall of 40 imported President and Class A vehicles has been expanded.

[0068] output: {'event_type': 'Recall', 'trigger': 'Recall'}

[0069] Question:{} / / Text to be processed

[0070] The question-answering model has a certain reading comprehension ability and can output the event type of the target event in the text to be processed according to the constructed input. And the event type output by the question-answering model is determined as the target event type of the target event in the text to be processed.

[0071] As another example, in order to prevent the erroneous results output by the question-answering model from being passed to the downstream and affecting subsequent operations, the event type output by the question-answering model can be verified. The specific process is as follows: input the prompt event type information and the text to be processed into the question-answering model to obtain the event type of the target event in the text to be processed output by the question-answering model; verify the event type output by the question-answering model according to the event type information in the information sample library to obtain the target event type of the target event in the text to be processed. In this way, the results output by the question-answering model are verified to ensure that the output results meet the extraction requirements and ensure the accuracy of the target event type.

[0072] The verification process may include: in response to the presence of an event type output by the question-answering model in the preset event types of each event type information in the information sample library, determining the event type as the target event type; in response to the absence of an event type output by the question-answering model in the preset event types of each event type information in the information sample library, determining the preset event type in the prompt event type information as the target event type. This ensures that the target event type will not deviate from the preset event type, thereby improving the accuracy of the target event type.

[0073] Each event type information in the information sample library includes a preset event type, which can be preset. The event type output by the question-answering model is compared with each preset event type. If the event type output by the question-answering model belongs to the preset event type, the event type output by the question-answering model is normally returned as the target event type; if the event type output by the question-answering model does not belong to the preset event type, the preset event type in the prompt event type information is determined as the target event type. The prompt event type information is the text that is most similar to the text to be processed in each event type information in the information sample library. If there are multiple prompt event type information, the preset event type in the prompt event type information with the highest similarity can be determined as the target event type.

[0074] In other embodiments, after determining that the event type output by the question and answer big model exists in the preset event types of each event type information in the information sample library, it is also necessary to obtain the similarity between the event type output by the question and answer big model and the preset event type in the prompt event type information. If the similarity is lower than the preset similarity threshold, it is characterized that there is an error in the output result, and the preset event type of the prompt event type information is determined as the target event type.

[0075] In addition, the Q&A model will not only output the event type of the target event in the text to be processed, but also the trigger word of the target event to determine the specific action of the event in the text to be processed. Therefore, the trigger word output by the Q&A model can also be verified. The verification method is: determine whether the trigger word output by the Q&A model is a verb in the text to be processed. If so, return normally. If not, perform word segmentation on the text to be processed, and use the text encoder bge-m3 model to return the result with the highest similarity to the prompt event type information.

[0076] In other embodiments, see Figure 3 , Figure 3 yes Figure 1 The flowchart of another exemplary embodiment of step S130 in the information extraction method is shown. Specifically, step S130 performs information extraction processing on the text to be processed according to the text to be processed and the description information of each object in the information sample library, and the process of obtaining the event information of the target event in the text to be processed may also include the following steps:

[0077] S310: Match the text to be processed with each event type information in the information sample library to obtain prompt event type information.

[0078] The detailed description of step S310 in the embodiment of the present application can refer to step S210 in the above embodiment, which will not be repeated here.

[0079] S320: Perform event type detection on the text to be processed according to the prompted event type information to obtain a target event type of the target event in the text to be processed.

[0080] The detailed description of step S320 in the embodiment of the present application can refer to step S220 in the above embodiment, which will not be repeated here.

[0081] S330: Selecting prompt event element information from each event element information in the information sample library according to the target event type and the text to be processed.

[0082] Similarly, before constructing the event element information in the information sample library, you can conduct a preliminary exploration of the preset event types and event elements to be extracted, and preset the types and meanings of the event elements. Taking the product as the event object of the target event as an example, you can preset the event elements of the following products:

[0083] 1) Release-time, release-released product, release-releaser;

[0084] 2) Award-time, Award-winner, Award-awarding institution;

[0085] 3) Release-time, release-releaser, release-released film and television;

[0086] 4) Delisting – time, Delisting – product removed from shelves, Delisting – party being removed from shelves, Delisting – party removing from shelves;

[0087] 5) Recall-time, recall-content of recall, recall-recalling party.

[0088] The object description information includes event element information, which is used to provide samples for event element detection and can be constructed according to preset event elements. For example, the construction format of event element information is as follows: sent: text sample, event_type: preset event type, arguments: preset event element type and its content. An example is given based on this format:

[0089] [{'sent': 'Low-pressure fuel delivery pipe has safety hazards. 40 imported President and Ghibli vehicles are recalled, event_type: recall, trigger: recall', 'result': {'event_type': 'Recall', 'arguments': [{'Recall content': '40 imported President and A vehicles'}]}}]

[0090] Among them, first determine the event type in the text sample as recall, and then determine the event element of the recall event type from the text sample. The recall includes the recall time, recall content and recalling party. There is no recall time in the text sample, so the extracted event elements include the recall content of 40 imported Presidents and the recalling party A cars.

[0091] The prompt event element information is used to help identify the event elements corresponding to each event type in the text to be processed. Exemplarily, the event element information in the information sample library can be matched based on the target event type and the text to be processed to obtain the prompt event element information. Specifically, the target event type and the text to be processed are used as inputs for event element extraction. The input constructed by combining the two is as follows:

[0092] {'sent': 'Low-pressure fuel delivery pipe has safety risks. 40 imported Quattroporte and Ghibli vehicles are recalled, event_type: recall, trigger: recall'}

[0093] Among them, sent represents the text to be processed, event_type represents the target event type, and trigger represents the trigger word.

[0094] For the convenience of description, the input constructed by merging the target event type and the text to be processed is determined as the event element to be detected text. The event element to be detected text is matched with each event element information in the information sample library to obtain prompt event element information. The matching processing method can be keyword matching, text feature matching, etc. As an example, the event element to be detected text and each event element information are encoded by a text encoder to obtain an event element to be detected text vector of the event element to be detected text and an event element information vector of each event element information; the event element to be detected text vector is retrieved based on each event element information vector by using the retrieval enhancement capability, and the top K event element information vectors with similarity ranking from large to small are obtained; the event element information corresponding to the top K event element information vectors with similarity ranking is determined as the prompt event element vector. Among them, the text encoder can be a bge-m3 model, Word2Vec, etc., and the retrieval enhancement capability can use FAISS (Facebook AI Similarity Search), and K can be 1, 2, etc. In other embodiments, feature similarity calculations may be performed on the event element to be detected text vector and the event element information vector of each event element information, and the feature similarity topk may be selected as the prompt event element information. The feature similarity calculation method may be, but is not limited to, cosine similarity, Euclidean distance, etc. Thus, the most suitable event element information is selected for the processed text using the retrieval enhancement capability, and it is used as the prompt event element information, and the prompt performance can be improved through dynamic prompts.

[0095] S340: Perform event element detection on the text to be processed according to the prompt event element information and the target event type, and obtain the target event element corresponding to the target event type.

[0096] The event information includes a target event element, and the target event element can be the detailed information corresponding to the target event type in the text to be processed. In some embodiments, the prompt event element information, the target event type and the text to be processed can be spliced ​​to obtain the spliced ​​text to be processed; the spliced ​​text to be processed and the event elements in each event element information can be spliced ​​to obtain the spliced ​​text to be detected; the spliced ​​text to be detected is input into the classification model for classification processing to determine the target event element of the target event type in the text to be processed. Thus, the matching prompt event element information is first selected from the information sample library, and then the event element detection is performed on the text to be processed according to the prompt event element information, which can improve the accuracy of event element detection.

[0097] In other embodiments, the target event element of the target event type in the text to be processed can also be detected by the question-answering large model. As an example, the prompt event element information, the target event type and the text to be processed are input into the second question-answering large model to obtain the event element corresponding to the target event type output by the second question-answering large model; the event element corresponding to the target event type output by the second question-answering large model is verified according to the event element information in the information sample library to obtain the target event element of the text to be processed. In this way, the detection of event elements is realized by the question-answering large model, and a better information extraction effect can be achieved without fine-tuning the model.

[0098] The question-answering big model is a large-scale artificial intelligence model used to understand and answer questions raised by users. It classifies the target events in the processed text and obtains the target event elements of the target event type. Exemplarily, the question-answering big model may include but is not limited to GPT-3, GPT-4, Tongyi Qianwen, etc. The question-answering big model for detecting the target event type may be the same as or different from the question-answering big model for detecting the target event element. As an example, the input of the constructed question-answering big model is as follows:

[0099] Task description: You are an assistant who helps to extract event elements from the text to be processed. Please output the event elements in a specific format based on the input text to be processed, the event detection results and the event element information.

[0100] Extraction rules:

[0101] 1. Each text to be processed should contain at least zero event elements and at most four event elements;

[0102] 2. The output only contains event elements, and no additional explanation is required;

[0103] 3. In the "Event Type Detection" section, please output the corresponding event elements for the event type and trigger word in the text to be processed.

[0104] 4. Your output results can only come from the text to be processed and cannot be made up randomly.

[0105] 5. Your output can only be combined with 'Event Type Detection' and the event element type corresponding to the event type: [time, recall content, recall party]

[0106] Extract information definition:

[0107] Time: the time when the product was recalled;

[0108] Recall content: What exactly is being recalled?

[0109] Recalling party: the subject of the recall;

[0110] Output format definition: The output should be an event element containing the corresponding event type, {event_type:'',arguments:[{Arg1,Arg2...}]}

[0111] The relevant samples are as follows:

[0112] Input: Low-pressure fuel delivery pipe has safety hazards, and the recall of 40 imported President and Class A vehicles has been expanded.

[0113] output: {'event_type': 'Recall', 'arguments': [{'Recall content': '40 imported President and Model A cars'}]}

[0114] Event type detection: {'event_type': 'recall', 'trigger': 'recall'}

[0115] Question:{} / / Text to be processed

[0116] The question-answering model has a certain reading comprehension ability and can output the target event element of the target event type in the text to be processed according to the constructed input. And the event element output by the question-answering model is determined as the target event element corresponding to the target event type in the text to be processed.

[0117] As another example, in order to avoid using the wrong result output by the question-answering big model as the target event element, the event element output by the question-answering big model can be verified. The specific process is as follows: input the prompt event element information, the target event type and the text to be processed into the question-answering big model to obtain the target event element of the target event type in the text to be processed output by the question-answering big model; verify the event element output by the question-answering big model according to the information of each event element in the information sample library to obtain the target event element of the target event type in the text to be processed. In this way, the result output by the question-answering big model is verified to ensure that the output result meets the extraction requirements and the accuracy of the target event element is ensured.

[0118] The verification process includes: obtaining a preset event element of event element information corresponding to the target event type from the information sample library; in response to the presence of an event element corresponding to the target event type output by the second question-answering model in the obtained preset event element, determining the event element as the target event element of the text to be processed, thereby avoiding the generation of content that does not belong to the preset event element.

[0119] The event element information in the information sample library of the information extraction device includes preset event elements, which can be preset. The event elements output by the question-and-answer big model are compared with the preset event elements under the target event type. If the event element output by the question-and-answer big model belongs to the preset event element, the event element output by the question-and-answer big model is normally returned as the target event element; if the event element output by the question-and-answer model does not belong to the preset event element, the preset event element in the prompt event element information is determined as the target event element. The prompt event element information is the text that is most similar to the text to be processed between the event element information in the information sample library. If there are multiple prompt event element information, the preset event element in the prompt event element information with the highest similarity can be determined as the target event element.

[0120] In other embodiments, after determining that the event element output by the question and answer big model exists in the preset event elements of each event element information of the target event type in the information sample library, it is also necessary to obtain the similarity between the event element output by the question and answer big model and the preset event element in the prompt event element information. If the similarity is lower than the preset similarity threshold, it indicates that there is an error in the output result, and the preset event element of the prompt event element information is determined as the target event element.

[0121] It can be seen that the embodiment of the present application divides information extraction into event type detection and event element detection, so as to extract the core elements in the text to be processed in a pipeline manner.

[0122] After obtaining the target event type and target event element of the text to be processed, the information extraction device outputs the target event type and target event element in a structured manner so as to facilitate subsequent use in public opinion analysis and event graph construction.

[0123] In order to elaborate on the information extraction method of the present application, Figure 4 The frame diagram and Figure 5 The flowchart shown further illustrates it, and the details are as follows:

[0124] The preset event type and event type definition are determined according to the event object and the information extraction task, and the upper and lower limits of the event type that may exist in a text to be processed are determined. Then, based on the preset event type and the event element to be extracted, the preset event element and the type definition of the event element are determined, and the upper and lower limits of the event element that may exist in a text to be processed are determined.

[0125] Event type information is constructed according to a preset event type, event element information is constructed according to a preset event element, and an information sample library is constructed based on the event type information and the event element information.

[0126] The text to be processed and the event type information are respectively input into the text encoder (Encoder) for encoding processing to obtain the text vector to be processed and the event type information vector; the FAISS retrieval enhancement capability is used to perform similarity retrieval on the text vector to be processed based on the event type information vector, and the event type information corresponding to the event type information vector corresponding to the maximum similarity is determined as the prompt event type information; the prompt event type information and the text to be processed are input into the question-answering big model to obtain the event type output by the question-answering big model; the event type output by the question-answering big model is verified and corrected according to the preset event type to obtain the target event type; the text to be processed and the target event type are merged and input into the text encoder. This encoder (Encoder) obtains the text vector of the event element to be detected; inputs the information of each event element in the information sample library into the text encoder (Encoder) to obtain the event element information vector; uses the FAISS retrieval enhancement capability to perform similarity retrieval on the event element text vector to be detected based on the event element information vector, and determines the event element information corresponding to the event element information vector corresponding to the maximum similarity as the prompt event element information; inputs the prompt event element information and the text to be processed into the question-answering large model to obtain the event element output by the question-answering large model; verifies and corrects the event element output by the question-answering large model according to the preset event element to obtain the target event element. Therefore, this application does not rely on a large amount of data annotation, but only needs to construct an information sample library for different types of events, and use retrieval enhancement to dynamically add it to the prompt, without the need for model fine-tuning, and relies on the generation capability of the large model and the prompt event type information and prompt event element information of the retrieval enhancement to improve the extraction effect.

[0127] Finally, the event information extraction results are structured and the event type detection results and event element extraction results are output in a structured manner to facilitate subsequent use in public opinion analysis and event graph construction.

[0128] See also Figure 6 , Figure 6 It is a structural diagram of an exemplary embodiment of the information extraction device shown in the present application. The information extraction device 600 includes an acquisition module 610, a construction module 620 and an information extraction module 630. The acquisition module 610 is used to acquire the text to be processed, and the text to be processed includes a target event; the construction module 620 is used to construct an information sample library of the event object according to the event object in the target event, and the information sample library includes at least one object description information of the event object; the information extraction module 630 is used to perform information extraction processing on the text to be processed according to the text to be processed and the object description information in the information sample library, and obtain the event information of the target event in the text to be processed.

[0129] In the above scheme, the information extraction device obtains the text to be processed, and the text to be processed includes the target event; constructs an information sample library of the event object according to the event object in the target event, and the information sample library includes at least one object description information of the event object; performs information extraction processing on the text to be processed according to the text to be processed and the object description information in the information sample library, and obtains the event information of the target event in the text to be processed. Thus, constructing the information sample library according to the event object of the target event in the text to be processed can not only reduce the amount of pre-labeling of data, but also, when the target event is an event type that has not been trained in advance, by constructing an information sample library of the event object corresponding to the target event, the event information of the untrained target event can be extracted, thereby improving the accuracy of information extraction.

[0130] The functions of each module can be found in the information extraction method embodiment, which will not be described in detail here.

[0131] In order to implement the information extraction method of the above embodiment, the present application proposes another electronic device, which can be found in detail. Figure 7 , Figure 7 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application.

[0132] The electronic device 700 includes a memory 710 and a processor 720 , wherein the memory 710 and the processor 720 are coupled.

[0133] The memory 710 is used to store program data, and the processor 720 is used to execute the program data to implement the information extraction method of the above embodiment.

[0134] In this embodiment, the processor 720 may also be referred to as a CPU (Central Processing Unit). The processor 720 may be an integrated circuit chip having signal processing capabilities. The processor 720 may also be a general-purpose processor, 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. A general-purpose processor may be a microprocessor or the processor 720 may also be any conventional processor, etc.

[0135] The present application also provides a computer-readable storage medium, such as Figure 8 As shown, the computer-readable storage medium 800 is used to store program data 810. When the program data 810 is executed by the processor, it is used to implement the information extraction method in the method embodiment of the present application.

[0136] The method involved in the information extraction method embodiment of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0137] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An information extraction method, characterized in that: The information extraction method comprises: Acquire a text to be processed, wherein the text to be processed includes a target event; Constructing an information sample library of the event object according to the event object in the target event, the information sample library including at least one object description information of the event object, wherein when the target event is an unlabeled new event, constructing the information sample library of the event object according to the behavior attribute of the event object, the event object being the event occurrence subject of the target event; Performing information extraction processing on the text to be processed according to the text to be processed and the description information of each object in the information sample library to obtain event information of the target event in the text to be processed; The object description information includes event type information, the event type information provides samples of event type detection of the event object under different events, the event type information includes text samples, event types in the text samples and trigger words in the text samples, the event information includes target event types, and the step of performing information extraction processing on the text to be processed according to the text to be processed and the description information of each object in the information sample library to obtain event information of the target event in the text to be processed includes: Matching the text to be processed with each event type information in the information sample library respectively to obtain prompt event type information, wherein the text to be processed and each event type information are respectively encoded by a text encoder to obtain a text vector to be processed and an event type information vector of each event type information; using the retrieval enhancement capability to perform similarity retrieval on the text vector to be processed based on each event type information vector, and determining the event type information corresponding to the maximum similarity as the prompt event type information of the text to be processed, wherein the prompt event type information is used to help identify the event type in the text to be processed; The step of performing event type detection on the text to be processed according to the prompt event type information to obtain the target event type of the target event in the text to be processed includes: Input the prompt event type information and the text to be processed into the question-answering big model to obtain the event type of the target event in the text to be processed output by the question-answering big model; The event type of the text to be processed output by the question-answering large model is determined as the target event type of the target event in the text to be processed.

2. The information extraction method according to claim 1, characterized in that: The object description information includes event type information and event element information, the event element information is used to provide samples for event element detection, the event information includes a target event type and a target event element, and the step of performing information extraction processing on the text to be processed according to the text to be processed and the object description information in the information sample library to obtain event information of the target event in the text to be processed includes: Matching the text to be processed with each event type information in the information sample library to obtain prompt event type information; Performing event type detection on the text to be processed according to the prompt event type information to obtain a target event type of a target event in the text to be processed; Selecting prompt event element information from each event element information in the information sample library according to the target event type and the text to be processed, wherein the prompt event element information is used to help identify event elements corresponding to each event type in the text to be processed; Event element detection is performed on the text to be processed according to the prompt event element information and the target event type to obtain a target event element corresponding to the target event type.

3. The information extraction method according to any one of claims 1 to 2, characterized in that: The step of performing event type detection on the text to be processed according to the prompt event type information to obtain the target event type of the target event in the text to be processed includes: Input the prompt event type information and the text to be processed into the question-answering big model to obtain the event type of the target event in the text to be processed output by the question-answering big model; The event type output by the question-answering model is verified according to each event type information in the information sample library to obtain the target event type of the target event in the text to be processed.

4. The information extraction method according to claim 3, characterized in that: The event type information includes a preset event type, and the step of verifying the event type output by the question-answering model according to each event type information in the information sample library to obtain a target event type of the target event in the text to be processed includes: In response to the presence of the event type output by the question-answering model in the preset event types of each event type information in the information sample library, determining the event type as the target event type; In response to the fact that the event type output by the question-and-answer model does not exist in the preset event types of each event type information in the information sample library, the preset event type in the prompt event type information is determined as the target event type.

5. The information extraction method according to claim 2, characterized in that: The step of performing event element detection on the to-be-processed text according to the prompt event element information and the target event type to obtain a target event element corresponding to the target event type includes: Input the prompt event element information, the target event type and the to-be-processed text into the question-answering big model, and obtain the event element corresponding to the target event type output by the question-answering big model; The event element corresponding to the target event type output by the question-answering model is verified according to the event element information in the information sample library to obtain the target event element of the text to be processed.

6. The information extraction method according to claim 5, characterized in that: The event element information includes preset event elements, and the step of verifying the event elements corresponding to the target event type output by the question-answering model according to the event element information in the information sample library to obtain the target event elements of the text to be processed includes: Acquire a preset event element of event element information corresponding to the target event type from the information sample library; In response to the presence of an event element corresponding to the target event type output by the question-and-answer model in the acquired preset event elements, the event element is determined as the target event element of the text to be processed.

7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the information extraction method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: include: Program data is stored, and when the program data is executed by a processor, it is used to implement the information extraction method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Case dispatch processing method and device, electronic equipment and storage medium

    CN112597286A

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

    CN116956933A

  • Information processing method and device, equipment, storage medium and program product

    CN118708676A