Chapter event extraction method, system, device and storage medium

By designing specific instruction templates and LoRA fine-tuning technology, a high-quality chapter event large language model is constructed, which solves the problems of low accuracy and unstable output of chapter event extraction in the existing technology, and achieves better summary and domain analysis. Adaptability.

CN117648397BActive Publication Date: 2024-09-10GLOBAL TONE COMM TECH
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202311470833.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2024-09-10
Estimated Expiration
2043-11-07

AI Technical Summary

Technical Problem

The existing technology has problems such as poor summarization ability, too redundant events, poor generalization ability, poor domain adaptability, and low overall accuracy caused by multi-step errors in chapter event extraction, and the output format of the open source large language model is unstable. , the event name and event arguments are made up, and the model does not follow the input instructions.

Method used

Design a theoretical general argument instruction template and a theoretical fine argument instruction template, obtain annotation data through ChatGPT, build a high-quality chapter instruction set, and use the LoRA neural network to fine-tune the instructions of the open source large language model to form a target large language model. Optimize its output format and event extraction accuracy.

Benefits of technology

It improves the summary ability of chapter event extraction, reduces event redundancy and generalization errors, enhances domain adaptability and accuracy, ensures stable output format, avoids random fabrication, and the model follows input instructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117648397B
    Figure CN117648397B
Patent Text Reader

Abstract

The present invention proposes a method, system, device and storage medium for extracting chapter events, which includes: selecting and cleaning news material samples from open source news and preset news databases; respectively designing theoretical general argument instruction templates and theoretical fine argument instruction templates, inputting news material samples into ChatGPT, and obtaining actual general argument instructions and actual fine argument instructions; obtaining a chapter instruction set; based on the chapter instruction set, combined with the trained LoRA neural network, fine-tuning the instructions of the open source large language model to obtain a target large language model; debugging the output instructions corresponding to the target large language model, inputting the chapter to be tested into the debugged target large language model, and obtaining the extracted events. The chapter event large language model constructed by the present invention effectively optimizes its poor inductive and summarizing ability, excessive event redundancy, poor generalization ability, poor domain adaptability, and low overall accuracy caused by multi-step errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a chapter event extraction method, system, device and storage medium. Background Art

[0002] Paragraph event extraction is a subtask of natural language processing. It has broad application scenarios in many industries such as information mining and public opinion analysis. It is an important research direction and hotspot in the field of natural language processing, and is also one of the important signs of the maturity of artificial intelligence.

[0003] Most of the event extraction methods on the market are based on the sentence level, and the extraction process is serial: first, the event type and event trigger words contained in the sentence are extracted through the sequence annotation model; then, based on the event trigger words, the event roles and event elements in the sentence are extracted in sequence through the pointer network model; finally, based on the original sentence, the event name is extracted through the summary model. For the extraction of chapter events, the traditional approach is mostly to directly use the main paragraph of the chapter or generate a summary of the chapter and convert it into sentence-level event extraction.

[0004] The traditional sentence-level event extraction leads to problems such as poor summarization and generalization ability, excessive event redundancy, poor generalization ability, poor domain adaptability, and low overall accuracy caused by multi-step errors; the current open source large language models show problems such as unstable output format, fabricated elements in event names and event arguments, and the model does not follow input instructions in the paragraph event extraction task. Summary of the invention

[0005] The present invention provides a chapter event extraction method, system, device and storage medium, the main purpose of which is to effectively optimize the problems of traditional methods such as poor chapter event summarization ability, excessive event redundancy, poor generalization ability, poor domain adaptability and low overall accuracy caused by multi-step errors.

[0006] In a first aspect, an embodiment of the present invention provides a chapter event extraction method, comprising:

[0007] Selecting news material samples from open source news and preset news databases, and cleaning the news material samples;

[0008] A theoretical general argument instruction template and a theoretical fine argument instruction template are respectively designed, and based on the theoretical general argument instruction template and the theoretical fine argument instruction template, the news material sample is input into ChatGPT to obtain an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample;

