A method, system, terminal and storage medium for generating summary based on stance

By obtaining target entities and positions, filtering and entering summary generation models, and generating summary data for specific positions, the problem of the inability of existing technologies to generate summary of specific positions is solved, and the diversity and applicability of the summary is improved.

CN119203993BActive Publication Date: 2025-03-14GUANGDONG-HONG KONG-MACAO GREATER BAY AREA DIGITAL ECONOMY RESEARCH INSTITUTE (INTERNATIONAL ADVANCED TECHNOLOGY APPLICATION PROMOTION CENTER (SHENZHEN)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411692109.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

Existing digest generation methods cannot generate digest data with a specific position and cannot meet the diversified needs in actual applications.

Method used

By obtaining the target entity and target position in the original content, filtering out the target content, and entering it into the trained summary generation model, generating a target summary about the target entity under the target position.

Benefits of technology

The problem of the inability of prior art to generate a specific position has been solved, and the diversity and applicability of the abstract is improved, and it is applicable to the fields of information summary and perspective analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203993B_ABST
    Figure CN119203993B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, terminal and storage medium for generating a summary based on a stance, and relates to the technical field of natural language processing. The present invention obtains a target entity and a selected target stance in the original content, filters out a target content from the original content based on the target stance, and inputs the target content, target entity and target stance into a trained summary generation model to automatically generate a target summary of the target entity under the target stance. The present invention solves the problem that the existing large-scale language model cannot output a summary with a specific stance based on the original content, is highly suitable for the fields of information summarization and opinion analysis, and can provide strong support for various application scenarios that require summaries from specific perspectives.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a position-based summary generation method, system, terminal and storage medium. Background Art

[0002] Summarization is an important natural language processing technology that aims to generate concise and informative text summaries from data. Existing summary generation methods mainly use large language models to summarize the input data without a specific position or obvious point of view.

[0003] However, in practical applications, large language models are not required to output stereotyped summaries, but rather to output conclusions with specific positions or clear opinions.

[0004] Therefore, existing summary generation methods cannot meet the diverse needs in practical applications and need to be improved and developed. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a standpoint-based summary generation method, system, terminal and storage medium in view of the above-mentioned defects of the prior art, aiming to solve the problem that the existing summary generation method cannot generate summary data of a specific standpoint.

[0006] The technical solution adopted by the present invention to solve the problem is as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for generating a summary based on a stance, the method comprising:

[0008] Obtaining original content, a target entity located in the original content, and a target stance;

[0009] Filtering target content from the original content according to the target standpoint;

[0010] The target content, the target entity and the target stance are input into a trained summary generation model to obtain a target summary of the target entity under the target stance.

[0011] In one implementation, filtering out target content from the original content according to the target standpoint includes:

[0012] Classifying the original content according to stance using a trained stance classification model;

[0013] Target content is screened out from the classified content data according to the target standpoint.

[0014] In one embodiment, selecting target content from the classified content data according to the target standpoint includes:

[0015] Preliminarily screening the classified content data according to the target standpoint, and determining whether the amount of data preliminarily screened exceeds a preset quantity threshold;

[0016] If it exceeds, each content data preliminarily screened out is used as candidate content data, and the selection index corresponding to each candidate content data is obtained; wherein, the selection index includes at least one index of probability value and text diversity; the probability value of each candidate content data is the probability value of the candidate content data belonging to the target stance calculated by the trained stance classification model; the text diversity index can adopt the commonly used Distinct index, and its Distinct(n) is defined as the ratio of the number of non-repeating phrases of length n in the generated text to the number of phrases of length n in the generated text;

[0017] A plurality of candidate content data are selected as target content according to each of the selection indicators.

[0018] In one embodiment, the target content, the target entity, and the target stance are input into a trained summary generation model to obtain a target summary of the target entity under the target stance, including:

[0019] Perform splicing according to the target content, the target entity and the target stance to obtain splicing data;

[0020] Based on the concatenated data, a target summary is generated by the trained summary generation model.

[0021] In one implementation, splicing is performed according to the target content, the target entity, and the target stance to obtain spliced ​​data, including:

[0022] If the target content is text content, splicing is performed according to the text content, the target entity and the target stance to obtain spliced ​​data;

[0023] If the target content is text content and a picture, splicing is performed according to the text content, the image features of the picture, the target entity and the target standpoint to obtain spliced ​​data;

[0024] If the target content is target table data, splicing is performed according to the flattened target table data, the target entity and the target standpoint to obtain spliced ​​data.

[0025] In one embodiment, the training data set of the trained summary generation model includes training data groups corresponding to a plurality of training entities, and the generation method of each training data group includes:

[0026] A training content is obtained, and a plurality of training entities in the training content are identified by using a preset four-tuple generation model; wherein each of the training entities has data corresponding to different positions in the training content;

[0027] For each of the training entities, a training summary corresponding to each position is generated according to the training entity and the training content; for each position, a four-tuple training data is constructed according to the training entity, the training content, the position and the training summary corresponding to the position, so as to obtain the four-tuple training data corresponding to different positions;

[0028] Acquire a non-positional training summary corresponding to the training content, and construct triplet training data according to the training entity, the training content, and the non-positional corresponding training summary;

[0029] A training data set of the training entity is obtained according to the triple training data and all the quadruple training data.

[0030] In one implementation, the quadruple generation model is a large language model.

[0031] In one embodiment, the method for generating the quadruple training data includes:

[0032] Outputting initial four-tuple training data through the large language model; wherein the initial four-tuple training data consists of training entities, positions, training content, and training summaries with positions;

[0033] The initial four-tuple training data is converted into four-tuple training data in a preset format.

[0034] In one implementation, obtaining a non-positional training summary corresponding to the training content includes:

[0035] Based on the training content, a non-positioned training summary is generated by a basic generation model.

[0036] In one embodiment, for each stance, four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance, including:

[0037] For each position, calculating the fidelity and position consistency of the training summary corresponding to the position;

[0038] It is determined whether the fidelity and the consistency of the stance meet preset requirements. If so, a four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance.

[0039] In one embodiment, the method for obtaining the trained summary generation model includes:

[0040] Obtaining a training data group, and for each of the four-tuple training data in the training data group, generating training splicing data according to the training entities, the training content, and the stance in the four-tuple training data, to obtain the training splicing data corresponding to different stances;

[0041] Obtaining a pre-trained language model, and generating prediction summaries corresponding to different positions respectively according to the training concatenated data of different positions by using the pre-trained language model;

[0042] Calculating a loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the prediction summaries with different stances;

[0043] Determine whether the loss value of the pre-trained language model meets the training requirements, and if not, update the parameters of the pre-trained language model according to the loss value of the pre-trained language model;

[0044] The step of obtaining a training data set is continued until the loss value of the pre-trained language model meets the training requirement, thereby obtaining the trained summary generation model.

[0045] In one implementation, the pre-trained language model is a sequence-to-sequence small language model.

[0046] In one embodiment, calculating the loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances, includes:

[0047] Calculating a cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances;

[0048] Calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions;

[0049] A loss value of the pre-trained language model is calculated according to the cross entropy loss value and the KL divergence loss value.

[0050] In one implementation, calculating the loss value of the pre-trained language model according to the cross entropy loss value and the KL divergence loss value includes:

[0051] The loss value of the pre-trained language model is calculated according to a weighted sum of the cross entropy loss value and the KL divergence loss value.

[0052] In one embodiment, calculating the cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances, includes:

[0053] Obtaining a union of generation probability distributions of each word in the training summaries without stance and with different stances to obtain first union data;

[0054] Obtaining a union of generation probability distributions of each word in the prediction summary of different positions to obtain second union data;

[0055] A cross entropy loss value of the pre-trained language model is calculated according to the first union data and the second union data.

[0056] In one embodiment, calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions includes:

[0057] For each training summary of a position, obtaining a generation probability distribution of each word in the training summary of the position;

[0058] The KL divergence loss value of the pre-trained language model is calculated according to the generation probability distribution of each word in the training summary of different positions.

[0059] In one embodiment, the training data set of the stance classification model includes a plurality of training data pairs, and a method for generating each training data pair includes:

[0060] Acquire a data with stance; wherein the source of the data with stance includes the four-tuple training data;

[0061] Generate training text content and corresponding stance labels according to the stance data;

[0062] A training data pair is generated according to the training text content and the stance label.

[0063] In a second aspect, an embodiment of the present invention further provides a position-based summary generation system, the system comprising:

[0064] An acquisition module, used for acquiring original content, a target entity located in the original content, and a target stance;

[0065] A screening module, used for screening out target content from the original content according to the target standpoint;

[0066] A generation module is used to input the target content, the target entity and the target stance into a trained summary generation model to obtain a target summary of the target entity under the target stance.

[0067] In a third aspect, an embodiment of the present invention further provides a terminal, comprising a memory and one or more processors; the memory stores one or more programs; the programs include instructions for executing any of the above-described position-based summary generation methods; and the processor is used to execute the programs.

[0068] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement the steps of any of the above-mentioned stance-based summary generation methods.

[0069] Beneficial effects of the present invention: The embodiment of the present invention obtains the target entity and the selected target stance in the original content, filters out the target content from the original content based on the target stance, and inputs the target content, target entity and target stance into the trained summary generation model to automatically generate a target summary of the target entity under the target stance. This solves the problem that the existing large-scale language model cannot output a summary with a specific stance based on the original content, is highly suitable for the fields of information summarization and opinion analysis, and can provide strong support for various application scenarios that require summaries from specific perspectives. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0071] Figure 1 It is a flowchart of a method for generating a summary based on a stance provided by an embodiment of the present invention.

