Model training method, classification and element extraction method, device, equipment and medium

The large language model is used to classify Chinese events and extract elements, which solves the problem of low efficiency of event element extraction in the existing technology and achieves more efficient and accurate processing effects.

CN119358544AActive Publication Date: 2025-01-24NO 15 INST OF CHINA ELECTRONICS TECH GRP +1

Patent Information

Application Number
CN202411318433.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-24
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

The existing event factor extraction method relies on manual definition of rules and patterns, and the processing efficiency is inefficient.

Method used

The large language model is used to divide the type of event through the first branch, the second branch obtains the element prompts, the third branch performs event element extraction, and optimizes the model based on the training results.

Benefits of technology

It improves the efficiency and accuracy of Chinese event processing and reduces the dependence on a large amount of annotated data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358544A_ABST
    Figure CN119358544A_ABST
Patent Text Reader

Abstract

The invention provides a model training method and device, a classification and element extraction method and device, equipment and a medium. The method comprises the steps of obtaining text description information of a sample Chinese event; based on the text description information of the sample Chinese event, determining a type cue word corresponding to the sample Chinese event; inputting the type cue word into the first branch to obtain a type division result of the sample Chinese event, wherein the type division result comprises a plurality of Chinese event types; inputting the multiple Chinese event types into the second branch to obtain element cues corresponding to the sample Chinese events; inputting the element cue word into the third branch to obtain an element extraction result of the sample Chinese event; and training the first branch based on the type division result of the sample Chinese event, and training the third branch based on the element extraction result of the sample Chinese event to obtain an event classification and element extraction model. Therefore, the events are classified and subjected to element extraction through the large language model, and the Chinese event processing efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of artificial intelligence technology, and specifically, to a model training method, classification and factor extraction method, device, equipment and medium. Background Art

[0002] Event element extraction is of great significance in the field of natural language processing. It aims to automatically identify and extract key elements of events from unstructured text, such as time, place, person, behavior, etc. This task has broad application prospects in information retrieval, event prediction, automatic news summarization and other applications. By accurately extracting and classifying these event elements, the efficiency and accuracy of the platform system in processing events can be improved.

[0003] In the related art, the existing event element extraction method is mainly based on rule extraction, and the implementation process needs to rely on manually defined rules and patterns to extract event elements. However, the existing processing method is inefficient. Summary of the invention

[0004] The embodiments described herein provide a model training method, classification and factor extraction method, apparatus, device and medium that overcome the above-mentioned problems.

[0005] In a first aspect, according to the content of the present disclosure, a method for training an event classification and element extraction model is provided, which is applied to a large language model, wherein the large language model comprises: a first branch, a second branch and a third branch, wherein the first branch is used to classify Chinese events into event types, the second branch is used to obtain element prompt words of different Chinese event types, and the third branch is used to extract event elements from the Chinese events;

[0006] The method comprises:

[0007] Acquire text description information of sample Chinese events, wherein the text description information of the sample Chinese events includes: a plurality of event texts to be classified;

[0008] Determining a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event;

[0009] Inputting the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each of the Chinese event types is greater than a preset threshold;

[0010] Inputting the plurality of Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events;

[0011] Inputting the element prompt word into the third branch of the large language model to obtain the element extraction result of the sample Chinese event;

[0012] The first branch is trained based on the type classification result of the sample Chinese event, and the third branch is trained based on the element extraction result of the sample Chinese event to obtain the event classification and element extraction model.

[0013] In a second aspect, according to the content of the present disclosure, a method for event classification and element extraction is provided, comprising:

[0014] Get the text description information of the current Chinese event;

[0015] Determine, based on the text description information of the current Chinese event, a type prompt word corresponding to the current Chinese event;

[0016] Inputting the type prompt word corresponding to the current Chinese event into the event classification and factor extraction model to obtain the type classification result and factor extraction result of the current Chinese event;

[0017] The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method described in the first aspect.