[0009] Based on the actual general argument instruction and the actual fine argument instruction, expansion is performed to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set;

[0010] Based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction, the LoRA neural network is trained to obtain a trained LoRA neural network, and the trained LoRA neural network is used to fine-tune the instructions of the open source large language model to obtain a target large language model;

[0011] Debugging the output instructions corresponding to the target large language model to obtain the best output instructions and the debugged target large language model;

[0012] The passage to be tested is input into the debugged target large language model to obtain extraction events.

[0013] Further, the LoRA neural network is trained based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction to obtain the trained LoRA neural network, and the trained LoRA neural network is used to fine-tune the open source large language model to obtain the target large language model, including:

[0014] Based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction, the LoRA neural network is trained to obtain a trained LoRA neural network;

[0015] Migrating the weight parameters of the trained LoRA neural network to the open source large language model;

[0016] The weight parameters that have not been migrated in the open source large language model are trained to obtain the target large language model.

[0017] Furthermore, the weight parameters that have not been migrated in the open source large language model are trained to obtain the target large language model, and the calculation formula is as follows:

[0018] W=W 0 +ΔW=W 0 +HK,

[0019] Wherein, W represents the weight parameter of the target large language model, W 0represents the weight parameters migrated from the trained LoRA neural network in the open source large language model, ΔW represents the weight parameters that have not been migrated in the open source large language model, H represents the dimension increase matrix, and K represents the dimension reduction matrix.

[0020] Furthermore, the cleaning of the news material sample includes:

[0021] Delete news material samples with less than 300 words or more than 1,000 words;

[0022] Classify the data sources of news material samples and select a preset number from each of the military, political, diplomatic, security, economic, scientific and technological, and entertainment categories;

[0023] Use regular expressions to filter out emoticons, invalid URLs, and front-end codes in news material samples.

[0024] Furthermore, the theoretical general argument instruction template is as follows:

[0025] [Event name, event category, event time, event location, event subject, event object].

[0026] Furthermore, the theoretical fine argument instruction template is as follows:

[0027] [event name, event category, fine argument 1, …, fine argument N], where N is a positive integer.

[0028] In a second aspect, an embodiment of the present invention provides a chapter event extraction system, comprising:

[0029] A cleaning module, used to select news material samples from open source news and preset news databases, and clean the news material samples;

[0030] An instruction module is used to design a theoretical general argument instruction template and a theoretical fine argument instruction template respectively, and based on the theoretical general argument instruction template and the theoretical fine argument instruction template, input the news material sample into ChatGPT to obtain an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample;

[0031] An extension module, used for extending based on the actual general argument instruction and the actual fine argument instruction to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set;

[0032] A fine-tuning module is used to train the LoRA neural network based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction to obtain the trained LoRA neural network, and use the trained LoRA neural network to fine-tune the open source large language model to obtain the target large language model;

[0033] A debugging module, used to debug the output instructions corresponding to the target large language model, and obtain the best output instructions and the debugged target large language model;

[0034] The extraction module is used to input the passage to be tested into the debugged target large language model to obtain extraction events.

[0035] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned chapter event extraction method when executing the computer program.

[0036] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned chapter event extraction method are implemented.

[0037] The present invention proposes a method, system, device and storage medium for extracting chapter events. By designing two types of instruction templates, namely theoretical general argument instruction templates and theoretical fine argument instruction templates, news material sample annotation data is obtained based on ChatGPT to obtain actual general argument instructions and actual fine argument instructions. Combined with the usage scenarios of downstream tasks, a high-quality chapter instruction set is constructed based on the actual general argument instructions and the actual fine argument instructions. Finally, a target large language model is formed based on the Lora fine-tuning technology.

[0038] Compared with the traditional extractive event model, the chapter event large language model constructed by the present invention effectively optimizes its problems such as poor inductive summarization ability, excessive event redundancy, poor generalization ability, poor domain adaptability and low overall accuracy caused by multi-step errors.