[0072] Figure 2 Schematic diagram of the training architecture of the summary generation model provided by an embodiment of the present invention.

[0073] Figure 3 Schematic diagram of modules of a stance-based summary generation system provided by an embodiment of the present invention.

[0074] Figure 4 It is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0075] The present invention discloses a method, system, terminal and storage medium for generating abstracts based on a stance. To make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0076] Those skilled in the art will appreciate that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" used here may include wireless connections or wired connections. The term "and / or" used here includes all or any unit and all combinations of one or more associated listed items.

[0077] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0078] In view of the above-mentioned defects of the prior art, the present invention provides a summary generation method based on a stance, the method obtaining original content, a target entity in the original content, and a target stance; filtering out target content from the original content according to the target stance; inputting the target content, the target entity, and the target stance into a trained summary generation model to obtain a target summary of the target entity under the target stance. The present invention obtains the target entity in the original content and the selected target stance, filters out the target content from the original content based on the target stance, and inputs the target content, the target entity, and the target stance into a trained summary generation model to automatically generate a target summary of the target entity under the target stance. The method solves the problem that the existing large-scale language model cannot output a summary with a specific stance based on the original content, is highly suitable for the fields of information summarization and opinion analysis, and can provide strong support for various application scenarios that require summaries from specific perspectives.

[0079] For example, as shown in Table 1, assume that the original content is a table about the different characteristics of the machine learning model, that is, Figure 2 In the table, select "Table: Comparison of Models X and Y". Take Model X in the table as the target entity and the positive stance as the target stance. Filter the corresponding target content (for example, content that Model X has an advantage over Model Y) from the table based on the positive stance, and input the filtered target content, Model X, and the positive stance into the trained summary generation model to automatically generate a target summary of Model X under the positive stance. The target summary allows you to intuitively see the advantages of Model X over other models. In this example, since the table does not contain much content, expand the table and input it into the model to automatically generate a summary with a stance.

[0080] Table 1. Comparison of Models X and Y

[0081]

[0082] like Figure 1 As shown, the method specifically includes:

[0083] Step S100: Acquire original content, a target entity in the original content, and a target stance.

[0084] Specifically, the summary generation task of this embodiment is to generate summary data of a specific position of one of the entities based on the original content. Therefore, it is necessary to first obtain the original content, select an entity in the original content as the target entity, and select a position as the target position. The original content in this embodiment can be a structured text about the target entity, and the data source of the structured text can be text data, comment data, and table data. The target entity can be a specific person, object, place, organization, or other keywords mentioned in the original content. The target position can be a specific viewpoint, theme, or tendency that the user wants the summary to reflect, such as a positive position or a negative position. The summary data of the positive position reflects the advantage information of the target entity, and the summary data of the negative position reflects the disadvantage information of the target entity. The target position can also be expressed as a positive position or a negative position, a praise position or a criticism position, etc. based on the user's specific viewpoint and tendency, or it can be a general position without a specific tendency, which will not be repeated here.