[0018] In a third aspect, according to the content of the present disclosure, there is provided an event classification and element extraction model training device, which is applied to a large language model, wherein the large language model comprises: a first branch, a second branch and a third branch, wherein the first branch is used to classify Chinese events into event types, the second branch is used to obtain element prompt words of different Chinese event types, and the third branch is used to extract event elements from the Chinese events;

[0019] The device comprises:

[0020] A first acquisition module is used to acquire text description information of sample Chinese events, wherein the text description information of the sample Chinese events includes: a plurality of event texts to be classified;

[0021] A first determination module, configured to determine a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event;

[0022] A second determination module is used to input the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each of the Chinese event types is greater than a preset threshold;

[0023] A third determination module is used to input the plurality of Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events;

[0024] A fourth determination module, used for inputting the element prompt word into the third branch of the large language model to obtain an element extraction result of the sample Chinese event;

[0025] The training module is used to train the first branch based on the type classification result of the sample Chinese event, and to train the third branch based on the element extraction result of the sample Chinese event to obtain the event classification and element extraction model.

[0026] In a fourth aspect, according to the content of the present disclosure, there is provided an event classification and element extraction device, comprising:

[0027] The second acquisition module is used to obtain the text description information of the current Chinese event;

[0028] A fifth determination module, configured to determine a type prompt word corresponding to the current Chinese event based on the text description information of the current Chinese event;

[0029] A sixth determination module, used for inputting the type prompt word corresponding to the current Chinese event into the event classification and element extraction model to obtain the type classification result and element extraction result of the current Chinese event;

[0030] The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method described in the first aspect.

[0031] In a fifth aspect, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the event classification and factor extraction model training method in any of the above embodiments are implemented, or the steps of the event classification and factor extraction method in any of the above embodiments are implemented.

[0032] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the event classification and factor extraction model training method in any of the above embodiments are implemented, or the steps of the event classification and factor extraction method in any of the above embodiments are implemented.

[0033] The event classification and factor extraction model training method provided in the embodiment of the present application is applied to a large language model, wherein the large language model includes: a first branch, a second branch and a third branch, wherein the first branch is used to classify Chinese events into event types, the second branch is used to obtain factor prompt words of different Chinese event types, and the third branch is used to extract event factors from Chinese events; the method includes: obtaining text description information of a sample Chinese event, wherein the text description information of the sample Chinese event includes: a plurality of event texts to be classified; determining a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event; inputting the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each Chinese event type is greater than a preset threshold; inputting the plurality of Chinese event types into the second branch of the large language model to obtain a factor prompt word corresponding to the sample Chinese event; inputting the factor prompt word into the third branch of the large language model to obtain a factor extraction result of the sample Chinese event; training the first branch based on the type classification result of the sample Chinese event, and training the third branch based on the factor extraction result of the sample Chinese event to obtain an event classification and factor extraction model. In this way, events can be classified and elements extracted through a large language model, effectively improving the efficiency of Chinese event processing.

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

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:

[0036] Figure 1 It is a flowchart of an event classification and factor extraction model training method provided by the present invention.

[0037] Figure 2 It is a flowchart of an event classification and element extraction method provided by the present invention.

[0038] Figure 3 It is a structural schematic diagram of an event classification and factor extraction model training device provided by the present invention.

[0039] Figure 4 It is a structural schematic diagram of an event classification and element extraction device provided by the present invention.

[0040] Figure 5 It is a structural schematic diagram of a computer device provided by the present disclosure.

[0041] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.

[0043] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by a person skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, a statement that two or more parts are "connected" or "coupled" together shall mean that the parts are joined together directly or through one or more intermediate components.

[0044] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0045] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists, A and B exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or a part of a component) from another component (or another part of a component).

[0046] In the description of the present application, unless otherwise specified, "plurality" means more than two (including two), and similarly, "multiple groups" means more than two groups (including two).