[0039] Compared with the open source big language model, the chapter event big language model constructed by the present invention effectively optimizes the problems of unstable output format, fabricated elements in event names and event arguments, and the model not following input instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flowchart of a chapter event extraction method provided by an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of the structure of a chapter event extraction system provided by an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention.

[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0045] In order to enable those skilled in the art to better understand the solutions of the present application, 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. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0046] In the embodiments of the present application, at least one refers to one or more; multiple refers to two or more. In the description of the present application, words such as "first", "second", and "third" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In addition, the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0047] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include a particular feature, structure or characteristic described in conjunction with the embodiment. Thus, in this specification, the terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0048] The current mainstream market practices have the following problems:

[0049] First, event information at the sentence level is often relatively simple and cannot effectively summarize the overall meaning of the entire article, and has no ability to summarize and generalize; at the same time, an article often contains multiple sentences, and different sentences may describe similar content, resulting in the final extracted events being too complicated, affecting the application of downstream tasks.

[0050] Second, the traditional sentence-level event extraction method is based on a supervised model, which requires the event categories and event elements to be defined in advance for supervised training. Its generalization ability and domain adaptability are poor.

[0051] Third, the traditional sentence-level event extraction method is serial, that is, first extracting the event type and event trigger words, then extracting the event role and event elements, and finally extracting the event name. The model has multi-step errors and the overall accuracy is low.

[0052] In addition, there are the following problems in extracting chapter events based on currently open source large language models such as llama2 and chatglm-6b:

[0053] First, due to the randomness and instability of the generative model, the output format of the model varies greatly and cannot be effectively parsed, which affects the application of downstream tasks.

[0054] Second, due to the performance of the open source large language model itself, there are often fabricated elements in the extraction of event names, event arguments, etc., which affects the overall accuracy of the event.

[0055] Third, the open source large language model does not perform well enough on complex tasks such as paragraph event extraction. It usually does not follow the input instructions, the extracted event categories are irrelevant to the input instructions, or the extracted content is beyond the instructions, so further fine-tuning is needed.

[0056] In view of the problems existing in the traditional event extraction technology, the present invention makes improvements from the following aspects:

[0057] In order to solve the problems of poor summarization and generalization ability, excessive event redundancy, poor generalization ability, poor domain adaptability and low overall accuracy caused by multi-step errors caused by traditional sentence-level event extraction, the present invention performs paragraph event extraction based on a large language model and transfer learning.

[0058] On the one hand, the large language model is pre-trained on a large amount of unsupervised data and has strong prior knowledge. Its ability to summarize and generalize news articles is far superior to traditional extractive models. At the same time, the large language model has strong zero-sample reasoning ability, so its generalization ability and domain adaptability for event extraction tasks are also far superior to traditional extractive models. On the other hand, article event extraction based on the large language model can directly generate the core events of the article, which effectively solves the problem of redundant events. At the same time, the large language model is an autoregressive generative model with only single-step error and relatively high overall accuracy.

[0059] In order to solve the problems of unstable output format, fabricated elements in event names and event arguments, and failure of large language models to follow input instructions in the current open source large language models such as llama2 and chatglm-6b in the paragraph event extraction task, the present invention constructs a batch of high-quality paragraph instruction sets and fine-tunes the instructions of the open source large language models.

[0060] The chapter instruction set is divided into four parts to meet different mission scenarios.

[0061] The first part is in the form of "event name, event category, event subject, event object, event time, event location" to meet the needs of open domain & general chapter event extraction.

[0062] The second part is in the form of "event name, event category, fine argument 1, fine argument 2, ..." to meet the needs of refined chapter event extraction. Here, fine arguments refer to detailed information that describes chapter events in detail.

[0063] The third part does not limit the event elements, but only allows the large language model to extract the core events in the article to meet the needs of real-time push of hot events.