[0085] For example, the original content can be obtained based on tabular data provided by the user, or can be obtained by searching based on questions that the user is concerned about. For example, the system automatically obtains the user's desired content from a search engine or retrieval tool based on the text entered by the user.

[0086] Step S200: Filter out target content from the original content according to the target standpoint.

[0087] Since the original content contains too much data information, in order to improve the accuracy of summary generation, this embodiment processes the original content to remove data information irrelevant to the target position. Specifically, the original content is first classified, and then the content relevant to the target position is screened out, that is, the target content is obtained.

[0088] In one implementation, filtering out target content from the original content according to the target standpoint includes:

[0089] Classifying the original content according to stance using a trained stance classification model;

[0090] Target content is screened out from the classified content data according to the target standpoint.

[0091] Specifically, in order to improve the efficiency of content classification, this embodiment pre-constructs a stance classification model. The input data of the stance classification model is the original content, and the output data is the content data after the original content is classified according to the stance. The stance classification model has been trained in advance and has learned the complex mapping relationship between input and output, so it can achieve fast and accurate content classification. Finally, guided by the target stance, the content data that is highly relevant to the target stance is screened out, that is, the target content is obtained. In addition, the original content can be classified according to the stance by writing prompt words (Prompt) to screen out the target content consistent with the target stance.

[0092] In one implementation, selecting target content from the classified content data according to the target standpoint includes:

[0093] Preliminarily screening the classified content data according to the target standpoint, and determining whether the amount of data preliminarily screened exceeds a preset quantity threshold;

[0094] If more than, each content data preliminarily screened out is used as candidate content data, and the selection index corresponding to each candidate content data is obtained; wherein, the selection index includes at least one index of probability value and text diversity; the probability value of each candidate content data is the probability value of the candidate content data belonging to the target stance calculated by the trained stance classification model; the text diversity index can adopt the commonly used Distinct index;

[0095] A plurality of candidate content data are selected as target content according to each of the selection indicators.

[0096] Specifically, data that may be related to the target stance is preliminarily screened out from the classified content data. If the amount of data preliminarily screened out exceeds a preset quantity threshold, indicating that further verification and screening are still required, the preliminarily screened out content data is used as candidate content data. There are multiple selection methods for selecting part of the multiple candidate content data as the final target content. For example, it can be selected according to the probability value of belonging to the target stance, or according to text diversity (text diversity is used to reflect the proportion of different words in the generated text), or according to both the probability value and text diversity. Therefore, the selection index for candidate content data in this embodiment can be composed of one or more indicators according to user needs. In this embodiment, the probability value can be quickly and objectively calculated through the stance classification model. The stance classification model is a machine learning model that has been trained in advance and outputs the classification category corresponding to each content data by calculating the probability value of each content data belonging to different categories. Therefore, the stance classification model can be used to calculate the probability value of each candidate content data belonging to the target stance. The candidate content data is sorted and valued according to the selection index, and the first several candidate content data are screened out as the target content. In addition, if there is no content data related to the target position, the content data can be randomly selected according to business needs, or a reply message can be generated, for example, the reply message is: the viewpoint of this position does not exist in the data.

[0097] Step S300: input the target content, the target entity and the target stance into a trained summary generation model to obtain a target summary of the target entity under the target stance.

[0098] Specifically, in order to quickly generate summary data with a stance, this embodiment pre-trains a summary generation model. The summary generation model is a language model, and the input data is the target content, target entity, and target stance selected from the original content; the output data is the automatically generated summary data about the target entity under the target stance. Automatically generating summary data with a target stance through the summary generation model not only effectively improves the efficiency of information processing, but also ensures that the generated summary data has a specific stance, so that users can quickly and intuitively understand the information of a specified entity in the original content under a specific stance, without having to read a large amount of original content and then summarize and conclude.

[0099] In one implementation, the target content, the target entity, and the target stance are input into a trained summary generation model to obtain a target summary of the target entity under the target stance, including:

[0100] Perform splicing according to the target content, the target entity and the target stance to obtain splicing data;

[0101] Based on the concatenated data, a target summary is generated by the trained summary generation model.

[0102] Specifically, the target content, target entity, and target stance are concatenated to form a new data structure, namely, concatenated data. The purpose of concatenation is to integrate relevant information together to ensure that the summary generation model can simultaneously consider the text content, the specified entity, and the expected stance, so as to more accurately generate summary data that conforms to the expected stance for the specified entity.

[0103] For example, as shown in Table 1, the original content is a table, and a target entity X, a positive stance, and the filtered table data contained in the original content are concatenated and input into the trained summary generation model. The summary generation model automatically generates positive summary data that reflects the advantages of the target entity X.

[0104] In one implementation, splicing is performed according to the target content, the target entity, and the target stance to obtain spliced ​​data, including:

[0105] If the original content is text, and the target content is text content, splicing is performed according to the text content, the target entity, and the target stance to obtain spliced ​​data;

[0106] If the original content is text and pictures, and the target content is text content and pictures, splicing is performed according to the text content, the image features of the pictures, the target entity and the target standpoint to obtain spliced ​​data;

[0107] If the original content is a table, the target table data is flattened to obtain the target content, and then the flattened target table data, the target entity and the target standpoint are spliced ​​to obtain spliced ​​data.

[0108] This embodiment uses appropriate methods to integrate target content, target entity and target stance to form spliced ​​data for different types of data. Specifically, if the input is text content, the text content, target entity and target stance are spliced ​​together as strings; if the input is comment data including text and pictures, the text content and pictures in the comment data are extracted, and the text content, image features of the pictures, target entity and target stance are spliced ​​together as strings; if the input is table data, the target table data is flattened to obtain flattened target table data, and the flattened target table data, target entity and target stance are spliced ​​together.

[0109] For example, if the input data is in tabular form, flatten the original tabular data and convert the target entity ,position , flattened target table data The three strings are concatenated to get the concatenated data. :

[0110] ;

[0111] Based on the splicing data through the trained summary generation model StanceTS Generate target summary :

[0112] .

[0113] In one implementation, the training data set of the trained summary generation model includes training data groups corresponding to a plurality of training entities, and a method for generating each training data group includes:

[0114] A training content is obtained, and a plurality of training entities in the training content are identified by using a preset four-tuple generation model; wherein each of the training entities has data corresponding to different positions in the training content;