[0047] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0048] Figure 1 It is a flow chart of an event classification and factor extraction model training method provided by an embodiment of the present disclosure, which is applied to a large language model. The large language model includes: a first branch, a second branch and a third branch. The first branch is used to classify Chinese events into event types, the second branch is used to obtain factor prompt words of different Chinese event types, and the third branch is used to extract event factors from Chinese events.

[0049] like Figure 1 As shown in FIG. 1 , the specific process of the event classification and factor extraction model training method includes:

[0050] S110: Obtain text description information of a sample Chinese event.

[0051] The text description information of the sample Chinese event includes: a plurality of event texts to be classified, each of which corresponds to a sample Chinese event, ie, a historical Chinese event.

[0052] It should be noted that the event types corresponding to different event texts to be classified may be the same event type, that is, the correspondence between the event texts to be classified and the event types is many-to-one, such as at least two event texts to be classified correspond to the same event type; or, the event types corresponding to different event texts to be classified may be multiple event types, and the correspondence between the event texts to be classified and the event types is one-to-one, such as one event text to be classified corresponds to one event type, and another event text to be classified corresponds to another event type.

[0053] S120: Determine a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event.

[0054] The type prompt words corresponding to the sample Chinese events may be determined based on a pre-constructed event type prompt word template.

[0055] In some embodiments, determining the type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event includes:

[0056] Acquire an event type prompt word template; based on the event type prompt word template, perform type matching on multiple event texts to be classified corresponding to the sample Chinese events to obtain type prompt words corresponding to the sample Chinese events.

[0057] The event type prompt word template is used to describe the mapping relationship between the event type and the type description text. The type description text corresponds to the type prompt word, that is, one type description text can correspond to one type prompt word. For example, a type description text is subjected to text keyword extraction, and the extracted text keyword is determined as a type prompt word corresponding to the type description text.

[0058] The event type prompt word template can be a general event type classification prompt word template designed based on multiple general event types and their definition descriptions, and is used to obtain prompt words for Chinese events. The event type prompt word template is as follows.

[0059]

[0060] Based on an event type prompt word template, type matching is performed on multiple event texts to be classified corresponding to the sample Chinese event to obtain type prompt words corresponding to the sample Chinese event, which may include: event type identification is performed on multiple event texts to be classified corresponding to the sample Chinese event to obtain the event type corresponding to each event text to be classified, based on matching the event type corresponding to each event text to be classified with the event type included in the event type prompt word template, and determining the type prompt word associated with the type description text corresponding to an event type included in the event type prompt word template that matches the event type corresponding to the event text to be classified as the type prompt word of the event type corresponding to the event text to be classified.

[0061] When event type recognition is performed on a plurality of event texts to be classified corresponding to a sample Chinese event, recognition may be performed based on a type label pre-assigned to each event text to be classified.

[0062] Thus, the event type prompt word template is used to perform type matching on multiple event texts to be classified corresponding to the sample Chinese events, and the type prompt words corresponding to the sample Chinese events are effectively determined.

[0063] S130: Input the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: multiple Chinese event types.

[0064] Among them, the confidence of each Chinese event type is greater than the preset threshold;

[0065] The first branch is used to classify Chinese events into event types. It can be understood that the type prompt word is input into the first branch of the large language model, and the first branch of the large language model classifies the event description based on the context information of the input prompt word and the built-in language understanding ability, and obtains multiple candidate event types corresponding to the sample Chinese event and the predicted confidence of each candidate event type; a preset number of candidate event types with confidence greater than a preset threshold are determined as multiple Chinese event types.

[0066] S140: Input multiple Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to sample Chinese events.

[0067] The element prompt words corresponding to the sample Chinese event may be element keywords / representative words reflected by the event elements in the sample Chinese event.

[0068] In some embodiments, multiple Chinese event types are input into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events, including:

[0069] Obtain target similar events corresponding to each Chinese event type; and determine element prompt words corresponding to the sample Chinese event based on the target similar events corresponding to each Chinese event type.

[0070] The target similar event is the event representative instance corresponding to the Chinese event type, that is, the event type of the target similar event and the event type of the event representative instance are both Chinese event types.