[0064] The fourth part is negative sample data, which is used to solve the problem of random fabrication in open source large language models.

[0065] In addition, the output of the large language model in the embodiment of the present invention is required to be in Chinese and returned in a standard JSON format, thereby solving the problem of unstable output format. Finally, based on Lora technology, the open source large language model is fine-tuned in combination with a high-quality chapter instruction set.

[0066] Figure 1 A flowchart of a chapter event extraction method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0067] S110, selecting news material samples from open source news and preset news databases, and cleaning the news material samples;

[0068] News material samples are selected from open source news and preset news databases. In the embodiment of the present invention, the preset news database is the Gdelt database. The Gdelt database monitors news media in more than 100 languages ​​in almost every corner of every country at all times, including print, broadcast and web forms, and identifies people, locations, organizations, quantities, topics, data sources, emotions, quotes, pictures and events that drive the global society every second. The Gdelt database provides a free and open computing platform for the world.

[0069] The Gdelt database mainly consists of two major data sets: Event Database and GlobalKnowledge Graph (GKG), which records news from 1969 to the present and updates the data every fifteen minutes.

[0070] Data cleaning is performed on the selected news material samples as follows:

[0071] ① Remove news material samples with less than 300 words or more than 1,000 words.

[0072] ② Classify the data sources of news material samples, select a part from each of the categories such as military, politics, diplomacy, security, economy, technology, and entertainment to ensure the balance of the news material sample field. In the actual implementation process, the preset keywords related to military, governance, diplomacy, security, economy, technology, and entertainment can be matched from the news material samples, and the news material samples can be classified according to the matching results.

[0073] ③ Use regular expressions to filter out invalid information such as emoticons, invalid URLs, front-end codes, etc. in news material samples to form high-quality news material samples.

[0074] The news material samples are cleaned in turn through the above three steps to obtain cleaned news material samples.

[0075] S120, respectively designing a theoretical general argument instruction template and a theoretical fine argument instruction template, based on the theoretical general argument instruction template and the theoretical fine argument instruction template, inputting the news material sample into ChatGPT, and obtaining an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample;

[0076] Two types of instruction templates are manually designed: theoretical general argument instruction template and theoretical fine argument instruction template, and batch chapter event annotation data are constructed based on ChatGPT.

[0077] An example of the first type of instruction template (theoretical general argument instruction template) is as follows:

[0078] Extract one or several root events from a given news material sample, and extract the following six elements: ["event name", "event category", "event time", "event location", "event subject", "event object"].

[0079] The root event refers to the most important or core event in the news material sample, while the sub-event is an event with a high degree of relevance to the root event. When extracting, sub-events must not be extracted. When extracting root events, the same event should not be extracted repeatedly.

[0080] To avoid excessive fragmentation, if multiple events are semantically related and form a larger event, merge them into one event and reflect this in the event name. For elements of the person type, only the name needs to be retained. If there are multiple elements of the same type, merge the elements into a list and return them.

[0081] The event subject is the initiator of the root event. If a certain element is not included in the news material sample, please return "not mentioned". And return the result in the form of a json list.

[0082] The first type of instruction template focuses on generating chapter event information containing general event arguments and returns it in the form of a specified JSON list. The data obtained through the first type of instruction template is recorded as labeled data 1.

[0083] An example of the second type of instruction template (theoretical fine argument instruction template) is as follows: [event name, event category, fine argument 1, ..., fine argument N], where N is a positive integer.

[0084] It should be noted that the fine argument refers to data that describes in detail the preset detailed information of the news material sample, such as the purpose, cause, influence, historical factors, etc. of the news material sample. The number of fine arguments can be determined based on actual conditions, and the embodiments of the present invention do not make specific limitations on this.