[0115] For each of the training entities, a training summary corresponding to each position is generated according to the training entity and the training content; for each position, a four-tuple training data is constructed according to the training entity, the training content, the position and the training summary corresponding to the position, so as to obtain the four-tuple training data corresponding to different positions;

[0116] Acquire a non-positional training summary corresponding to the training content, and construct triplet training data according to the training entity, the training content, and the non-positional corresponding training summary;

[0117] A training data set of the training entity is obtained according to the triple training data and all the quadruple training data.

[0118] Specifically, the training content in this embodiment refers to the content used to generate training data. If the training content is tabular data, the training content can be obtained based on the SciGen data set. This embodiment has the same data processing method for all training contents, so taking a training content as an example, it is explained how to generate training data for the summary generation model based on the training content. In order to improve the processing efficiency of the training content, this embodiment pre-obtains a four-tuple generation model, and inputs the training content into the four-tuple generation model. The model first identifies the entities that meet the requirements in the training data to obtain the training entities. The identification requirement is that the entity needs to contain data of different positions in the training content. For example, the position type includes positive position and negative position, and the identified entity needs to contain data of positive position and negative position at the same time. Then, for each training entity, the summary data of the training entity in each position is generated based on the training content, that is, the training summary of the training entity in different positions is obtained. For example, the position type includes positive position and negative position, and the training summary of the training entity generated by the four-tuple generation model includes positive summary and negative summary. Afterwards, four-tuple training data is generated, and each four-tuple training data contains four elements: training entity, training content, stance, and training summary corresponding to the stance. The number of four-tuple training data corresponding to the training entity is consistent with the number of stance categories. For example, if the stance types include positive stance and negative stance, then the training entity contains four-tuple training data corresponding to the positive stance and the negative stance, respectively. In addition, it is also necessary to obtain a stance-free training summary corresponding to the training content, that is, a common summary, through existing technology. Afterwards, three-tuple training data is generated, and the three-tuple training data includes three elements: training entity, training content, and stance-free training summary. The three-tuple training data of the training entity and all four-tuple training data are aggregated to obtain a training data group generated based on the training entity. This embodiment can quickly process the training content through the four-tuple generation model and construct training data for the summary generation model.

[0119] In one implementation, the quadruple generation model is a large language model.

[0120] Specifically, this embodiment can use a large language model (LLM) as a four-tuple generation model to quickly generate four-tuple training data of {training entity, position, training content, training summary}, and then obtain training data for the summary generation model. Since the cost of artificial data sets is high, especially the summary data for specific positions is more scarce, this embodiment can effectively solve the problem of high cost of artificially generated data through the generation capability of a large language model, thereby effectively improving model performance.

[0121] In one embodiment, the method for generating the quadruple training data includes:

[0122] Outputting initial four-tuple training data through the large language model; wherein the initial four-tuple training data consists of training entities, positions, training content, and training summaries with positions;

[0123] The initial four-tuple training data is converted into four-tuple training data in a preset format.

[0124] Specifically, the quadruple training data generated in this embodiment is used for subsequent training of the summary generation model. The format of the training data needs to match the model structure. Therefore, this embodiment needs to determine the preset format that the quadruple training data needs to meet based on the summary generation model, and use the preset format to convert the initial quadruple training data output by the large language model.

[0125] For example, assume that the Llama-3-8B-Instruct model (a large language model) is used as the four-tuple generation model, the stance categories include positive stance and negative stance, and the input training content is a table T about the machine learning model, such as Table 1.

[0126] After the training content is input into the quadruple generation model, the model will first identify the training entity. The training entity must have both positive data corresponding to the positive position and negative data corresponding to the negative position. In other words, compared with other entities, the identified training entity has data that performs better than other entities and data that performs worse than other entities. For example, the identified training entity is model X in the table. Model X is worse than other models in terms of accuracy (positive data), but the number of parameters will be larger and consume more resources (negative data).

[0127] The quadruple generation model then generates a stance summary S about the training entity, including positive and negative summaries.

[0128] An example of a summary of the positive stance generated based on Table 1:

[0129] StanceTS in positive stance on X:

[0130] Model X stands out for its impressive performance and resource comparison with Model Y. With a massive 8 billion parameters, X demonstrates its ability to handle complex tasks with ease. The model's accuracy of 80% isa testament to its robustness and effectiveness. Furthermore, the model'smaximum token count of 32,000 and minimum GPU size of 16 demonstrate itsefficiency and scalability. Overall,Model X's performance and resources makeit a strong contender in its field.

[0131] An example of a summary of negative stances generated based on Table 1:

[0132] StanceTS in negative stance on X:

[0133] Model X has several drawbacks that hinder its performance. Firstly, it has a large number of parameters, with 8B, which can lead to increased computational complexity and memory requirements. Additionally, its prices are relatively high. Moreover, Model X requires a significant amount of GPU resources, with 16 GB required to process 32,000 tokens. Overall, these limitations suggest that Model X may not be the most efficient choice for certain applications.

[0134] Example of a non-positioned summary generated based on Table 1:

[0135] Neutral generated summary:

[0136] Model X and Y have varying parameters, prices, and performancecapabilities. Model X has 8 billion parameters, and achieves an accuracy of 80% with a maximum token limit of 32,000 and a minimum GPU requirement of 16GB. In contrast, Model Y has 566 million parameters, and achieves an accuracy of 75% with a maximum token limit of 5,000 and a minimum GPU requirement of 8GB.

[0137] Finally, the large language model outputs the initial four-tuple training data {target entity, target stance, original content, summary with target stance}, and converts the format into a preset format (such as JSON format), thus obtaining the four-tuple training data for training the summary generation model.

[0138] In one implementation, obtaining a non-positional training summary corresponding to the training content includes:

[0139] Based on the training content, a non-positioned training summary is generated by a basic generation model.

[0140] Specifically, the basic generation model is a traditional summary generation model, which can only generate a non-positional summary based on the input content. In the stage of generating training data, for each input content, in addition to inputting it into the four-tuple generation model, it is also necessary to input it into the basic generation model, and the basic generation model outputs the non-positional training summary corresponding to the training content, and forms triple training data in a preset format (such as JSON format). The training data group of the summary generation model is jointly constructed by the triple training data output by the basic generation model and the four-tuple training data output by the four-tuple generation model.