[0071] Therefore, by acquiring similar events for each Chinese event type, the event text data corresponding to the Chinese event type is expanded, so as to effectively determine the element prompt words corresponding to the sample Chinese event.

[0072] In some embodiments, obtaining target similar events corresponding to each Chinese event type includes:

[0073] Based on the domain-related text data corresponding to each Chinese event type, an event instance library is constructed, which includes: multiple candidate event texts; based on the text similarity between each candidate event text and each event text to be classified corresponding to the sample Chinese event, the target similar event corresponding to each Chinese event type is determined.

[0074] Among them, based on the field-related text data corresponding to each Chinese event type, an event instance library is constructed, which may include: collecting and annotating representative instances of each Chinese event type from the field-related text data corresponding to each Chinese event type, uniformly representing the event type and event elements in JSON format, and constructing an event instance library.

[0075] Based on the text similarity between each candidate event text and each to-be-classified event text corresponding to the sample Chinese event, determining the target similar event corresponding to each Chinese event type may include: using the RoBERTa-base model to convert each candidate event text and each to-be-classified event text corresponding to the sample Chinese event into an embedded vector representation, thereby obtaining multiple candidate event vectors and multiple to-be-classified event vectors; using the cosine similarity measurement method shown in the following formula (1) to respectively calculate the similarity between each to-be-classified event vector and multiple candidate event vectors, selecting the candidate event text corresponding to a candidate event vector with the largest similarity corresponding to each to-be-classified event vector as the target similar event corresponding to the Chinese event type corresponding to the classified event vector, thereby obtaining the target similar event corresponding to each Chinese event type.

[0076]

[0077] In formula (1), E q represents the event vector to be classified, q represents the event text to be classified, E xi represents the i-th candidate event vector, x i Represents candidate event text.

[0078] In some embodiments, determining the element prompt words corresponding to the sample Chinese event based on the target similar event corresponding to each Chinese event type includes:

[0079] Obtain a feature extraction prompt word template; based on the feature extraction prompt word template, perform feature matching on the event representative instance corresponding to each Chinese event type to obtain the feature prompt word corresponding to the sample Chinese event.

[0080] Among them, the feature extraction prompt word template is used to describe the mapping relationship between the event type and the feature description text. The feature description text corresponds to the feature prompt word. That is, one feature description text can correspond to one feature prompt word. For example, when a feature description text is subjected to text keyword extraction, the extracted text keyword is determined as a feature prompt word corresponding to the feature description text.

[0081] The element extraction prompt word template can be a universal element prompt word template designed based on multiple universal event elements and their definition descriptions, and is used to guide the model to extract event elements. The element extraction prompt word template is as follows.

[0082]

[0083] Based on the element extraction prompt word template, element matching is performed on the event representative instance corresponding to each Chinese event type to obtain the element prompt word corresponding to the sample Chinese event, which may include: event element recognition is performed on multiple event texts to be classified corresponding to the sample Chinese event to obtain the event element corresponding to each event text to be classified, based on matching the event element corresponding to each event text to be classified with the event element included in the event element prompt word template, the element prompt word associated with the element description text corresponding to an event element included in the event element prompt word template that matches the event element corresponding to the event text to be classified is determined as the element prompt word of the event element corresponding to the event text to be classified.

[0084] When event element recognition is performed on a plurality of event texts to be classified corresponding to the sample Chinese event, recognition may be performed based on an element label pre-assigned to each event text to be classified.

[0085] Therefore, the event element prompt word template is used to perform element matching on multiple event texts to be classified corresponding to the sample Chinese events, so as to effectively determine the element prompt words corresponding to the sample Chinese events.

[0086] S150: Input the element prompt words into the third branch of the large language model to obtain the element extraction result of the sample Chinese event.

[0087] The element extraction result of the sample Chinese event includes: multiple Chinese event elements. The correspondence between Chinese event elements and Chinese event types can be many-to-one, that is, each Chinese event type can correspond to multiple Chinese event elements; the correspondence between Chinese event elements and Chinese event types can be one-to-one, that is, one Chinese event type can correspond to one Chinese event element.