[0085] Extract one or several root events from a given news material sample, and extract all related elements. The root event refers to the main or core event in the news material sample, and the sub-event is part of the root event. The sub-event is not extracted separately during extraction. When extracting root events, the same event must not be extracted repeatedly to avoid excessive fragmentation. If multiple events are semantically related and constitute a larger event, please merge them into one event and reflect it in the event name. For the elements of the character type, only the name needs to be retained. If there are multiple elements of the same type, please merge the elements into a list and return them. The "event subject" is the initiator of the root event.

[0086] If the text does not contain a certain element, please return "not mentioned". Please return the result in the form of a json list. For example, an example will be given to the large language model. Please refer to the example to perform this task. The input text is "Country A launched a series of missiles at Country B on November 15, hitting energy infrastructure across the country, plunging Kiev and other cities into darkness." Then the large language model returns a json list: [{"Event Name": "Country A launched a series of missiles to attack Country B's energy infrastructure", "Event Category": "Attack Event", "Attack Location": "Country B", "Attack Time": "November 15", "Attacker": "Country A", "Attack Target": "Energy infrastructure equipment across the country", "Purpose": "Not mentioned"}]. Now, please refer to the example to extract important events from the following text.

[0087] The second type of instruction template focuses on generating chapter event information containing refined event arguments and returns it in the form of a specified JSON list. The data obtained through the second type of instruction template is recorded as labeled data 2.

[0088] S130, based on the actual general argument instruction and the actual fine argument instruction, expansion is performed to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set;

[0089] The labeled data 1 and the labeled data 2 obtained in S120 are transformed to form a chapter instruction set, and the data set is transformed into four types according to the requirements of downstream tasks.

[0090] The instruction data 1 is obtained by transforming the annotation data 1. The example of the instruction data 1 is as follows:

[0091] {"type":"files_name","conversations":[{"from":"human","value":"Now we are going to perform a chapter-level event extraction task: please find the core events described in the given article and extract the six event elements ["event name","event category","event time","event location","event subject","event object"] from the given article.

[0092] If the article does not contain a certain element, please return "not mentioned". Finally, please return the result in the form of a json list. "The article is: Title: .... Body: ..."}, {"from": "assistant", "value": {"Event Name": "Country A becomes the largest oil supplier to Country C", "Event Category": "Energy Supply", "Event Time": "October 2021", "Event Location": "Country C", "Event Subject": "Country A", "Event Object": "Country C"}}]}.

[0093] Instruction data 1 focuses on extracting chapter event information containing general event arguments to meet the needs of general & open domain chapter event extraction.

[0094] The instruction data 2 is obtained by transforming the annotation data 2. An example of the instruction data 2 is as follows:

[0095] {"type":"files_name","conversations":[{"from":"human","value":"Now you are going to perform a chapter-level event extraction task: please find the core events described in the given article and extract the event elements according to {"election events":["event name","election time","election location","candidates","election system","election results","election impact"]}".

[0096] If the text does not contain a certain element, please return "not mentioned". Finally, please return the results in the form of a json list. "The article is: Title: .... Body: ...", {"from": "assistant", "value": {"event name": "Alaska midterm elections", "event category": "election event", "election time": "November", "election location": "Alaska", "candidates": ["Mary Petola", "Nick Begich III", "Sarah Palin"], "election system": "ranked choice voting", "election result": "Mary Petola won", "election impact": "House of Representatives control decision"}}]}.

[0097] Instruction data 2 focuses on extracting chapter event information containing given refined event arguments to meet the requirements of extracting chapter events using given refined arguments.

[0098] The instruction data 3 is obtained by transforming the annotation data 2. An example of the instruction data 3 is as follows:

[0099] {"type":"files_name","conversations":[{"from":"human","value":""}}} Now we are going to perform a chapter-level event extraction task: please find the core event described in the given article and extract the event elements according to {"political controversy":["event name","disputing party","disputing content"]}}. If the text does not contain a certain element, please return "not mentioned".

[0100] Finally, please return the result in the form of a json list. The article is: "Title: .... Body: ..."}, {"from": "assistant", "value": "Sorry, there are no events that need attention in this article"}]}.