[0141] In one implementation, for each stance, four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance, including:

[0142] For each position, calculating the fidelity and position consistency of the training summary corresponding to the position;

[0143] It is determined whether the fidelity and the consistency of the stance meet preset requirements. If so, a four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance.

[0144] Specifically, in order to ensure the quality of training data of the summary generation model, the present embodiment needs to filter the training summary to ensure high-quality training data. Specifically, the present embodiment sets a filtering mechanism based on fidelity and position consistency. After the training summary is generated, the similarity between the training summary and the input training content is calculated to determine the fidelity of the training summary, and the position consistency between the training summary and the corresponding position in the four-tuple training data is calculated. Only when both the fidelity and position consistency indicators meet the preset requirements, the training summary can be retained and used to construct the four-tuple training data. For a training entity, only when the fidelity and position consistency indicators of all its corresponding training summaries meet the preset requirements, the four-tuple training data constructed based on the training entity will be retained, otherwise they will be eliminated. The present embodiment adopts a four-tuple generation model and a filtering mechanism, which can not only solve the problem of scarcity of training data for the summary generation model, but also effectively ensure the generation quality of training data.

[0145] In one implementation, fidelity can be measured by TAPAS-Acc (a metric for assessing the accuracy of table summaries that measures the quality of summaries by comparing the original table and the reversed table), and stance consistency can be assessed by LLM.

[0146] For example, input table T (i.e., Table 1) into the four-tuple generation model, identify the training entity X, and generate a positive summary S:

[0147] S = “Model X stands out for its impressive performance and resource comparison with Model Y. With a massive 8 billion parameters, X demonstrates its ability to handle complex tasks with ease. The model's accuracy of 80% isa testament to its robustness and effectiveness. Furthermore, the model's maximum token count of 32,000 and minimum GPU size of 16 demonstrate its efficiency and scalability. Overall, Model X's performance and resources make it a strong contender in its field.”

[0148] Filter the forward summary S:

[0149] (1) The fidelity of the positive summary S as measured by TAPAS-Acc is true.

[0150] (2) Use LLM to evaluate whether the stance consistency of the forward summary S is true.

[0151] Construct quadruple training data (TSTS quadruple):

[0152] {Target:X,Stance:Postitive,Table:T,Summary:S};

[0153] That is, the training data consists of a four-tuple consisting of a training entity (Target), a standpoint (Standpoint), a table (Table), and a training summary (Summary).

[0154] Taking the stance category including positive stance and negative stance as an example, the total amount of data after filtering is d=3K, including K pairs of four-tuple data and K triple data. K is the number of training entities, and 3 means that each training entity includes a pair of four-tuple training data and one triple training data. A pair of four-tuple training data of the same training entity has the same training entity and training content, but opposite stances, so the training summaries generated based on stances are also different. K pairs of four-tuple training data are K pairs of positive and negative stance pairs. The training entity and training content of the triple training data of the same training entity are consistent with the corresponding four-tuple training data, but the training summary has no specific stance.

[0155] The experimental results show that after adopting the filtering mechanism, only about 60% of the data is retained, indicating that the filtering mechanism can strictly control the data quality. If the training data set generated by the filtering mechanism is used for model training, the fidelity index of the summary generation model will be improved to a certain extent.

[0156] In one implementation, the method for obtaining the trained summary generation model includes:

[0157] Obtaining a training data group, and for each of the four-tuple training data in the training data group, generating training splicing data according to the training entities, the training content, and the stance in the four-tuple training data, to obtain the training splicing data corresponding to different stances;

[0158] Obtaining a pre-trained language model, and generating prediction summaries corresponding to different positions respectively according to the training concatenated data of different positions by using the pre-trained language model;

[0159] Calculating a loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the prediction summaries with different stances;

[0160] Determine whether the loss value of the pre-trained language model meets the training requirements, and if not, update the parameters of the pre-trained language model according to the loss value of the pre-trained language model;

[0161] The step of obtaining a training data set is continued until the loss value of the pre-trained language model meets the training requirement, thereby obtaining the trained summary generation model.

[0162] In summary, this embodiment obtains a summary generation model by fine-tuning the model. A pre-trained language model is determined in advance as the fine-tuning object of the summary generation model. The model has learned some basic language expression capabilities through pre-training, and then the pre-trained language model is fine-tuned through the training data group generated above to save the training cost of the summary generation model. Specifically, the model fine-tuning process is an iterative update process. For each position, the corresponding training entity, training content, the position and the training summary of the position are spliced ​​together to obtain the training splicing data of the position. The number of training splicing data corresponding to a training data group is consistent with the number of position categories. Then the training splicing data of each position is input into the pre-trained language model respectively, and the pre-trained language model will learn to generate corresponding prediction summaries with positions according to different positions. In order to evaluate the performance of the model, it is necessary to analyze the differences between the training summaries without positions and different positions, as well as the prediction summaries of different positions, and calculate the loss value of the pre-trained language model through the analysis results. The smaller the loss value, the more accurate the prediction summary generated by the model. Then, determine whether the loss value of the pre-trained language model meets the training requirements. If not, update the parameters of the pre-trained language model based on the loss value to optimize the model performance. For example, the parameters can be updated through the back propagation algorithm or the gradient descent algorithm. Repeat the above steps until the loss value of the pre-trained language model meets the training requirements, and use the pre-trained language model as the trained summary generation model.

[0163] In one implementation, the pre-trained language model is a sequence-to-sequence small language model.

[0164] Specifically, this embodiment combines the generation capability of a large language model with the fine-tuning advantage of a small sequence-to-sequence language model to balance computational cost and summary quality. A high-quality training dataset is generated by a large language model, and the small sequence-to-sequence language model is fine-tuned by the training dataset to obtain the final summary generation model. The summary generation model obtained in this way can generate summary data with a specific stance.

[0165] For example, assuming that the training content is a table, the task of the summary generation model (StanceTS) is a stance-based table summary task. The table summary task refers to the task of converting table data into natural language text descriptions, aiming to extract the key information in the table and present it in a coherent and concise manner.

[0166] Use a pre-trained sequence-to-sequence small language model (SLM), such as BART and T5, as the base model, and fine-tune it using the training dataset generated above to adapt to the stance-based table summary task.