[0088] S160: Training the first branch based on the type classification results of the sample Chinese events, and training the third branch based on the element extraction results of the sample Chinese events, to obtain an event classification and element extraction model.

[0089] Among them, a preset loss function can be used to calculate the loss value between the type classification result of the sample Chinese event output by the first branch and the preset type classification result. If the loss value is greater than the preset threshold, the parameters of the first branch are optimized until the loss value is less than or equal to the preset threshold, and the trained first branch is obtained. And, a preset loss function is used to calculate the loss value between the element extraction result of the sample Chinese event output by the second branch and the preset element extraction result. If the loss value is greater than the preset threshold, the parameters of the second branch are optimized until the loss value is less than or equal to the preset threshold, and the trained second branch is obtained.

[0090] The event type classification method based on prompt words in this embodiment is different from the existing method using predefined classifiers. It uses the context understanding and language generation capabilities of the large model to reduce the dependence on a large amount of labeled data. By retrieving the most similar instances based on semantic similarity and dynamically generating prompt words, the model's use of context and instances is enhanced, and the accuracy of factor extraction is improved.

[0091] The event classification and factor extraction model training method provided in the present embodiment is applied to a large language model, wherein the large language model includes: a first branch, a second branch and a third branch, wherein the first branch is used to classify Chinese events into event types, the second branch is used to obtain factor prompt words of different Chinese event types, and the third branch is used to extract event factors from Chinese events; the method includes: obtaining text description information of a sample Chinese event, wherein the text description information of the sample Chinese event includes: a plurality of event texts to be classified; determining a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event; inputting the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each Chinese event type is greater than a preset threshold; inputting the plurality of Chinese event types into the second branch of the large language model to obtain a factor prompt word corresponding to the sample Chinese event; inputting the factor prompt word into the third branch of the large language model to obtain a factor extraction result of the sample Chinese event; training the first branch based on the type classification result of the sample Chinese event, and training the third branch based on the factor extraction result of the sample Chinese event to obtain an event classification and factor extraction model. In this way, events can be classified and elements extracted through a large language model, effectively improving the efficiency of Chinese event processing.

[0092] Figure 2 is a flow chart of an event classification and factor extraction method provided by an embodiment of the present disclosure, such as Figure 2 As shown in Figure 1, the specific process of event classification and factor extraction method includes:

[0093] S210: Obtain text description information of the current Chinese event.

[0094] The text description information of the current Chinese event includes: a plurality of event texts to be classified, each of which corresponds to a current Chinese event, that is, a Chinese event input by a user.

[0095] It should be noted that the event types corresponding to different event texts to be classified may be the same event type, that is, the correspondence between the event texts to be classified and the event types is many-to-one, such as at least two event texts to be classified correspond to the same event type; or, the event types corresponding to different event texts to be classified may be multiple event types, and the correspondence between the event texts to be classified and the event types is one-to-one, such as one event text to be classified corresponds to one event type, and another event text to be classified corresponds to another event type.

[0096] S220: Determine a type prompt word corresponding to the current Chinese event based on the text description information of the current Chinese event.

[0097] The type prompt word corresponding to the current Chinese event can be determined based on a pre-constructed event type prompt word template.

[0098] Based on the text description information of the current Chinese event, determining the type prompt word corresponding to the current Chinese event may include: obtaining an event type prompt word template; based on the event type prompt word template, performing type matching on multiple event texts to be classified corresponding to the current Chinese event to obtain the type prompt word corresponding to the current Chinese event.

[0099] S230: Input the type prompt word corresponding to the current Chinese event into the event classification and factor extraction model to obtain the type classification result and factor extraction result of the current Chinese event.

[0100] The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method of the above-mentioned embodiment.

[0101] The event classification and element extraction model includes: a first branch, a second branch and a third branch. The first branch can be used to classify Chinese events into event types, the second branch can be used to obtain element prompt words of different Chinese event types, and the third branch can be used to extract event elements from Chinese events.