[0101] Instruction data 3 is used as negative sample data of the instruction data set, that is, when the news material does not contain the given fine event argument, an empty JSON list is directly returned. This part of the data can be constructed by cross-generating materials from different fields, so that the given fine event argument is unlikely to exist in the material.

[0102] The instruction data 4 is obtained by transforming the marked data 2. An example of the instruction data 4 is as follows:

[0103] {"type":"files_name","conversations":[{"from":"human","value":"Now you are going to perform a chapter-level event extraction task: please find the core events described in the given article and extract the event-related elements". If the text does not contain a certain element, please return "not mentioned". Finally, please return the result in the form of a json list. The article is: Title:... Text:...},{"from":"assistant","value":{"Event Name":"Bondi Beach Nude Photo Event","Event Category":"Charity Event","Event Location":"Bondi Beach","Event Time":"Not Mentioned","Event Organization":"Skin Check Champion","Partner":"Spencer Tunick","Number of Participants":"More than 2,500 People","Person of Special Interest":"Chris Hemsworth"}}]}.

[0104] Instruction data 4 does not specify the model to generate general event arguments or refined event arguments, but allows the model to summarize by itself, which can meet the needs of daily hot material push, which focuses more on event names.

[0105] The obtained instruction data 1, 2, 3, and 4 are integrated to obtain the final chapter instruction set.

[0106] S140, based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction, the LoRA neural network is trained to obtain a trained LoRA neural network, and the trained LoRA neural network is used to fine-tune the instruction of the open source large language model to obtain a target large language model;

[0107] Based on the above obtained chapter instruction set and Lora fine-tuning technology, the open source large language model is fine-tuned. In the embodiment of the present invention, the large language model is llama2. The basic process is as follows:

[0108] It should be noted that llama2 is meta's latest open source language model, with a training data set of 2 trillion tokens. The context length is expanded from llama's 2048 to 4096. It can understand and generate longer texts, including three models of 7B, 13B and 70B, and performs outstandingly in tests of various benchmark sets.

[0109] Lora is a lightweight large language model fine-tuning technology. Assume that the weight parameter of the original large language model llama2 is W 0 , the weight parameter of the chapter event model formed after fine-tuning is W, and the parameter fine-tuned during the entire training process is ΔW, then:

[0110] W=W 0 +ΔW,

[0111] Decompose the parameter ΔW to be trained into the dimension reduction matrix H and the dimension increase matrix K, then we have:

[0112] W=W 0 +ΔW=W 0 +HK,

[0113] Among them, W 0 ∈R d×k Represents the weight parameters of the original large language model llama2, H∈R d×r Represents a dimension-raising matrix, initialized with a matrix of all zeros; K∈R r×k represents the dimension reduction matrix, which is initialized with a random Gaussian distribution; r is the rank, which is a priori parameter and r≤min(d,k). During the entire training process, H and K are trainable parameters, and the others are priori parameters and fixed parameters.

[0114] During the model forward training process, W 0 and ΔW are multiplied by the same input x, that is:

[0115] L=W 0 x+ΔWx=W 0x+HKx,

[0116] The training objectives of the model are:

[0117] min(L'-L),

[0118] Among them, L' is the true answer, and L is the model output. Multiple rounds of iterations are performed until the model converges. Finally, the fine-tuned chapter event model is obtained.

[0119] Based on the target large language model obtained above, given the news material, the model is inferred and the results are output. The basic process is as follows:

[0120] 1) Based on the target large language model, design the best instruction template for model reasoning. Since the target large language model fine-tuned on the basis of the open source language model is not as good as ChatGPT in understanding complex instruction templates, it is necessary to debug the best instruction template according to the specific application scenario. The following is an example:

[0121] Now you are going to perform a chapter-level event extraction task: Please extract several important chapter-level events from the given article. Each event includes 6 elements: event name, event category, event time, event location, event subject and event object. The event name should be no less than 10 characters and no more than 30 characters. You can only answer in Chinese based on the information in the article. You cannot add fabricated content to the elements. If the element is not explicitly mentioned in the article, please answer "not mentioned". Finally, please output in json format. The article is: Title: .... Body: ....