[0167] During the training process, the input data of the summary generation model is represented as:

[0168] If the training content is text content, the training entity, stance, and training text content in the four-tuple training data are concatenated to obtain concatenated data;

[0169] If the training content is text content and pictures, the training entity, stance, training text content and image features of the training picture in the four-tuple training data are spliced;

[0170] If the training content is tabular data, the training tabular data in the quadruple training data is flattened, and the training entity, stance, and the flattened training tabular data are spliced ​​to obtain spliced ​​data.

[0171] Taking the training content as tabular data as an example, the input training content is flattened from the original tabular data, and the entities in the four-tuple training data are ,position , flattened training table data Stitch together.

[0172] ;

[0173] Taking Table 1 above as an example, assuming that the training data set includes the four-tuple training data pair corresponding to entity X, the training concatenated data of entity X is (i.e. the input data of the model) is represented as follows:

[0174] entity: <tatget>X;

[0175] position: <s>Specified stance: Positive;

[0176] Flattened Table 1: Performance and resource comparison of model X and model Y: Model|Parameters|Accuracy(%)|Max Tokens|Min GPU(GB) Size 0: X|8B|80|32,000|16 Rows 1: Y|566M|1000|75|5000|8.

[0177] Assuming that the stance categories include positive stances and negative stances, the training data set of entity X includes four-tuple training data of positive stances and negative stances, and the two four-tuple training data will respectively generate one piece of training concatenated data.

[0178] By fine-tuning the small language model through these training concatenation data, we can get the trained summary generation model StanceTS:

[0179] ;

[0180] in, Generate concatenated data for the input summary model StanceTS, Summary data with stance predicted by the summary generation model StanceTS.

[0181] In one implementation, calculating the loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances, includes:

[0182] Calculating a cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances;

[0183] Calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions;

[0184] A loss value of the pre-trained language model is calculated according to the cross entropy loss value and the KL divergence loss value.

[0185] Specifically, Figure 2 As shown, the loss value of the pre-trained language model in this embodiment consists of two parts, one is the cross entropy loss value, and the other is the KL divergence loss value. The cross entropy loss value measures the difference between the predicted summary generated by the model and the different training summaries. The introduction of the cross entropy loss can converge the difference between the predicted results of the model and the actual results. KL divergence (Kullback-Leibler divergence) is a measurement method for measuring the difference between two probability distributions. The introduction of KL divergence loss can enhance the model's ability to distinguish summaries of different positions. Combining the cross entropy loss value and the KL divergence loss value can more comprehensively evaluate the performance of the model and optimize the model, so that the model can better adapt to the summary generation tasks of different positions.

[0186] In one implementation, calculating the loss value of the pre-trained language model according to the cross entropy loss value and the KL divergence loss value includes:

[0187] The loss value of the pre-trained language model is calculated according to a weighted sum of the cross entropy loss value and the KL divergence loss value.

[0188] Specifically, this embodiment uses a weighted sum method to merge the two loss values, the cross entropy loss value and the KL divergence loss value, to obtain the loss value of the pre-trained language model. In actual application, the user can determine the weight values ​​corresponding to the two loss values ​​according to their own needs or task requirements. The higher the weight value, the more important the loss value of this type is. Designing a suitable loss function for the model can enable smaller language models to effectively perform stance-based summary generation tasks, and be comparable to large language models in performance, and even surpass large language models in terms of stance consistency.

[0189] For example, the calculation formula of the loss value Loss of the pre-trained language model is as follows:

[0190] ;

[0191] in, Represents the cross entropy loss value; represents the KL divergence loss value, The weight value representing the KL divergence loss value. During the model fine-tuning phase, the AdamW optimizer can be used and the learning rate can be set to 1×10 -5 , the weight decay is 1×10 -3 , trained for 10 epochs (an epoch refers to the process of passing the entire training dataset through the neural network for a forward propagation and back propagation), with a batch size of 6. The quality of the stance summaries generated by the model is evaluated by fidelity and stance consistency.

[0192] In one implementation, calculating the cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances, includes:

[0193] Obtaining a union of generation probability distributions of each word in the training summaries without stance and with different stances to obtain first union data;

[0194] Obtaining a union of generation probability distributions of each word in the prediction summary of different positions to obtain second union data;

[0195] A cross entropy loss value of the pre-trained language model is calculated according to the first union data and the second union data.

[0196] In general, in the model fine-tuning stage, it is necessary to evaluate the degree of agreement between the probability distribution of each word generated by the pre-trained language model when generating a summary with a stance and the probability distribution of each word generated in the actual training data. The degree of agreement can be quantified by calculating the cross-entropy loss value, and the model parameters can be adjusted to improve the model performance. Specifically, when generating a summary, the pre-trained language model calculates a probability for each possible word, indicating the relative possibility of the word appearing in the current context. Based on this summary generation method of the pre-trained language model, this embodiment calculates the cross-entropy loss value of the model through two kinds of union data. The first union data is obtained by obtaining the generation probability distribution of each word in the training summaries without stance and different stances, and merging these generation probability distributions to form a comprehensive probability distribution set. Similarly, the second union data is obtained by obtaining the generation probability distribution of each word in the predicted summaries of different stances, and merging these generation probability distributions to form another comprehensive probability distribution set. The cross-entropy loss value is obtained by comparing the difference between the first union data and the second union data.

[0197] For example, the cross entropy loss function The calculation formula is as follows:

[0198] ;

[0199] In the formula, ,in , , The probability distribution of each word (token) generated for the summary without stance, the summary with positive stance, and the summary with negative stance, respectively. Then the corresponding samples. The probability distribution generated for each token of the corresponding predicted summary.

[0200] In one implementation, calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions includes:

[0201] For each training summary of a position, obtaining a generation probability distribution of each word in the training summary of the position;

[0202] The KL divergence loss value of the pre-trained language model is calculated according to the generation probability distribution of each word in the training summary of different positions.

[0203] Probabilistically, the purpose of introducing the KL divergence loss is to maximize the difference between the probability distributions of positive summaries and negative summaries, and to encourage the model to learn more significant distinguishing features. At the same time, the KL divergence is calculated at the token level, which enables the model to distinguish summaries of different positions at a more subtle level. Specifically, when generating a summary, the pre-trained language model calculates a probability for each possible word, indicating the relative possibility of the word appearing in the current context. Based on this summary generation method of the pre-trained language model, taking the stance categories of positive stance and negative stance as an example, this embodiment compares the generation probability distribution of each word predicted by the model when generating a positive summary with the generation probability distribution of each word predicted when generating a negative summary, and obtains the KL divergence loss value.