[0102] The type prompt words corresponding to the current Chinese event are input into the event classification and feature extraction model. The first branch classifies the Chinese event into event types to obtain the type classification result of the current Chinese event, which includes: multiple Chinese event types; the second branch extracts prompt words from multiple Chinese event types to obtain feature prompt words corresponding to the current Chinese event; the third branch extracts event features from the feature prompt words to obtain the feature extraction result of the current Chinese event.

[0103] The type prompt word corresponding to the current Chinese event is input into the event classification and feature extraction model to obtain the output result of the first branch and the output result of the third branch. The output result of the first branch and the output result of the third branch are processed to obtain the type classification result and feature extraction result of the current text event.

[0104] For example, the text output by the model branch is split according to a specific delimiter; in the split text, the line containing the "event type" keyword is searched, the event type information is extracted and extra spaces or punctuation are removed; in the split text lines, the line containing the event element keyword is searched, the element information in each line is extracted and extra spaces or punctuation are removed, and the extracted event element information is stored in a dictionary structure, with the key being the element name and the value being the corresponding element content, ultimately forming a complete JSON object containing the event type and event elements.

[0105] This embodiment is based on the existing large-model natural language processing and generation technology to achieve Chinese event element extraction of the large model. It builds an event instance library by collecting and annotating representative instances of various event types from field-related text data, converting the instances into a unified embedded vector representation, and then retrieving the most relevant instances based on semantic similarity to dynamically construct prompt words to guide the large model to extract event elements, and finally parse and extract the output results.

[0106] Figure 3 A structural schematic diagram of an event classification and factor extraction model training device provided in this embodiment is applied to a large language model. The large language model includes: a first branch, a second branch and a third branch. The first branch is used to classify Chinese events into event types, the second branch is used to obtain factor prompt words of different Chinese event types, and the third branch is used to extract event elements from Chinese events.

[0107] The event classification and factor extraction model training device may include: a first acquisition module 310, a first determination module 320, a second determination module 330, a third determination module 340, a fourth determination module 350 and a training module 360. Among them:

[0108] The first acquisition module 310 is used to acquire text description information of sample Chinese events, where the text description information of the sample Chinese events includes: a plurality of event texts to be classified.

[0109] The first determination module 320 is used to determine the type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event.

[0110] The second determination module 330 is used to input the type prompt word into the first branch of the large language model to obtain the type classification result of the sample Chinese event, which includes: multiple Chinese event types, and the confidence of each Chinese event type is greater than a preset threshold.

[0111] The third determination module 340 is used to input multiple Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events.

[0112] The fourth determination module 350 is used to input the element prompt word into the third branch of the large language model to obtain the element extraction result of the sample Chinese event.

[0113] The training module 360 ​​is used to train the first branch based on the type classification results of the sample Chinese events, and to train the third branch based on the element extraction results of the sample Chinese events, so as to obtain an event classification and element extraction model.

[0114] In this embodiment, optionally, the first determining module 320 is specifically configured to:

[0115] An event type prompt word template is obtained. The event type prompt word template is used to describe the mapping relationship between the event type and the type description text, and the type description text corresponds to the type prompt word. Based on the event type prompt word template, type matching is performed on multiple event texts to be classified corresponding to the sample Chinese event to obtain the type prompt word corresponding to the sample Chinese event.

[0116] In this embodiment, optionally, the third determination module 340 includes: an acquisition unit and a determination unit.

[0117] The acquisition unit is used to acquire a target similar event corresponding to each Chinese event type, where the target similar event is a representative event instance corresponding to the Chinese event type.

[0118] The determination unit is used to determine the element prompt words corresponding to the sample Chinese event based on the target similar event corresponding to each Chinese event type.

[0119] In this embodiment, optionally, the acquiring unit is specifically configured to:

[0120] Based on the domain-related text data corresponding to each Chinese event type, an event instance library is constructed, which includes: multiple candidate event texts; based on the text similarity between each candidate event text and each event text to be classified corresponding to the sample Chinese event, the target similar event corresponding to each Chinese event type is determined.

[0121] In this embodiment, optionally, the determining unit is specifically configured to:

[0122] Obtain a feature extraction prompt word template, which is used to describe the mapping relationship between event type and feature description text, and the feature description text corresponds to the feature prompt word; based on the feature extraction prompt word template, perform feature matching on the event representative instance corresponding to each Chinese event type to obtain the feature prompt word corresponding to the sample Chinese event.

[0123] The event classification and factor extraction model training device provided in the present disclosure can execute the above method embodiments. Its specific implementation principles and technical effects can be found in the above method embodiments, and the present disclosure will not repeat them here.

[0124] Figure 4 This is a schematic diagram of the structure of an event classification and element extraction device provided in this embodiment. The event classification and element extraction device may include: a second acquisition module 410, a fifth determination module 420 and a sixth determination module 430. Among them:

[0125] The second acquisition module 410 is used to acquire text description information of the current Chinese event.

[0126] The fifth determination module 420 is used to determine the type prompt word corresponding to the current Chinese event based on the text description information of the current Chinese event.

[0127] The sixth determination module 430 is used to input the type prompt word corresponding to the current Chinese event into the event classification and element extraction model to obtain the type classification result and element extraction result of the current Chinese event.

[0128] The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method of the above-mentioned embodiment.

[0129] The event classification and element extraction device provided by the present disclosure can execute the above method embodiments. Its specific implementation principles and technical effects can be found in the above method embodiments, and the present disclosure will not repeat them here.

[0130] The present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.

[0131] The computer device includes a memory 510 and a processor 520 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with a memory 510 and a processor 520, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0132] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.

[0133] The memory 510 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, for example, a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of a computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card (FlashCard) equipped on the computer device. Of course, the memory 510 may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory 510 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 510 may also be used to temporarily store various data that have been output or are to be output.

[0134] The processor 520 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 510 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 520 is used to execute the program codes or instructions stored in the memory 510 or process data, such as running the program code of the above method.

[0135] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0136] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.

[0137] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.

[0138] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.

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

[0140] Each functional unit or module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in 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 each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0142] In the claims, any reference symbols placed between brackets shall not be construed as limiting the claims. The word "comprising" described in the present application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented with the aid of hardware comprising several different elements and with the aid of a suitably programmed computer. In a unit claim that lists a number of devices, several units of these devices may be embodied by the same hardware item. The use of first, second, and third, etc. does not indicate any order, and these words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

[0143] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these 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 application.

Claims

1. A method for training an event classification and factor extraction model, characterized in that: Applied to a large language model, the large language model includes: a first branch, a second branch and a third branch, the first branch is used to classify Chinese events into event types, the second branch is used to obtain element prompt words of different Chinese event types, and the third branch is used to extract event elements from the Chinese events; The method comprises: Acquire text description information of sample Chinese events, wherein the text description information of the sample Chinese events includes: a plurality of event texts to be classified; Determining a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event; Inputting the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each of the Chinese event types is greater than a preset threshold; Inputting the plurality of Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events; Inputting the element prompt word into the third branch of the large language model to obtain the element extraction result of the sample Chinese event; The first branch is trained based on the type classification result of the sample Chinese event, and the third branch is trained based on the element extraction result of the sample Chinese event to obtain the event classification and element extraction model.

2. The method according to claim 1, characterized in that The determining, based on the text description information of the sample Chinese event, a type prompt word corresponding to the sample Chinese event includes: Acquire an event type prompt word template, where the event type prompt word template is used to describe a mapping relationship between an event type and a type description text, where the type description text corresponds to the type prompt word; Based on the event type prompt word template, type matching is performed on a plurality of to-be-classified event texts corresponding to the sample Chinese events to obtain type prompt words corresponding to the sample Chinese events.