[0122] S150, debugging the output instructions corresponding to the target large language model to obtain the best output instructions and the debugged target large language model;

[0123] For the same chapter event test set, chapter event extraction is performed based on the traditional extractive model, and the F1 value is 45.9%, and the model does not have domain transfer capabilities; chapter event extraction is performed using an open source language large model, and the F1 value is 57.7%, and it usually does not follow input instructions, and the input format is unstable; using the chapter event extraction technology based on a language large model and transfer learning proposed in the present invention, the F1 value is 78.5%, and it has good generalization and domain transfer capabilities.

[0124] S160, inputting the passage to be tested into the debugged target large language model to obtain extraction events.

[0125] Finally, the passage to be tested is input into the debugged target large language model to obtain the extraction events.

[0126] The present invention proposes a method for extracting chapter events. By designing two types of instruction templates, namely theoretical general argument instruction templates and theoretical fine argument instruction templates, news material sample annotation data is obtained based on ChatGPT to obtain actual general argument instructions and actual fine argument instructions. Then, in combination with the usage scenarios of downstream tasks, a high-quality chapter instruction set is constructed based on the actual general argument instructions and the actual fine argument instructions. Finally, a target large language model is formed based on the Lora fine-tuning technology.

[0127] Compared with the traditional extractive event model, the chapter event large language model constructed by the present invention effectively optimizes its problems such as poor inductive summarization ability, excessive event redundancy, poor generalization ability, poor domain adaptability and low overall accuracy caused by multi-step errors.

[0128] Compared with the open source big language model, the chapter event big language model constructed by the present invention effectively optimizes the problems of unstable output format, fabricated elements in event names and event arguments, and the model not following input instructions.

[0129] Figure 2 A schematic diagram of the structure of a chapter event extraction system provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the system includes a cleaning module 210, an instruction module 220, an expansion module 230, a fine adjustment module 240, a debugging module 250 and an extraction module 260, wherein:

[0130] A cleaning module, used to select news material samples from open source news and preset news databases, and clean the news material samples;

[0131] An instruction module is used to design a theoretical general argument instruction template and a theoretical fine argument instruction template respectively, and based on the theoretical general argument instruction template and the theoretical fine argument instruction template, input the news material sample into ChatGPT to obtain an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample;

[0132] An extension module, used for extending based on the actual general argument instruction and the actual fine argument instruction to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set;

[0133] A fine-tuning module is used to train the LoRA neural network based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction to obtain the trained LoRA neural network, and use the trained LoRA neural network to fine-tune the open source large language model to obtain the target large language model;

[0134] A debugging module, used to debug the output instructions corresponding to the target large language model, and obtain the best output instructions and the debugged target large language model;

[0135] The extraction module is used to input the passage to be tested into the debugged target large language model to obtain extraction events.

[0136] This embodiment is a system embodiment corresponding to the above method embodiment, and its specific implementation process is the same as the above method embodiment. For details, please refer to the above method embodiment, and this system embodiment will not be repeated here.

[0137] Each module in the above chapter event extraction system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0138] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention, the computer device may be a server, and its internal structure diagram may be as follows Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the computer storage medium. The database of the computer device is used to store data generated or obtained during the execution of the chapter event extraction method, such as news material samples. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a chapter event extraction method is implemented.

[0139] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the chapter event extraction method in the above embodiment are implemented. Alternatively, when the processor executes the computer program, the functions of each module / unit in the chapter event extraction system in this embodiment are implemented.

[0140] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the chapter event extraction method in the above embodiment are implemented. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above embodiment of the chapter event extraction system are implemented.