[0204] For example, the calculation formula of the KL loss function value is as follows:

[0205] ;

[0206] ;

[0207] In the formula, KLD defines the KL divergence. is the probability distribution generated by the model for each word (token) of the summary predicted when the input stance is "Positive", It is the probability distribution of each word (token) generated by the model when the stance is "Negative".

[0208] By using different small language models as fine-tuning objects for experiments, the experimental results show that after introducing KL divergence loss, the stance consistency of the summary generation model will be improved to a certain extent. It is further verified that the introduction of KL divergence loss can make the positive stance generated by the model more positive and the negative stance more negative, thereby enhancing the model's ability to distinguish different stances.

[0209] In one implementation, the training data set of the stance classification model includes a plurality of four-tuple training data pairs, and a method for generating each of the training data pairs includes:

[0210] Acquire a data with stance; wherein the source of the data with stance includes the four-tuple training data;

[0211] Generate training text content and corresponding stance labels according to the stance data;

[0212] A training data pair is generated according to the training text content and the stance label.

[0213] Specifically, the training data set of the stance classification model needs to be generated using data with stances. Data with stances refers to data containing specific stances or viewpoints. In order to reduce the cost of generating training data, this embodiment can use the aforementioned generated four-tuple training data to construct the training data set of the stance classification model. After obtaining the data with stances, the text content used for training is extracted from the data with stances, and the stance label of each text content is determined. Finally, the generated training text content and its corresponding stance label are combined into a training data pair.

[0214] For example, when constructing the training data of the stance classification model ClassifyTS, the stance data can be obtained through the aforementioned four-tuple training data, or other stance data can be introduced. The training data of ClassifyTS can be in JSON format, containing two parts of information: training text content and stance labels, such as positive stance labels and negative stance labels.

[0215] The training data of ClassifyTS is as follows:

[0216] {Input:S,Label:'Positive'};

[0217] The stance classification model can be trained using the training data of ClassifyTS, or the stance classification model can be fine-tuned using the BERT model.

[0218] The advantages of the present invention are:

[0219] 1. The present invention can realize the generation of summaries with specific stances: it can generate a summary of the target entity based on a given stance, which is a capability that traditional summary models do not have.

[0220] 2. The present invention improves the quality of summaries: by introducing the four-tuple training data pair of {entity, stance, original content, summary with stance} and the filtering mechanism, the high quality of the training data is ensured, thereby improving the performance of the summary generation model and further improving the overall quality of the generated summary.

[0221] 3. The present invention enhances the model’s ability to distinguish positions: by introducing the KL divergence loss, the model is able to better distinguish and generate summaries of different positions.

[0222] 4. The present invention has good versatility: it can be applied to a variety of sequence-to-sequence language models, such as BART and T5 models, and has strong adaptability.

[0223] 5. The present invention does not require additional reasoning overhead: No additional computing or storage resources are required during the reasoning phase, thus maintaining the high efficiency of the model.

[0224] 6. The present invention improves the robustness of the model: through diversified training data and effective filtering mechanism, the performance stability of the model in various situations is enhanced.

[0225] Based on the above embodiments, the present invention also provides a position-based summary generation system, such as Figure 3 As shown, the system comprises:

[0226] An acquisition module 01 is used to acquire original content, a target entity in the original content, and a target stance;

[0227] A screening module 02, configured to screen out target content from the original content according to the target standpoint;

[0228] The generation module 03 is used to input the target content, the target entity and the target stance into the trained summary generation model to obtain a target summary of the target entity under the target stance.

[0229] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 4 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a position-based summary generation method is implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.

[0230] Those skilled in the art will understand that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0231] In one implementation, one or more programs are stored in the memory of the terminal, and the one or more programs are configured to be executed by one or more processors, and the one or more programs include instructions for performing a stance-based summary generation method.

[0232] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may 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).

[0233] In summary, the present invention discloses a summary generation method, system, terminal and storage medium based on standpoint. The method obtains original content, a target entity in the original content and a target standpoint; filters out target content from the original content according to the target standpoint; inputs the target content, the target entity and the target standpoint into a trained summary generation model to obtain a target summary of the target entity under the target standpoint. The present invention obtains the target entity in the original content and the selected target standpoint, filters out the target content from the original content based on the target standpoint, and generates input data of the summary generation model obtained in advance through the target content, the target entity and the target standpoint. Summary data about the target entity under the target standpoint is automatically generated according to the input data through the summary generation model. The problem that the existing summary generation method lacks a specific standpoint is solved, and it is highly suitable for the fields of information summarization and opinion analysis, and can provide strong support for various application scenarios that require specific perspective summaries.

[0234] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.< / s> < / tatget>

Claims

1. A stance-based summary generation method, characterized in that: The method comprises: Obtaining original content, a target entity located in the original content, and a target stance; Filtering target content from the original content according to the target stance includes: classifying the original content and preliminarily filtering out data related to the target stance from the classified content data; if the amount of the preliminarily filtered out data exceeds a preset quantity threshold, using the preliminarily filtered out content data as candidate content data; selecting part of the candidate content data as the target content according to text diversity and / or probability values ​​of belonging to the target stance; The target content, the target entity and the target stance are input into a trained summary generation model to obtain a target summary of the target entity under the target stance.

2. The position-based summary generation method according to claim 1, characterized in that: Filtering target content from the original content according to the target standpoint includes: Classifying the original content according to stance using a trained stance classification model; Target content is screened out from the classified content data according to the target standpoint.

3. The position-based summary generation method according to claim 2, characterized in that: Filtering target content from the classified content data according to the target standpoint includes: Preliminarily screening the classified content data according to the target standpoint, and determining whether the amount of data preliminarily screened exceeds a preset quantity threshold; If more than, each content data preliminarily screened out is used as candidate content data, and the selection index corresponding to each candidate content data is obtained; wherein, the selection index includes at least one index of probability value and text diversity; the probability value of each candidate content data is the probability value of the candidate content data belonging to the target stance calculated by the trained stance classification model; the text diversity index can adopt the commonly used Distinct index; A plurality of candidate content data are selected as target content according to each of the selection indicators.