3. The method according to claim 1, characterized in that The step of inputting the plurality of Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events includes: Obtaining a target similar event corresponding to each of the Chinese event types, wherein the target similar event is a representative event instance corresponding to the Chinese event type; Based on the target similar events corresponding to each of the Chinese event types, the element prompt words corresponding to the sample Chinese events are determined.

4. The method according to claim 3, characterized in that The obtaining of target similar events corresponding to each Chinese event type includes: Based on the field-related text data corresponding to each of the Chinese event types, an event instance library is constructed, wherein the event instance library includes: a plurality of candidate event texts; Based on the text similarity between each candidate event text and each to-be-classified event text corresponding to the sample Chinese event, a target similar event corresponding to each Chinese event type is determined.

5. The method according to claim 3, characterized in that: The determining of the element prompt words corresponding to the sample Chinese event based on the target similar event corresponding to each Chinese event type includes: Acquire a feature extraction prompt word template, wherein the feature extraction prompt word template is used to describe a mapping relationship between an event type and a feature description text, wherein the feature description text corresponds to the feature prompt word; Based on the element extraction prompt word template, element matching is performed on the event representative instance corresponding to each of the Chinese event types to obtain the element prompt words corresponding to the sample Chinese event.

6. An event classification and factor extraction method, characterized in that: include: Get the text description information of the current Chinese event; Determine, based on the text description information of the current Chinese event, a type prompt word corresponding to the current Chinese event; Inputting the type prompt word corresponding to the current Chinese event into the event classification and factor extraction model to obtain the type classification result and factor extraction result of the current Chinese event; The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method described in any one of claims 1 to 5.

7. An event classification and factor extraction model training device, characterized in that: Applied to a large language model, the large language model includes: a first branch, a second branch and a third branch, the first branch is used to classify Chinese events into event types, the second branch is used to obtain element prompt words of different Chinese event types, and the third branch is used to extract event elements from the Chinese events; The device comprises: A first acquisition module is used to acquire text description information of sample Chinese events, wherein the text description information of the sample Chinese events includes: a plurality of event texts to be classified; A first determination module, configured to determine a type prompt word corresponding to the sample Chinese event based on the text description information of the sample Chinese event; A second determination module is configured to input the type prompt word into the first branch of the large language model to obtain a type classification result of the sample Chinese event, wherein the type classification result includes: a plurality of Chinese event types, and the confidence of each of the Chinese event types is greater than a preset threshold; A third determination module is used to input the plurality of Chinese event types into the second branch of the large language model to obtain element prompt words corresponding to the sample Chinese events; A fourth determination module, used for inputting the element prompt word into the third branch of the large language model to obtain an element extraction result of the sample Chinese event; The training module is used to train the first branch based on the type classification result of the sample Chinese event, and to train the third branch based on the element extraction result of the sample Chinese event to obtain the event classification and element extraction model.

8. An event classification and element extraction device, characterized in that: include: The second acquisition module is used to obtain the text description information of the current Chinese event; A fifth determination module, configured to determine a type prompt word corresponding to the current Chinese event based on the text description information of the current Chinese event; A sixth determination module, used for inputting the type prompt word corresponding to the current Chinese event into the event classification and element extraction model to obtain the type classification result and element extraction result of the current Chinese event; The event classification and factor extraction model is an event classification and factor extraction model trained and generated by the method described in any one of claims 1 to 5.

9. A computer device, characterized in that: It includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the event classification and factor extraction model training method as described in any one of claims 1 to 5, or implements the event classification and factor extraction method as described in claim 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the event classification and factor extraction model training method as described in any one of claims 1 to 5, or implements the event classification and factor extraction method as described in claim 6.

Citation Information

Patent Citations

  • Event extraction method based on MRC

    CN115587591A

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

    CN116186241A

  • Medical event extraction method based on generative pre-training language model

    CN117493504A

  • Text extraction method and device and electronic equipment

    CN117634449A

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

    CN117933256A

Cited By

  • Power grid operation event extraction and disposal method and system based on large language model

    CN121210629A