[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0142] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0143] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A chapter event extraction method, characterized in that: include: Selecting news material samples from open source news and preset news databases, and cleaning the news material samples; A theoretical general argument instruction template and a theoretical fine argument instruction template are respectively designed, and based on the theoretical general argument instruction template and the theoretical fine argument instruction template, the news material sample is input into ChatGPT to obtain an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample; Based on the actual general argument instruction and the actual fine argument instruction, expansion is performed to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set; Based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction, the LoRA neural network is trained to obtain a trained LoRA neural network, and the trained LoRA neural network is used to fine-tune the instructions of the open source large language model to obtain a target large language model; Debugging the output instructions corresponding to the target large language model to obtain the best output instructions and the debugged target large language model; The passage to be tested is input into the debugged target large language model to obtain extraction events.

2. The chapter event extraction method according to claim 1, characterized in that: The method includes training the LoRA neural network based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction to obtain the trained LoRA neural network, and fine-tuning the open source large language model using the trained LoRA neural network to obtain the target large language model, including: Based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction, the LoRA neural network is trained to obtain a trained LoRA neural network; Migrating the weight parameters of the trained LoRA neural network to the open source large language model; The weight parameters that have not been migrated in the open source large language model are trained to obtain the target large language model.

3. The chapter event extraction method according to claim 2, characterized in that: The weight parameters that have not been migrated in the training open source large language model are obtained to obtain the target large language model. The calculation formula is as follows: W=W0+ΔW=W0+HK, Among them, W represents the weight parameter of the target large language model, W0 represents the weight parameter migrated from the trained LoRA neural network in the open source large language model, ΔW represents the weight parameter that has not been migrated in the open source large language model, H represents the dimension increase matrix, and K represents the dimension reduction matrix.

4. The chapter event extraction method according to claim 1, characterized in that: The cleaning of the news material sample includes: Delete news material samples with less than 300 words or more than 1,000 words; Classify the data sources of news material samples and select a preset number from each of the military, political, diplomatic, security, economic, scientific and technological, and entertainment categories; Use regular expressions to filter out emoticons, invalid URLs, and front-end codes in news material samples.

5. The chapter event extraction method according to claim 1, characterized in that: The general argument instruction template of the theory is as follows: [Event name, event category, event time, event location, event subject, event object].

6. The chapter event extraction method according to claim 1, characterized in that: The theoretical fine argument instruction template is as follows: [event name, event category, fine argument 1, …, fine argument N], where N is a positive integer.

7. A chapter event extraction system, characterized in that: include: A cleaning module, used to select news material samples from open source news and preset news databases, and clean the news material samples; An instruction module is used to design a theoretical general argument instruction template and a theoretical fine argument instruction template respectively, and based on the theoretical general argument instruction template and the theoretical fine argument instruction template, input the news material sample into ChatGPT to obtain an actual general argument instruction corresponding to the news material sample and an actual fine argument instruction corresponding to the news material sample; An extension module, used for extending based on the actual general argument instruction and the actual fine argument instruction to obtain a negative sample instruction and a hot spot push instruction corresponding to the news material sample, wherein the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hot spot push instruction constitute a chapter instruction set; A fine-tuning module is used to train the LoRA neural network based on the news material sample, the actual general argument instruction, the actual fine argument instruction, the negative sample instruction and the hotspot push instruction to obtain the trained LoRA neural network, and use the trained LoRA neural network to fine-tune the open source large language model to obtain the target large language model; A debugging module, used to debug the output instructions corresponding to the target large language model, and obtain the best output instructions and the debugged target large language model; The extraction module is used to input the passage to be tested into the debugged target large language model to obtain extraction events.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the chapter event extraction method as described in any one of claims 1 to 6 are implemented.

9. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the chapter event extraction method as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Event argument extraction method and device and electronic equipment

    CN111400431A

  • Training event extraction model, event extraction method and target event extraction model

    CN114490953A

  • Shapter-level event extraction method and device, equipment and storage medium

    CN115455939A

  • Text event extraction method and device, equipment and storage medium

    CN115510212A

  • Event extraction method based on MRC

    CN115587591A