4. The position-based summary generation method according to claim 1, characterized in that: Inputting the target content, the target entity, and the target stance into a trained summary generation model to obtain a target summary of the target entity under the target stance, including: Perform splicing according to the target content, the target entity and the target stance to obtain splicing data; Based on the concatenated data, a target summary is generated by the trained summary generation model.

5. The position-based summary generation method according to claim 4, characterized in that: Splicing is performed according to the target content, the target entity and the target stance to obtain splicing data, including: If the target content is text content, splicing is performed according to the text content, the target entity and the target stance to obtain spliced ​​data; If the target content is text content and a picture, splicing is performed according to the text content, the image features of the picture, the target entity and the target standpoint to obtain spliced ​​data; If the target content is target table data, splicing is performed according to the flattened target table data, the target entity and the target standpoint to obtain spliced ​​data.

6. The position-based summary generation method according to claim 4, characterized in that: The training data set of the trained summary generation model includes a plurality of training data groups corresponding to the training entities, and the generation method of each training data group includes: A training content is obtained, and a plurality of training entities in the training content are identified by using a preset four-tuple generation model; wherein each of the training entities has data corresponding to different positions in the training content; For each of the training entities, a training summary corresponding to each position is generated according to the training entity and the training content; for each position, a four-tuple training data is constructed according to the training entity, the training content, the position and the training summary corresponding to the position, so as to obtain the four-tuple training data corresponding to different positions; Acquire a non-positional training summary corresponding to the training content, and construct triplet training data according to the training entity, the training content, and the non-positional corresponding training summary; A training data set of the training entity is obtained according to the triple training data and all the quadruple training data.

7. The position-based summary generation method according to claim 6, characterized in that: The quadruple generation model is a large language model.

8. The position-based summary generation method according to claim 7, characterized in that: The method for generating the four-tuple training data comprises: Outputting initial four-tuple training data through the large language model; wherein the initial four-tuple training data consists of training entities, positions, training content, and training summaries with positions; The initial four-tuple training data is converted into four-tuple training data in a preset format.

9. The method for generating a summary based on a stance according to claim 6, characterized in that: Obtaining a non-positional training summary corresponding to the training content, including: Based on the training content, a non-positioned training summary is generated by a basic generation model.

10. The position-based summary generation method according to claim 6, characterized in that: For each stance, four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance, including: For each position, calculating the fidelity and position consistency of the training summary corresponding to the position; It is determined whether the fidelity and the consistency of the stance meet preset requirements. If so, a four-tuple training data is constructed according to the training entity, the training content, the stance, and the training summary corresponding to the stance.

11. The position-based summary generation method according to claim 6, characterized in that: The method for obtaining the trained summary generation model includes: Obtaining a training data group, and for each of the four-tuple training data in the training data group, generating training splicing data according to the training entities, the training content, and the stance in the four-tuple training data, to obtain the training splicing data corresponding to different stances; Obtaining a pre-trained language model, and generating prediction summaries corresponding to different positions respectively according to the training concatenated data of different positions by using the pre-trained language model; Calculating a loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the prediction summaries with different stances; Determine whether the loss value of the pre-trained language model meets the training requirements, and if not, update the parameters of the pre-trained language model according to the loss value of the pre-trained language model; The step of obtaining a training data set is continued until the loss value of the pre-trained language model meets the training requirement, thereby obtaining the trained summary generation model.

12. The position-based summary generation method according to claim 11, characterized in that: The pre-trained language model is a small sequence-to-sequence language model.

13. The method for generating a summary based on a stance according to claim 11, characterized in that: Calculating the loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the prediction summaries with different stances, including: Calculating a cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances; Calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions; A loss value of the pre-trained language model is calculated according to the cross entropy loss value and the KL divergence loss value.

14. The position-based summary generation method according to claim 13, characterized in that: Calculating the loss value of the pre-trained language model according to the cross entropy loss value and the KL divergence loss value includes: The loss value of the pre-trained language model is calculated according to a weighted sum of the cross entropy loss value and the KL divergence loss value.

15. The position-based summary generation method according to claim 13, characterized in that: Calculating the cross entropy loss value of the pre-trained language model according to the training summaries without stance and with different stances, and the predicted summaries with different stances, including: Obtaining a union of generation probability distributions of each word in the training summaries without stance and with different stances to obtain first union data; Obtaining a union of generation probability distributions of each word in the prediction summary of different positions to obtain second union data; A cross entropy loss value of the pre-trained language model is calculated according to the first union data and the second union data.

16. The method for generating a summary based on a stance according to claim 13, characterized in that: Calculating the KL divergence loss value of the pre-trained language model according to the training summaries of different positions, including: For each training summary of a position, obtaining a generation probability distribution of each word in the training summary of the position; The KL divergence loss value of the pre-trained language model is calculated according to the generation probability distribution of each word in the training summary of different positions.

17. The method for generating a summary based on a stance according to claim 6, characterized in that: The training data set of the stance classification model includes a plurality of training data pairs, and the method for generating each training data pair includes: Acquire a data with stance; wherein the source of the data with stance includes the four-tuple training data; Generate training text content and corresponding stance labels according to the stance data; A training data pair is generated according to the training text content and the stance label.

18. A stance-based summary generation system, characterized in that: The system comprises: An acquisition module, used for acquiring original content, a target entity located in the original content, and a target stance; a screening module, for screening target content from the original content according to the target stance, comprising: classifying the original content, and preliminarily screening data related to the target stance from the classified content data; if the amount of preliminarily screened data exceeds a preset quantity threshold, using the preliminarily screened content data as candidate content data; and selecting part of the candidate content data as the target content according to text diversity and / or probability values ​​of belonging to the target stance; A generation module is used to input the target content, the target entity and the target stance into a trained summary generation model to obtain a target summary of the target entity under the target stance.

19. A terminal, characterized in that: The terminal includes a memory and at least one processor; the memory stores a program; the program includes instructions for executing the position-based summary generation method according to any one of claims 1 to 17; and the processor is used to execute the program.

20. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are suitable for being loaded and executed by a processor to implement the steps of the stance-based summary generation method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Abstract generation method and device, electronic equipment and storage medium

    CN118535724A