Abstract generation method, device, electronic device and storage medium

By performing text segmentation, generalization deviation correction and information completion on film and television scripts, the problem of low accuracy in extracting abstracts of large language models is solved, more efficient summary generation is achieved, and review efficiency is improved.

CN118747213BActive Publication Date: 2024-11-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411110513.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-22
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

In the prior art, the accuracy of large language models in abstract extraction of film and television scripts is poor, resulting in inefficient review and understanding.

Method used

By performing summary generation and processing of the to be processed text, we can obtain the primary selection summary statements, perform summary deviation correction and information completion, and generate the final selection summary text to improve the accuracy of the summary.

Benefits of technology

It improves the accuracy of abstract extraction, reduces the reading burden of auditors, and improves the review efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747213B_ABST
    Figure CN118747213B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a summary generation method, device, electronic device and storage medium, including: performing summary generation processing on a text to be processed to obtain a preliminary summary text; segmenting the preliminary summary text to obtain a plurality of preliminary summary sentences; based on the text to be processed, performing summary deviation correction on each preliminary summary sentence to obtain a corresponding summary correction sentence; based on the plurality of summary correction sentences, determining a summary correction text; based on the text to be processed, performing information completion on the summary correction text to obtain a summary completion text; and determining a final summary text based on the summary completion text. In the embodiment of the present application, after obtaining the preliminary summary text, the preliminary summary text can be corrected for summary deviations and information completion to obtain a summary completion text, and then a final final summary text can be obtained based on the summary completion text to obtain a summary text with higher accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a summary generation method, device, electronic device and storage medium. Background Art

[0002] Summarizing text data can remove redundant or irrelevant details in the original text, focus on important information, and help readers quickly grasp the main content. For example, in the work of reviewing the script of a film or TV series, extracting a summary of the script can reduce the number of words that the reviewer needs to read and increase the review speed. In the existing technology, the script is often extracted by relying on a large language model.

[0003] However, large language models have poor accuracy in summarizing scripts. Summary of the invention

[0004] The embodiments of the present application provide a summary generation method, device, electronic device and storage medium, which can improve the problem of poor summary extraction accuracy in the prior art.

[0005] The embodiment of the present application provides a summary generation method, which includes: performing summary generation processing on a text to be processed to obtain a preliminary summary text; segmenting the preliminary summary text to obtain a plurality of preliminary summary sentences; based on the text to be processed, performing generalization deviation correction on each of the preliminary summary sentences to obtain a corresponding summary correction sentence; based on the plurality of summary correction sentences, determining a summary correction text; based on the text to be processed, performing information completion on the summary correction text to obtain a summary completion text; and determining a final summary text based on the summary completion text.

[0006] The present application embodiment provides a summary generation model training device, the device comprising:

[0007] A preliminary summary unit is used to perform summary generation processing on the text to be processed to obtain a preliminary summary text;

[0008] A text segmentation unit, used to segment the preliminary summary text to obtain a plurality of preliminary summary sentences;

[0009] A deviation correction unit, configured to correct the summary deviation of each of the preliminary selected summary sentences based on the text to be processed, to obtain a corresponding summary correction sentence;

[0010] A revised text unit, used to determine a summary revised text based on the plurality of summary revised sentences;

[0011] An information completion unit, configured to complete the information of the summary correction text based on the text to be processed to obtain a summary completion text;

[0012] The final summary unit is used to determine the final summary text based on the summary completion text.

[0013] In one embodiment, the final selection summary unit includes:

[0014] A completion text segmentation subunit is used to segment the summary completion text to obtain a plurality of summary completion sentences;

[0015] A deviation correction subunit is used to perform summary deviation correction on each summary completion sentence based on the text to be processed to obtain a corresponding summary completion correction sentence;

[0016] The final selected text subunit is used to determine the final selected summary text based on the multiple summary completion and correction sentences.

[0017] In one embodiment, the deviation correction unit includes:

[0018] A correction prompt subunit is used to fill the text to be processed and the preliminary summary sentence to be processed into a summary deviation correction prompt template to obtain the text to be corrected, wherein the text to be corrected is used to prompt the large language model to correct the generalization deviation of the preliminary summary sentence to be processed, and the preliminary summary sentence to be processed is any one of the multiple preliminary summary sentences;

[0019] The correction response subunit is used to input the text to be corrected into the large language model to obtain the text to be corrected understanding result output by the large language model in response to the text to be corrected, and the text to be corrected understanding result includes the summary correction sentence corresponding to the preliminary summary sentence to be processed.

[0020] In one embodiment, the information completion unit includes:

[0021] A completion prompt subunit is used to fill the text to be processed and the summary correction text into the information completion prompt template to obtain the text to be completed, wherein the text to be completed is used to prompt the large language model to complete the information of the summary correction text;

[0022] The completion response subunit is used to input the text to be completed into the large language model, and obtain the understanding result of the text to be completed output by the large language model in response to the text to be completed, and the understanding result of the text to be completed includes the summary completion text.

[0023] In one implementation, the preliminary summary unit is specifically configured to perform summary generation processing on the text to be processed using a trained summary generation model to obtain a preliminary summary text.

[0024] In one embodiment, the device further comprises:

[0025] A preliminary model acquisition unit is used to acquire a preliminary summary generation model, wherein the preliminary summary generation model is obtained by training a pre-trained summary generation model based on a training text and a fine screening label summary text corresponding to the training text, the training text corresponds to a coarse screening label summary text and a fine screening label summary text, the coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text;

[0026] A strategy model unit to be trained, used to generate a strategy model to be trained based on the model parameters of the preliminary summary generation model, wherein the model structure of the strategy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the strategy model to be trained are consistent with the preliminary summary generation model;

[0027] A first loss function unit is used to input the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determine a first loss function based on the first training result and the fine screening label summary text;

[0028] A second loss function unit is used to input the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determine a second loss function based on the second training result, the first training result, the coarse screening label summary text and the fine screening label summary text;

[0029] a total loss function unit, configured to determine a total loss function based on the first loss function and the second loss function;

[0030] The training completed model unit is used to update the model parameters of the to-be-trained strategy model based on the total loss function until convergence, so as to obtain a trained strategy model, wherein the trained strategy model is the trained summary generation model.

[0031] In one embodiment, the device further comprises:

[0032] A preliminary training summary unit is used to perform summary generation processing on a target training text to obtain a preliminary training summary text; wherein the target training text is any training text among the plurality of training texts;

[0033] A training intermediate text unit, used for performing information optimization processing on the preliminary selected training summary text to obtain a training intermediate text;

[0034] The fine screening summary text unit is used to determine the fine screening label summary text corresponding to the target training text based on the training intermediate text; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary training summary text, the training intermediate text.

[0035] In one embodiment, the training intermediate text includes a training summary correction text and a training summary completion text; accordingly, the training intermediate text unit includes:

[0036] A training segmentation subunit, used to segment the preliminary training summary text to obtain a plurality of preliminary training summary sentences;

[0037] A training correction subunit, configured to correct the generalization deviation of each of the preliminary selected training summary sentences based on the target training text to obtain a corresponding training summary correction sentence;

[0038] A training revision determination subunit, configured to determine a training summary revision text based on a plurality of the training summary revision sentences;

[0039] The information completion subunit is used to complete the information of the training summary correction text based on the target training text to obtain the training summary completion text.

[0040] In one embodiment, the fine screening summary text unit includes:

[0041] A completion segmentation subunit, used to segment the training summary completion text to obtain a plurality of training summary completion sentences;

[0042] A completion deviation correction subunit is used to perform summary deviation correction on each training summary completion sentence based on the target training text to obtain a corresponding training summary completion correction sentence;

[0043] The fine screening summary generation subunit is used to determine the fine screening label summary text corresponding to the target training text based on multiple training summary completion and correction sentences; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary training summary text, the training summary correction text, and the training summary completion text.

[0044] In one implementation, the preliminary summary text includes a plurality of generated words, and the plurality of generated words include the first generated word; accordingly, the preliminary summary unit includes:

[0045] The encoding subunit is used to encode the text to be processed to obtain encoding features;

[0046] A high-dimensional feature extraction subunit, used to extract high-dimensional features of the coding features to obtain high-dimensional matrix features;

[0047] An attention subunit, used for performing attention mechanism processing on the high-dimensional matrix features to obtain an attention processing result;

[0048] A slicing subunit, used for performing a slicing operation on the attention processing result to obtain a slicing processing result;

[0049] A first index subunit is used to obtain an index identifier corresponding to the slice processing result in a preset vocabulary, wherein the index identifier corresponding to the slice processing result in the preset vocabulary is a first index identifier;

[0050] The first index decoding subunit is used to decode the first index identifier to obtain a first generated word of the preliminary selected summary text.

[0051] In one embodiment, the preliminary summary text includes a plurality of generated words, the plurality of generated words include a non-first generated word, and the non-first generated word is any generated word except the first generated word; accordingly, the preliminary summary unit includes:

[0052] The identification high-dimensional sub-unit is used to extract the high-dimensional features of the index identification corresponding to the previous generated word, and obtain the identification high-dimensional matrix features;

[0053] The identification attention subunit is used to perform attention mechanism processing on the identification high-dimensional matrix features to obtain identification attention processing results;

[0054] A second index subunit is used to obtain an index identifier corresponding to the mark attention processing result in the preset vocabulary, wherein the index identifier corresponding to the mark attention processing result in the preset vocabulary is a second index identifier;

[0055] The second index decoding subunit is used to decode the second index identifier to obtain the non-first generated word of the preliminary selected summary text.

[0056] In the summary generation method provided in the embodiment of the present application, the text to be processed can be first subjected to summary generation processing to obtain a preliminary summary text. The preliminary summary text is then segmented according to sentences to obtain a plurality of preliminary summary sentences. For each of the plurality of preliminary summary sentences, based on the text to be processed, the summary deviation of the preliminary summary sentence is searched, and the summary deviation is corrected to obtain a corresponding summary correction sentence, and a plurality of summary correction sentences are obtained in total. Subsequently, a summary correction text is obtained based on the plurality of summary correction sentences. Based on the text to be processed, the summary correction text is then subjected to information completion processing to obtain a summary completion text. Finally, a final summary text is generated based on the summary completion text.

[0057] In an embodiment of the present application, after obtaining a preliminary summary text, the preliminary summary text can be corrected for generalization deviations and information can be supplemented to obtain a summary supplement text, and then the final summary text can be obtained based on the summary supplement text. The process of generalization deviation correction is used to correct the generalization deviations of the preliminary summary text relative to the text to be processed, and the process of information supplementation is used to supplement the information missing from the summary correction text relative to the text to be processed, so as to obtain a summary text with higher accuracy. The embodiment of the present application improves the accuracy of the summary extraction step. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1a It is a schematic diagram of an application scenario of the summary generation method provided in this application;

[0060] Figure 1b is a flowchart of a summary generation method provided in an embodiment of the present application;

[0061] Figure 1c A schematic structural block diagram of generating a preliminary summary text using a trained summary generation model is shown;

[0062] Figure 1d A schematic structural block diagram of training a strategy model to be trained is shown;

[0063] Figure 1e A flowchart of an implementation method of generating a script summary based on a script of a film or television work is shown;

[0064] Figure 1f A flowchart of another embodiment of generating a script summary based on a script of a film or television work is shown;

[0065] Figure 2 It is a flowchart of a method for generating a summary provided in a specific embodiment of the present application;

[0066] Figure 3 It is a structural schematic diagram of a summary generation model training device provided in one embodiment of the present application;

[0067] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0069] Embodiments of the present application provide a summary generation method, device, electronic device, and storage medium.

[0070] The summary generation model training device can be integrated into an electronic device, which can be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a desktop computer. The server can be a single server, or a server cluster or a cloud server composed of multiple servers.

[0071] In some embodiments, the summary generation model training device can also be integrated into multiple electronic devices. For example, the summary generation model training device can be integrated into multiple servers, and the summary generation method of the present application is implemented by multiple servers.

[0072] In some embodiments, the terminal may also be used as a server to implement part or all of the functions of the server.

[0073] For more information, please see Figure 1a The method provided in the embodiment of the present application may include: performing summary generation processing on the text to be processed to obtain a preliminary summary text; segmenting the preliminary summary text to obtain multiple preliminary summary sentences; based on the text to be processed, performing generalization deviation correction on each of the preliminary summary sentences to obtain a corresponding summary correction sentence; based on the multiple summary correction sentences, determining a summary correction text; based on the text to be processed, completing information on the summary correction text to obtain a summary completion text; and determining a final summary text based on the summary completion text.

[0074] In the above method, after obtaining the preliminary summary text, the preliminary summary text can be corrected for summary deviations and information can be supplemented to obtain a summary supplement text, and then the final summary text can be obtained based on the summary supplement text. The process of summarizing deviation correction is used to correct the summarizing deviations of the preliminary summary text relative to the text to be processed, and the process of information supplementation is used to supplement the missing information of the summary correction text relative to the text to be processed, so as to obtain a summary text with higher accuracy. The embodiment of the present application improves the accuracy of the summary extraction step.

[0075] The embodiments of the present application can be applied in a variety of application scenarios. For example, in the financial field, a summary of the financial report content can be generated; in the academic field, a summary of the paper can be generated; in the film and television field, a summary of the script can be generated, etc. Taking the generation of a summary of the script as an example, the embodiments of the present application can generate a concise plot summary for the text content of each scene of the script to help readers quickly understand the main content of the script. For example, for each scene of the input script, the scene script corresponding to each scene is input to obtain the corresponding plot summary. This process can serve all parties in the film and television field:

[0076] For script reviewers, the method provided in the embodiment of the present application can help script reviewers quickly understand and analyze the plot structure of film and television works, so as to score the plot, characters, novelty of events and other dimensions, thereby evaluating whether the script is suitable for filming, or arranging how to shoot;

[0077] For novelists and playwrights, the method provided in the embodiments of the present application can help them organize historical story lines during the creative process, so as to focus on the development process of various characters and events and improve creative efficiency.

[0078] For planners, the method provided in the embodiment of the present application can help planners quickly understand the main content of a large number of scripts during the planning stage of film and television works, thereby performing effective plot screening and decision-making.

[0079] For viewers who watch film and television works, the method provided in the embodiment of the present application can enable the audience to quickly preview the plot content, helping the audience to quickly filter the episodes they want to watch or locate the scenes of specific plots.

[0080] It is understandable that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0081] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0082] In this embodiment, a summary generation method is provided. Figure 1b As shown, the summary generation method is applied to an electronic device. The specific process of the method may include the following steps 110 to 160:

[0083] 110. Perform summary generation processing on the text to be processed to obtain a preliminary summary text.

[0084] The text to be processed is the text of the content to be extracted. Optionally, the text to be processed can be a text in a certain technical field. For example, the technical field can be the financial field, and the text to be processed can be a financial report; the technical field can also be the academic field, and the text to be processed can be a paper; the technical field can also be the film and television field, and the text to be processed can be a script. For the convenience of description, the following description takes the case where the text to be processed is a script in the film and television field as an example.

[0085] The script of a film and television drama can be divided into multiple scene scripts according to the scenes. The total number of scene scripts of a film and television drama ranges from thousands to tens of thousands. The number of words in each scene script ranges from dozens to thousands of words. Optionally, the above-mentioned text to be processed can be a scene script.

[0086] The summary generation process is a process of extracting summary content from the text to be processed. The specific process of the summary generation process will be described in detail below.

[0087] The preliminary summary text is the text composed of the summary contents obtained through preliminary screening.

[0088] Optionally, in one implementation, step 110 may specifically include: performing summary generation processing on the text to be processed using a trained summary generation model to obtain a preliminary summary text.

[0089] The summary generation process can be implemented by a trained summary generation model. Optionally, the preliminary summary text includes multiple generated words, and the multiple generated words are divided into the following two types: the first generated word and the non-first generated word. Among them, the non-first generated word is any generated word other than the first generated word. For example, it is assumed that the preliminary summary text has a total of i generated words, then any generated word among the second generated word, the third generated word..., and the i-th generated word is a non-first generated word. Different types of generated words have their own processing procedures.

[0090] For the first generated word of the preliminary summary text, the trained summary generation model can be generated by processing the following steps X1 to X6:

[0091] X1. Encode the text to be processed to obtain encoding features.

[0092] For more information, please see Figure 1c , the text to be processed can be input into the encoder of the trained summary generation model to obtain the encoding feature (1×p). Where p is the number of word segments to be processed, and the value of p can be set by the developer based on work experience. For example, p can be 15 or 20, and its specific value should not be understood as a limitation to this application.

[0093] Specifically, the encoding process includes: performing word segmentation on the text to be processed to obtain multiple subwords. If the number of the multiple subwords is greater than or equal to p, the first p subwords of the multiple subwords are intercepted; if the number of the multiple subwords is less than p, the missing parts are filled with preset characters.

[0094] For each of the p subwords, the preset vocabulary can be queried to obtain the index corresponding to each subword, thereby obtaining a 1×p matrix, which is the above-mentioned encoding feature. Among them, the preset vocabulary can be generated based on the training data set. For example, it is assumed that all the texts in the training data set can be used with 100,000 different words. Then, these 100,000 different words can be sorted in descending order according to the frequency of occurrence of the words, and the first r words are taken to form the preset vocabulary. r is a positive integer, and the value of r can be set by the developer based on work experience. For example, r can be 55,000 or 64,000. It should be understood that the specific value of r should not be understood as a limitation on this application.

[0095] For example, let p be 15 and the text to be processed be "This is a sample script for theplay.".

[0096] Perform word segmentation on the above text to be processed and get the word segmentation results ["This", "is", "a", "sample", "script", "for", "the", "play", "."]

[0097] Since the number of subwords corresponding to the above word segmentation result is 9, which is less than the p value of 15, the missing parts are filled with preset characters. Let's assume that the preset character is [PAD], then the filled results are: ["This", "is", "a", "sample", "script", "for", "the", "play", ".", "[PAD]", "[PAD]", "[PAD]", "[PAD]", "[PAD]", "[PAD]"]

[0098] Let's assume that the preset vocabulary has the following mapping relationship:

[0099] "This" ->123,

[0100] "is" ->45,

[0101] "a" ->67,

[0102] "sample"->890,

[0103] "script" ->456,

[0104] "for"->23,

[0105] "the" ->789,

[0106] "play" ->12,

[0107] "." ->4,

[0108] "[PAD]" -> 0,

[0109] Then we can get a 1×15 matrix based on the above mapping relationship as follows:

[0110] [123, 45, 67, 890, 456, 23, 789, 12, 4, 0, 0, 0, 0, 0, 0].

[0111] X2. Extract high-dimensional features of the encoding features to obtain high-dimensional matrix features.

[0112] Continuing with the above example, the encoded features can be input into the word embedding layer of the trained summary generation model to obtain a high-dimensional matrix feature (1×p×z). Specifically, in the word embedding layer, each of the p words can be embedded into a high-dimensional vector space, where z is the dimension of the vector space, for example, it can be 4096. It should be understood that the specific value of z should not be understood as a limitation of this application, and it can be set by the developer based on work experience.

[0113] X3. Perform attention mechanism processing on the high-dimensional matrix features to obtain attention processing results.

[0114] Continuing with the example above, we can input the high-dimensional matrix features into the multi-head self-attention module of the trained summary generation model to obtain the attention processing result (1×p×z). Compared with the high-dimensional matrix features, the attention processing result maintains the same dimension, but is processed by the attention mechanism.

[0115] The multi-head self-attention module may include Q+1 attention modules: module 0, module 1, module 2, ..., module Q. Multiple attention modules are stacked to form a Transformer encoder. Optionally, module 0, module 1, module 2, ..., module Q can all be DecoderLayer.

[0116] Optionally, in one implementation, the structure of DecoderLayer may be as shown in the following table:

[0117]

[0118] X4. Perform a slicing operation on the attention processing result to obtain a slicing processing result.

[0119] The specific process of the slicing operation is to extract the vector of a specific position from the attention processing result for subsequent processing. The above-mentioned specific position can be the first position of the encoded feature or a pre-marked position of the encoded feature. It should be understood that the specific position point of the above-mentioned specific position can be set by the developer based on work experience.

[0120] Continuing with the example above, by extracting the vector at a specific position from the attention processing result (1×p×z), we can get the slice processing result (1×1×z).

[0121] X5. Obtain an index identifier corresponding to the slice processing result in a preset vocabulary, wherein the index identifier corresponding to the slice processing result in the preset vocabulary is a first index identifier.

[0122] Continuing with the previous example, the slice processing result (1×1×z) is input into the language model head LmHead, which can map the z-dimensional vector to the probability distribution of the preset vocabulary (1×1×r), and select the word with the highest probability through the Argmax operation. The index mark corresponding to the word with the highest probability in the preset vocabulary is obtained, which is recorded as the first index mark (1×1). For details, see Figure 1c Optionally, the language model head LmHead may specifically be a fully connected layer.

[0123] X6. Decode the first index identifier to obtain the first generated word of the preliminary summary text.

[0124] Continuing with the above example, the first index identifier is input into the decoder of the trained summary generation model to obtain the first generated word.

[0125] For non-first generated words in the preliminary summary text, the generated words can be processed through the following steps Y1 to Y4:

[0126] Y1. Extract the high-dimensional features of the index identifier corresponding to the previous generated word to obtain the identifier high-dimensional matrix features.

[0127] The previous generated word is the previous generated word of the non-first generated word. Let the non-first generated word be the i-th generated word, where i is a positive integer greater than 1; then the previous generated word of the non-first generated word is the i-1-th generated word. For example, if i takes the value 2, the non-first generated word is the second generated word; accordingly, the previous generated word of the second generated word is the first generated word. If i takes the value 3, the non-first generated word is the third generated word; accordingly, the previous generated word of the third generated word is the second generated word... For the convenience of description, the following text may take the non-first generated word as the second generated word as an example.

[0128] For more information, please see Figure 1c , the index identifier corresponding to the previous generated word (i.e., the first generated word) of the second generated word can be input into the trained word embedding layer to obtain the identifier high-dimensional matrix feature (1×1×z). Specifically, in the word embedding layer, the first generated word can be embedded into a high-dimensional vector space.

[0129] Y2. Perform attention mechanism processing on the identification high-dimensional matrix features to obtain identification attention processing results.

[0130] Continuing with the example above, the identification high-dimensional matrix feature can be input into the multi-head self-attention module to obtain the identification attention processing result (1×1×z). Compared with the identification high-dimensional matrix feature, the identification attention processing result maintains the same dimension, but is processed by the attention mechanism.

[0131] Y3. Obtain the index identifier corresponding to the result of the identification attention processing in the preset vocabulary, wherein the index identifier corresponding to the result of the identification attention processing in the preset vocabulary is the second index identifier.

[0132] Continuing with the example above, the result of the attention processing (1×1×z) is input into the language model head LmHead, which can map the z-dimensional vector to the probability distribution of the preset vocabulary (1×1×r), and select the word with the highest probability through the Argmax operation to obtain the index of the word with the highest probability in the preset vocabulary, which is recorded as the second index (1×1). For details, see Figure 1c .

[0133] Y4. Decode the second index identifier to obtain a non-first generated word of the primary summary text.

[0134] Continuing with the above example, the second index identifier is input into the decoder of the trained summary generation model to obtain the second generated word.

[0135] In the above implementation, the first generated word of the preliminary summary text can be obtained through steps X1 to X6, and then steps Y1 to Y4 are iteratively executed to obtain the second generated word, the third generated word, ... until the preliminary summary text is generated. The above implementation can be implemented based on the trained summary generation model, which improves the summarization accuracy of the preliminary summary text.

[0136] Before the step of "using the trained summary generation model to perform summary generation processing on the text to be processed to obtain a preliminary summary text", a training process of the summary generation model is also included. Optionally, in one embodiment, the training process of the summary generation model may specifically include the following steps S1 to S6:

[0137] S1. Obtain the preliminary summary generation model.

[0138] The preliminary summary generation model is obtained by training the pre-trained summary generation model based on the training text and the fine-screened label summary text corresponding to the training text.

[0139] The pre-trained summary generation model is pre-trained based on a large-scale dataset.

[0140] The training text is: text data belonging to the same technical field as the text to be processed. Continuing with the above example, if the text to be processed is a scene script, then the training text is also a scene script.

[0141] The training text corresponds to a coarse screening label summary text and a fine screening label summary text. The coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text. The generation process of the coarse screening label summary text and the fine screening label summary text corresponding to the training text will be described in detail below.

[0142] Optionally, in one embodiment, the pre-trained summary generation model is trained based on the training text and the corresponding fine-screened label summary text to obtain the preliminary summary generation model, and the process specifically includes the following steps C1 to C2:

[0143] C1. Input the training text into the pre-training summary generation model to obtain the training summary text output by the pre-training summary generation model.

[0144] Optionally, in one implementation, the data format of the training data consisting of the training text and the fine-screened label summary text corresponding to the training text may be as follows:

[0145] {"id": "999" , "conversations":[

[0146] {"from":"template","value":"The following is a script of a scene in a play. Please extract the plot summary of this scene and describe the specific events that happened in the scene. Do not make guesses or abstract descriptions. The script is aaaa "},

[0147] {"from":"LLM","value":"bbbb "}

[0148] ]}

[0149] Among them, the above "999" represents the serial number of the training data, the above "aaaa" is used to fill in the training text, and the above "bbbb" is used to fill in the fine-screened label summary text corresponding to the training text.

[0150] C2. According to the difference between the training summary text and the fine-screened label summary text, the model parameters of the pre-trained summary generation model are updated, and the process jumps to step: inputting the training text into the pre-trained summary generation model to obtain the training summary text output by the pre-trained summary generation model, until the difference between the training summary text and the fine-screened label summary text meets the set requirements, or the number of jumps reaches the jump threshold, and a preliminary summary generation model is obtained.

[0151] The difference between the training summary text and the fine-screened label summary text may be a loss function, and accordingly, satisfying the set requirements may be: minimizing the loss function. The loss function may specifically be a cross entropy loss.

[0152] Optionally, the above loss function can be shown as formula (1):

[0153] (1)

[0154] in, is the first loss function; N is the number of words in the preset vocabulary, and its value is r. For the convenience of description, let r=64000. N is 64000. is the one-hot tag of the word, indicating: i When the word is the word at the set position among 64,000 words, Take 1; otherwise, Take 0. The above-mentioned word at the set position is preset. It is assumed that the word at the set position refers to the 100th word among 64,000 words. If i =100, Take 1; if i ≠100, Take 0. For the i The probability value corresponding to the word.

[0155] The jump threshold is a critical value of the jump number. If the jump number is less than the jump threshold, continue to jump to the step: input the training text into the pre-trained summary generation model, obtain the training summary text output by the pre-trained summary generation model, and repeat the iterative process; if the jump number is greater than or equal to the jump threshold, the summary generation model after the current model parameters are updated can be output as the preliminary summary generation model.

[0156] Optionally, in the above training process, G training data can be performed, wherein each of the G training data includes training text and corresponding fine-screened label summary text. Optionally, for the G training data, bs samples that have not been learned can be randomly selected for batch training. Repeat the above extraction process until each of the G training data has been traversed once, thereby completing one epoch of iteration. Perform multiple rounds of iterations until the average loss value no longer decreases in a certain round or until the iteration round reaches a preset round threshold. The average loss value is the average of the loss values ​​of each batch in the current round. The preset round threshold is a preset threshold, and its value can be set by the developer based on work experience.

[0157] In the learning process of each batch, the training process specifically includes the following:

[0158] (1) Obtain training data.

[0159] (2) For each training sample in the batch of samples, input the text content in the "value" of "from":"template" into the pre-trained summary generation model, obtain the output of the pre-trained summary generation model, and generate response text, which is the training summary text.

[0160] (3) Compare the training summary text with the "value" summary text of "from":"LLM" in the sample and calculate the loss.

[0161] (4) The total loss is passed back to the pre-trained summary generation model to calculate the gradients of each network parameter.

[0162] (5) Based on the above-mentioned network parameter gradients, update the parameters of the pre-trained summary generation model.

[0163] In the above implementation, the pre-trained summary generation model can be trained using the training summary text and the fine-screened label summary text corresponding to the training summary text to obtain a preliminary summary generation model with more targeted output results, thereby maximizing the accuracy of the model output summary.

[0164] S2. Generate a strategy model to be trained based on the model parameters of the preliminary summary generation model, wherein the model structure of the strategy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the strategy model to be trained are consistent with the preliminary summary generation model.

[0165] The model structures of the strategy model to be trained, the preliminary summary generation model and the pre-trained summary generation model are consistent. The model parameter values ​​of the preliminary summary generation model can be assigned to the model parameters of the corresponding positions of the pre-trained summary generation model to obtain the strategy model to be trained. Figure 1d .

[0166] S3. Input the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determine a first loss function based on the first training result and the fine-screened label summary text.

[0167] The first training result is the training result obtained by the strategy model to be trained performing summary generation processing on the training text. The first loss function determined based on the first training result and the fine-screened label summary text can be the same as formula (1), which will not be described in detail here.

[0168] S4. Input the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determine a second loss function based on the second training result, the first training result, the coarse screening label summary text, and the fine screening label summary text.

[0169] The second training result is a training result obtained by the preliminary summary generation model performing summary generation processing on the same training text. The second loss function can be determined based on the second training result and the first training result, the coarse screening label summary text, and the fine screening label summary text.

[0170] Optionally, the coarse-screened label summary text and the fine-screened label summary text may form direct preference optimization (DPO) training data. Optionally, the format of the DPO training data may be as follows:

[0171] {

[0172] "prompt": "The following is a script of a scene in a play. Please extract the plot summary of this scene and describe the specific events that happened in the scene. Do not make guesses or abstract descriptions. The script is aaaa", "prompt_id": "0001",

[0173] "chosen" : [{"content":"The following is a script for a scene in a play. Please extract the plot summary of this scene and describe the specific events that happened in the scene. Do not make guesses or make abstract descriptions. The script is aaaa", "role": "user"}, {"content":"high-quality", "role": "assistant"}], "

[0174] rejected ": [{"content": "The following is a script of a scene in a play. Please extract the plot summary of this scene and describe the specific events that happened in the scene. Do not make guesses or abstract descriptions. The script is aaaa", "role": "user"}, {"content":"low quality", "role": "assistant"}],

[0175] }

[0176] Among them, the above "prompt_id" indicates the serial number of the DPO training data; the above "aaaa" is used to fill in the training text; the above "high-quality" is used to fill in the fine screening label summary text; the above "low-quality" is used to fill in the coarse screening label summary text. The loss is calculated by the second training result output by the preliminary summary generation model and the first training result, the coarse screening label summary text and the fine screening label summary text.

[0177] Optionally, in one implementation, the second loss function is as shown in formula (2):

[0178] (2)

[0179] in, is the second loss function; x For training text; Represents the strategy model to be trained; represents the preliminary summary generation model; Represents the fine sieve label summary text; Indicates the rough screening label summary text; , These are hyperparameters, and their specific values ​​can be adjusted by developers based on actual needs.

[0180] S5. Determine a total loss function based on the first loss function and the second loss function.

[0181] Continuing with the example above, the total loss function can be expressed as formula (3):

[0182] (3)

[0183] in, is the total loss function, is the first loss function calculated by formula (1), is the second loss function calculated by formula (2), is the weight of the first loss function, is the weight of the second loss function. The value can be less than .For example, The value can be 0.01. The value can be 1.

[0184] S6. Based on the total loss function, update the model parameters of the strategy model to be trained until convergence, to obtain a trained strategy model, where the trained strategy model is the trained summary generation model.

[0185] Optionally, based on the total loss function, the model parameters of the strategy model to be trained can be updated, and the process jumps to step S3 until the total loss function is minimized to obtain a trained strategy model, which is recorded as a trained summary generation model.

[0186] In the above implementation, the first loss function is introduced when calculating the total loss function. In addition to using the second loss function to compare different output preferences, the first loss function is used to align the current best summary. However, since the current best summary is not necessarily the most accurate summary, the weight of the first loss function is controlled to be small, which is 0.01. As a regularizer, it tries to find a more accurate summary method under the premise of taking the current best summary as the training target, so that the model can improve its ability to identify better summary results with minimal modification, and reduce the possibility of introducing new errors, which is conducive to producing a better summary generation model.

[0187] Optionally, in one embodiment, before step S1, the embodiment of the present application may further include a process of obtaining a fine screening label summary text and a coarse screening label summary text corresponding to the training text. The process may specifically include the following steps A1 to A3:

[0188] A1. Perform summary generation processing on the target training text to obtain a preliminary training summary text.

[0189] The target training text is any one of the plurality of training texts. The preliminary selected training summary text is a summary text with low summary accuracy of the target training text.

[0190] The process of summarizing the target training text can be achieved using large language models. Large language models (LLMs) refer to machine learning models with a large number of parameters. These models are trained on large data sets and can understand and generate human language. These models usually use deep learning architectures and are characterized by having millions to billions or even more parameters. Specifically, large language models can be GPT-4, LLaMA, Turing NLG, Qianwen, etc.

[0191] Optionally, the target training text may be filled into the question prompt template to obtain the text to be initially selected, and the text to be initially selected may be input into the large language model to obtain the initial training summary text output by the large language model.

[0192] In one implementation, the question prompt template may be: "The following is a scene from a film or TV drama script. Please return to the plot summary. The summary requires that the characters be called by their names, the events be described directly, and no abstract generalizations be used. The script is: xyz." The "xyz" is used to fill in the target training text.

[0193] A2. Performing information optimization processing on the preliminary selected training summary text to obtain a training intermediate text.

[0194] The training intermediate text summarizes the target training text more accurately than the preliminary training summary text. Optionally, the training intermediate text may include a training summary correction text and a training summary completion text. Accordingly, step A2 may specifically include the following steps A21 to A24:

[0195] A21. Segment the preliminary training summary text to obtain a plurality of preliminary training summary sentences.

[0196] Optionally, the preliminary training summary text may be segmented according to punctuation marks that indicate the end of a sentence. The punctuation marks that indicate the end of a sentence include: a period ".", an exclamation mark "!", a question mark "?", an ellipsis "...", etc. The preliminary training summary text may be searched for the punctuation marks that indicate the end of a sentence, and the text segmentation may be implemented based on the punctuation marks.

[0197] A22. Based on the target training text, correct the generalization deviation of each of the preliminary selected training summary sentences to obtain a corresponding training summary corrected sentence.

[0198] The above-mentioned correction of summarization deviation is to correct the summarization deviation of the preliminary training summary sentence relative to the target training text.

[0199] The specific process of generalization deviation correction may include: filling the target training text and the preliminary training summary sentence into the generalization deviation correction prompt template to obtain the training text to be corrected. The training text to be corrected is used to prompt the large language model to correct the generalization deviation of the preliminary training summary sentence; the training text to be corrected is input into the large language model to obtain the understanding result of the training text to be corrected output by the large language model, and the understanding result of the training text to be corrected includes the training summary correction sentence.

[0200] A23. Determine a training summary correction text based on the plurality of training summary correction sentences.

[0201] A24. Based on the target training text, the training summary correction text is supplemented to obtain a training summary supplement text.

[0202] The above-mentioned information completion is to complete the missing information of the training summary correction text relative to the target training text.

[0203] The specific process of information completion may include: filling the training summary correction text and the target training text into the information completion prompt template to obtain the training text to be completed. The training text to be completed is used to prompt the large language model to complete the information of the training summary correction text. The training text to be completed is input into the large language model to obtain the understanding result of the training text to be completed output by the large language model, and the understanding result of the training text to be completed includes the training summary completion text.

[0204] A3. Based on the training intermediate text, determine the fine screening label summary text corresponding to the target training text; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary selection training summary text, the training intermediate text.

[0205] The training intermediate text can be further optimized to obtain a fine-screened label summary text. Correspondingly, the coarse-screened label summary text can be any of the following: a preliminary training summary text, a training intermediate text. Since the training intermediate text includes a training summary correction text and a training summary completion text, the coarse-screened label summary text can be any of the following: a preliminary training summary text, a training summary correction text, and a training summary completion text.

[0206] Optionally, in one implementation, step A3 may specifically include the following steps A31 to A33:

[0207] A31. Segment the training summary completion text to obtain a plurality of training summary completion sentences.

[0208] Optionally, the training summary completion text may be segmented according to punctuation marks that indicate the end of a sentence. The punctuation marks that indicate the end of a sentence include: a period ".", an exclamation mark "!", a question mark "?", an ellipsis "...", etc. The training summary completion text may be searched for the punctuation marks that indicate the end of a sentence, and the text may be segmented based on the punctuation marks to obtain a plurality of training summary completion sentences.

[0209] A32. Based on the target training text, perform generalization deviation correction on each training summary completion sentence to obtain a corresponding training summary completion correction sentence.

[0210] A33. Determine a fine-screened label summary text corresponding to the target training text based on the plurality of training summary completion and correction sentences.

[0211] Step A32 to step A33 correspond to step A22 to step A23, and will not be repeated here.

[0212] In the above implementation, after obtaining the training summary completion text, it can continue to be processed for generalization deviation correction: first, the training summary completion text is divided into multiple training summary completion sentences; then, based on the target training text, each training summary completion sentence is corrected for generalization deviation to obtain the corresponding training summary completion correction sentence, thereby obtaining multiple training summary completion correction sentences; then, the multiple training summary completion correction sentences are combined to obtain a fine-screened label summary text. In the above implementation, by further generalization deviation correction processing of the training summary completion text, the generalization accuracy of the obtained result can be made higher, which is conducive to improving the efficiency of model training.

[0213] The above process of obtaining the fine-screened label summary text and the coarse-screened label summary text corresponding to the training text can be applied to highly professional technical fields, thereby facilitating the construction of training data sets in the technical fields. Highly professional technical fields often lack relevant open source training data. Compared with manually annotating and generating training data sets, the above acquisition process improves efficiency and saves labor costs. The above highly professional technical fields include: film and television fields, academic fields, etc.

[0214] 120. Segment the preliminary summary text to obtain a plurality of preliminary summary sentences.

[0215] Optionally, the preliminary summary text may be segmented according to punctuation marks that indicate the end of a sentence. The punctuation marks that indicate the end of a sentence include: a period ".", an exclamation mark "!", a question mark "?", an ellipsis "...", etc. The preliminary summary text may be searched for the punctuation marks that indicate the end of a sentence, and the text may be segmented based on the punctuation marks to obtain a plurality of preliminary summary sentences.

[0216] 130. Based on the text to be processed, correct the summary deviation of each of the preliminary selected summary sentences to obtain a corresponding summary correction sentence.

[0217] The correction of the generalization deviation in this step refers to correcting the generalization deviation of the preliminary summary sentence relative to the text to be processed. Optionally, in one embodiment, the specific process of the correction of the generalization deviation may include the following steps 131 to 132:

[0218] 131. Fill the text to be processed and the preliminary summary sentence to be processed into a summary deviation correction prompt template to obtain the text to be corrected.

[0219] The text to be corrected is used to prompt the large language model to correct the profile deviation of the preliminary summary sentence to be processed. The preliminary summary sentence to be processed is any preliminary summary sentence among the multiple preliminary summary sentences.

[0220] The summary deviation correction prompt template is a pre-set prompt template, which has at least two vacancies, and the two vacancies correspond to the text to be processed and the preliminary summary sentence to be processed.

[0221] For example, in one embodiment, the summary deviation correction prompt template may be:

[0222] "There is a script, and a plot description statement is provided for the script. The plot description statement may be correct or wrong. Please follow the standard and the content of the script to determine the problems in the plot description statement, and then generate a correct plot description statement after modification. Please output it according to the format. Script: xxx. Description statement: xx. Format: {"After modification": xxxx}."

[0223] The above "xxx" is used to fill in the text to be processed, and the above "xx" is used to fill in the summary sentence of the preliminary selection to be processed. After "xxx" and "xx" are filled with the text to be processed and the summary sentence of the preliminary selection to be processed respectively, the text to be corrected can be obtained. It should be understood that the above summary deviation correction prompt template is only an exemplary description, and the summary deviation correction prompt template can also include more or less text.

[0224] In addition to the two vacancies for filling in the text to be processed and the preliminary summary sentence to be processed, the summary deviation correction prompt template may also include a vacancies for filling in the summary deviation type. For example, in another embodiment, the summary deviation correction prompt template may be:

[0225] "There is a script, and a description of the plot in the script is provided. The description may be right or wrong. Please follow the standard and the content of the script to determine the problems in the description, give the reasons, and then generate a correct description after modification. Please output according to the format. Script: xxx. Description: xx. Summary deviation type: yyyy. Format: {"Description": xx, "Reason": yyy, "Summary deviation type": x, "After modification": xxxx}."

[0226] The generalization deviation type refers to the type of generalization deviation of the preliminary summary sentence to be processed relative to the text to be processed. The specific type of generalization deviation type can be set by the developer based on work experience. For example, the generalization deviation type may include: plot inconsistency, broad generalization, fabrication, large-scale repetition, and accuracy.

[0227] Plot inconsistency means that the plot corresponding to the sentence in the preliminary summary to be processed does not match the plot of the text to be processed. For example, it includes: (1) the time and place are inconsistent with the script, (2) the character behavior is inconsistent with the script, (3) the correspondence between the role and the behavior is inconsistent with the script, (4) the personal pronouns are used incorrectly, such as "he" refers to women and "she" refers to men, and (5) the timeline of the plot events is wrong, such as in the script: event A occurs before event B, and the sentence in the preliminary summary to be processed is described as: event A occurs after event B.

[0228] Broad summary means that the event description is too broad, so that the information is less. For example, in the script, character A and character B discuss the plot of taking medicine for illness, and the summary sentence to be processed is described as: character A and character B interact and talk.

[0229] Creation out of thin air means that the things that are not mentioned in the script appear in the summary of the preliminary selection to be processed. For example, the characters, events or viewpoints that are not mentioned in the script appear in the summary of the preliminary selection to be processed.

[0230] Large repetition refers to: there are large repetitive descriptions in the preliminary summary to be processed.

[0231] Accuracy means that there is no deviation in the summary of the preliminary summary compared with the script.

[0232] Among them, the above "xxx" is used to fill in the text to be processed, the above "xx" is used to fill in the preliminary summary sentence to be processed, and the above "yyyy" is used to fill in all the generalization deviation types, so that the large language model can select the generalization deviation type corresponding to the preliminary summary sentence to be processed. Taking the above description as an example, "yyyy" can be filled in: "inconsistent with the plot, broad generalization, fabricated, repeated in large sections, accurate".

[0233] After "xxx", "xx" and "yyyy" are filled with the text to be processed, the preliminary summary sentences to be processed and all the summarized deviation types respectively, the text to be corrected can be obtained.

[0234] 132. Input the text to be revised into the large language model, and obtain a result of understanding the text to be revised that is output by the large language model in response to the text to be revised.

[0235] The text understanding result to be revised includes the summary revision sentence corresponding to the preliminary summary sentence to be processed.

[0236] Continuing with the example above, in the format: {"After modification": xxxx}.", "xxxx" is used to fill in the summary revision statement.

[0237] Optionally, in one implementation, the text understanding result to be corrected may further include a profile deviation type, where the profile deviation type refers to a category to which the profile deviation belongs.

[0238] Continuing with the example above, in the format: {"Description statement": xx, "Reason": yyy, "Summary deviation type": x, "After modification": xxxx}, "xx" is used to fill in the preliminary summary statement to be processed, "x" is used to fill in: a summary deviation type determined by the large model from all summary deviation types, "yyy" is used to fill in: the basis for the large model to determine the summary deviation type, and "xxxx" is used to fill in the summary correction statement.

[0239] The following is an example of a specific script:

[0240] There is a script (corresponding to the text to be processed) as follows:

[0241] [The scene begins with Zhang San and Li Si having a heated discussion in the living room.]

[0242] Zhang San (firmly): We must think carefully, this election is crucial to us.

[0243] Li Si (somewhat hesitant): But I think we need more time to weigh the pros and cons.

[0244] [The door opens, Wang Wu walks into the room and sees Zhang San and Li Si discussing something. He nods slightly and walks to the table and sits down.]

[0245] For this script, there is a pending preliminary summary statement as follows:

[0246] "Zhang San, Li Si and Wang Wu were discussing in the room who should run in the election."

[0247] The following is a template for outlining the bias correction prompt:

[0248] "There is a script, and a description of the plot in the script is provided. The description may be right or wrong. Please follow the standard and the content of the script to determine the problems in the description, give the reasons, and then generate a correct description after modification. Please output according to the format. Script: xxx. Description: xx. Summary deviation type: yyyy. Format: {"Description": xx, "Reason": yyy, "Summary deviation type": x, "After modification": xxxx}."

[0249] Then, the text to be processed, the summary sentence to be processed, and all the summary deviation types can be sequentially filled into the "xxx", "xx", and "yyyy" of the summary deviation correction prompt template to obtain the text to be corrected as follows:

[0250] "There is a script, and a plot description statement is provided. The plot description statement may be right or wrong. Please judge the problems of the plot description statement according to the standard and the content of the script, give the reasons, and then generate a correct plot description statement after modification. Please output it according to the format. Script: [The scene begins with Zhang San and Li Si having a heated discussion in the living room.] Zhang San (firmly): We must think it through. This election is crucial to us. Li Si (somewhat hesitant): However, I think we need more time to weigh the pros and cons. [The door was pushed open, Wang Wu walked into the room and saw Zhang San and Li Si discussing. He nodded slightly and walked to the table and sat down.] Description statement: Zhang San, Li Si, and Wang Wu were discussing who would participate in the election in the room. Generalization deviation type: plot inconsistency, broad generalization, fabrication, large-scale repetition, accurate. Format: {"Description statement": xx, "reason": yyy, "Generalization deviation type": x, "modified": xxxx}."

[0251] The above text to be corrected is input into the large language model. The understanding result of the text to be corrected output by the large language model can be obtained, and the understanding result of the text to be corrected is:

[0252] {“Descriptive sentence”: Zhang San, Li Si, and Wang Wu were discussing in the room who should participate in the election, “Reason”: Zhang San and Li Si were in the room, Wang Wu had just entered the room and had not yet joined the discussion, “Generalization bias type”: does not match the plot, “After modification”: Zhang San and Li Si were discussing in the room who should participate in the election, Wang Wu entered the room and sat down at the table}.

[0253] Optionally, in one implementation, step 132 may specifically include the following two steps 1321 to 1323:

[0254] 1321. Input the text to be corrected into a large language model to obtain a target summary deviation type corresponding to the preliminary summary sentence to be processed output by the large language model, and a basis for the target summary deviation type.

[0255] In this embodiment, the text to be corrected may be:

[0256] "There is a script, and a plot description sentence of the script is provided. The plot description sentence may be right or wrong. Please judge the problems of the plot description sentence according to the standard, give the basis, and output it according to the format. Script: [The scene begins with Zhang San and Li Si having a heated discussion in the living room.] Zhang San (firmly): We must think it over, this election is crucial to us. Li Si (somewhat hesitant): However, I think we need more time to weigh the pros and cons. [The door was pushed open, Wang Wu walked into the room, and saw Zhang San and Li Si discussing. He nodded slightly and walked to the table and sat down.] Description sentence: Zhang San, Li Si, and Wang Wu were discussing who would participate in the election in the room. Generalization deviation type: plot inconsistency, broad generalization, fabrication, large-scale repetition, accuracy. Format: {"Description sentence": xx, "reason": yyy, "Generalization deviation type": x}"

[0257] The large language model may output the target summary deviation type corresponding to the preliminary summary sentence to be processed and the basis of the target summary deviation type in the following format.

[0258] {“Descriptive sentence”: Zhang San, Li Si, and Wang Wu are discussing in the room who should participate in the election; “Reason”: Zhang San and Li Si are in the room, Wang Wu has just entered the room and has not yet joined the discussion; “Generalization bias type”: does not match the plot}.

[0259] 1322. Fill the text to be processed, the preliminary summary sentence to be processed, the target summary deviation type, and the basis of the target summary deviation type into a second correction prompt template to obtain a second text to be corrected.

[0260] Continuing with the above example, the second correction prompt template can be:

[0261] "There is a script, and a description statement of the plot that occurs in the script is provided. It is known that the plot description statement has a generalization deviation, and the generalization deviation type is zzz. Please return a correct plot description statement after modification. Please output it according to the format. Script: xxx. Description statement: xx. Generalization deviation type: x. Reason: yyy. Format: {"Description statement": xx, "Generalization deviation type": zzz, "After modification": xxxx}".

[0262] The text to be processed, the summary sentence to be processed, the target summary deviation type, and the basis of the target summary deviation type are filled into the second correction prompt template, and the second text to be corrected can be obtained as follows:

[0263] "There is a script, and a description of the plot in the script is provided. It is known that the description of the plot has a generalization deviation, and the type of generalization deviation is inconsistent with the plot. Please return a correct description of the plot after modification, and please output it according to the format. Script: [The scene begins with Zhang San and Li Si having a heated discussion in the living room.] Zhang San (firmly): We must think carefully, this election is crucial to us. Li Si (somewhat hesitant): However, I think we need more time to weigh the pros and cons. [The door was pushed open, Wang Wu walked into the room, and saw Zhang San and Li Si were discussing. He nodded slightly and walked to the table and sat down.] Description sentence: Zhang San, Li Si, and Wang Wu were discussing who would participate in the election in the room. Generalization deviation type: inconsistent with the plot. Reason: Zhang San and Li Si were in the room, and Wang Wu had just entered the room and had not yet participated in the discussion. Format: {"Description sentence": xx, "Generalization deviation type": zzz, "After modification": xxxx}".

[0264] 1323. Input the second text to be revised into the large language model to obtain a text to be revised understanding result output by the large language model in response to the text to be revised.

[0265] Continuing with the above example, the second text to be corrected obtained in step 1322 is input into the large language model to obtain the understanding result of the text to be corrected output by the large language model. The understanding result of the text to be corrected is output in the following format:

[0266] {“Descriptive sentence”: Zhang San, Li Si, and Wang Wu were discussing in the room who should participate in the election, “Generalization bias type”: does not match the plot, “After modification”: Zhang San and Li Si were discussing in the room who should participate in the election, and Wang Wu came in and sat down at the table}.

[0267] In the above implementation, by seeking output results from the large language model in segments, the understanding cost of the large language model for a single input can be reduced, thereby improving the accuracy of the output results of the large language model.

[0268] The above steps 131 to 132 may be performed on each of the multiple preliminary summary sentences to obtain multiple summary revision sentences.

[0269] 140. Determine a summary revision text based on the plurality of summary revision sentences.

[0270] There are many ways to obtain a summary correction text based on multiple summary correction sentences. For example, multiple summary correction sentences can be spliced ​​to obtain a summary correction text; multiple summary correction sentences can also be filled into a preset template, and multiple summary correction sentences and the preset template are combined to form a summary correction text. Compared with the preliminary summary text, the summary correction text has corrected the deviations in the summary.

[0271] In the above implementation, the summarization accuracy of the preliminary summary text is optimized by identifying the type of summarization deviation and correcting the summarization deviation sentence by sentence of the preliminary summary text.

[0272] Optionally, in one implementation, the preliminary summary text may not be segmented, and the preliminary summary text may be directly processed for profile deviation correction to obtain a summary correction text, thereby further improving the efficiency of deviation correction.

[0273] 150. Based on the text to be processed, complete the information of the summary correction text to obtain a summary completion text.

[0274] The above-mentioned information completion is to complete the missing information of the summary correction text relative to the text to be processed. Optionally, in one embodiment, step 150 may specifically include the following steps 151 to 152:

[0275] 151. Fill the text to be processed and the summary correction text into an information completion prompt template to obtain the text to be completed.

[0276] The text to be completed is used to prompt the large language model to complete the information of the summary correction text.

[0277] The information completion prompt template is a preset prompt template. The information completion prompt template has at least two vacancies, and the two vacancies correspond to the text to be processed and the summary correction text respectively.

[0278] For example, in one implementation, the information completion prompt template may be:

[0279] "There is a script, and a plot summary of the script is provided. The plot summary may be correct or wrong. Please compare the script and the plot summary, find out the missing people or objects in the plot summary, separate them with commas, and add the missing people or objects to the original plot summary. It is required to retain the main information of the original plot summary and make minimal modifications, and be faithful to the original text. Please output according to the format. Script: xxx. Summary: z. Format: {"Missing people or objects": zzzz, "New summary": zzzzz}".

[0280] The above "xxx" is used to fill in the text to be processed, and the above "z" is used to fill in the summary correction text. After "xxx" and "z" are filled with the text to be processed and the summary correction text respectively, the text to be completed can be obtained. It should be understood that the above information completion prompt template is only an exemplary description, and the information completion prompt template can also include more or less text.

[0281] 152. Input the text to be completed into a large language model to obtain a text to be completed understanding result output by the large language model in response to the text to be completed, wherein the text to be completed understanding result includes the summary completion text.

[0282] In addition to the summary completion text, the to-be-completed text understanding results can also include missing entities. Missing entities refer to entities that are missing from the summary correction text relative to the to-be-processed text. Missing entities include missing people or objects.

[0283] Continuing with the example above, in the format: {"missing person or thing": zzzz,"new summary": zzzzz}, "zzzz" is used to fill in the missing entity, and "zzzzz" is used to fill in the summary completion text.

[0284] The following is an example of a specific script:

[0285] There is a script (corresponding to the text to be processed) as follows:

[0286] [The scene begins with the mother sitting beside the hospital bed, her son lying on the bed, and the medicine dripping slowly from the IV stand.]

[0287] Mother (looking at her son with concern): The doctor said you must take your medicine on time so that you can get better quickly.

[0288] Son (frown): But Mom, I really don’t want to take those medicines, they make me feel worse.

[0289] Mother (gently stroking her son's hand): I know it's not easy, but if you don't take medicine, the condition may become more serious.

[0290] [Mom noticed that the medicine on the IV stand was still dripping slowly, so she stood up and walked to the IV stand to check it.]

[0291] Mother (looking at the IV): Look, the medicine in the IV is also helping you fight the disease. We can't give up treatment.

[0292] Son (looking up at his mother): But I feel really uncomfortable. I feel dizzy every time after taking the medicine.

[0293] Mom (softly comforting): I know, honey, but this is temporary. The doctor said these side effects will pass soon. Just think, if we stick with it, you can go home sooner.

[0294] For this purpose, there is a summary revision text as follows:

[0295] "A mother and her son were discussing in the ward whether or not to take medicine when sick."

[0296] The information completion prompt template is as follows:

[0297] "There is a script, and a plot summary of the script is provided. The plot summary may be correct or incorrect. Please compare the script and the plot summary, find out the missing people or objects in the plot summary, separate them with commas, and add the missing people or objects to the original plot summary. It is required to keep the main information of the original plot summary and make minimal changes, and be faithful to the original text. Please output according to the format. Script: xxx. Summary: z. Format: {"Missing people or objects": zzzz, "New summary": zzzzz}"

[0298] Then the text to be processed and the summary correction text can be filled into the "xxx" and "z" of the information completion prompt template in sequence, and the text to be completed is as follows:

[0299] "There is a script, and a plot summary of the script is provided. The plot summary may be correct or incorrect. Please compare the script and the plot summary, find out the missing people or objects in the plot summary, separate them with commas, and add the missing people or objects based on the original plot summary. It is required to keep the main information of the original plot summary and make minimal changes. It must be faithful to the original text. Please output according to the format. Script: [The scene begins with the mother sitting beside the bed, the son lying on the bed, and the medicine on the drip stand dripping slowly.] Mother (looking at her son with concern): The doctor said you must take the medicine on time so that you can get better quickly. Son (frown): But mom, I really don’t want to take those medicines. They make me feel worse. Mom (gently stroking her son’s hand): I know this It's not easy, but the condition may become more serious if you don't take the medicine. [The mother noticed that the medicine on the drip stand was still dripping slowly, so she got up and walked to the drip stand and checked it.] Mother (looking at the drip): You see, the medicine in the drip is also helping you fight the disease, we can't give up treatment. Son (looking up at his mother): But I really feel uncomfortable, and I feel dizzy every time I take the medicine. Mother (softly comforting): I know, baby, but this is temporary. The doctor said that these side effects will pass soon. Think about it, if we stick to it, you can go home earlier. Abstract: Mother and son discussed in the ward whether to take medicine when they are sick. Format: {"missing person or thing": zzzz,"new abstract": zzzzz}"

[0300] The above text to be completed is input into the large language model. The understanding result of the text to be completed output by the large language model can be obtained, and the understanding result of the text to be completed is:

[0301] {“Missing people or things”: hospital bed, medicine, “New summary”: Mother and son are discussing in the ward whether to take medicine when sick, and medicine is dripping from the IV stand beside the bed}.

[0302] Among them, the above-mentioned “missing person or thing” corresponds to the missing entity, and the above-mentioned “new summary” corresponds to the summary completion text.

[0303] In one implementation, the summary completion text can be used as a new summary correction text and substituted into step 151 to perform iteration, and after multiple rounds of iterations, the summary completion text is finally output. The value of the number of iterations can be set by the developer based on work experience, for example, the value of the number of iterations can be 3 or 5; it should be understood that the specific value of the number of iterations should not be understood as a limitation of the present application.

[0304] In the above implementation, through iterative multiple comparisons, missing persons or events are identified and missing information is gradually supplemented, thereby improving the information density of the summary completion text.

[0305] 160. Determine a final summary text based on the summary completion text.

[0306] The final selected summary text is a summary text of the text to be processed with a high accuracy profile. Optionally, in one implementation, step 160 may specifically include the following steps 161 to 163:

[0307] 161. Segment the summary completion text to obtain multiple summary completion sentences.

[0308] 162. Based on the text to be processed, perform summary deviation correction on each summary completion sentence to obtain a corresponding summary completion correction sentence.

[0309] 163. Determine the final summary text based on the multiple summary completion and correction sentences.

[0310] Steps 161 to 163 correspond to steps 120 to 140 and are therefore not described in detail here.

[0311] In the above implementation, the summary deviation correction and information completion processing can be performed on the preliminary summary text obtained by the trained summary generation model to obtain the final summary text. The above implementation can reduce the error probability of the model's single output in the model application stage and obtain a summary text with higher summary accuracy.

[0312] Optionally, see Figure 1e , the script of a film or TV work can be split according to the scenes to obtain multiple scene scripts: scene script 1, scene script 2, ..., scene script u. Each of the multiple scene scripts can be used as a text to be processed. The text to be processed is processed by the trained summary generation model to obtain a preliminary summary text. After the preliminary summary text is corrected for generalization bias, information is completed, and generalization bias is corrected again, a final summary text can be obtained. The final summary text is the summary text corresponding to the corresponding scene script, and a total of multiple final summary texts are obtained: final summary text 1, final summary text 2, ..., final summary text u. By merging multiple final summary texts, the script summary of the entire film or TV work can be obtained.

[0313] Optionally, see Figure 1f In another specific implementation, the script of a film or television work can be split according to scenes to obtain multiple scene scripts: scene script 1, scene script 2, ..., scene script u. Each of the multiple scene scripts can be used as a text to be processed. The text to be processed is processed by the trained summary generation model to obtain a preliminary summary text, which can be directly used as the final summary text. By merging multiple preliminary summary texts: preliminary summary text 1, preliminary summary text 2, ..., preliminary summary text u, the summary text of the script of the entire film or television work can be obtained.

[0314] In the summary generation method provided in the embodiment of the present application, the text to be processed can be first subjected to summary generation processing to obtain a preliminary summary text. Then the preliminary summary text is segmented according to sentences to obtain a plurality of preliminary summary sentences. For each of the plurality of preliminary summary sentences, based on the text to be processed, the summary deviation of the preliminary summary sentence is searched, and the summary deviation is corrected to obtain the corresponding summary correction sentence, and a plurality of summary correction sentences are obtained in total. Subsequently, a summary correction text is obtained based on the plurality of summary correction sentences. Based on the text to be processed, the summary correction text is subjected to information completion processing to obtain a summary completion text. Finally, a final summary text is generated based on the summary completion text. In the embodiment of the present application, after obtaining the preliminary summary text, the preliminary summary text can be subjected to summary deviation correction and information completion to obtain a summary completion text, and then the final final summary text is obtained based on the summary completion text. The processing process of summarizing deviation correction is used to correct the summarizing deviation of the preliminary summary text relative to the text to be processed, and the processing process of information completion is used to complete the information missing of the summary correction text relative to the text to be processed, so as to obtain a summary text with higher accuracy.

[0315] The embodiments of the present application can improve the accuracy of the abstract extraction process.

[0316] In this embodiment, the method of the embodiment of the present application will be described in detail by taking the to-be-processed text as a script text as an example. The summary generation method provided in the embodiment of the present application can be executed by an electronic device. In this embodiment, the electronic device is a server as an example. Figure 2 As shown, the specific process of a summary generation method is as follows:

[0317] 201. The server uses the trained summary generation model to perform summary generation processing on the script text to obtain a preliminary summary text.

[0318] The preliminary summary text includes multiple generated words, and the multiple generated words include a first generated word and a non-first generated word. The non-first generated word is any generated word except the first generated word.

[0319] For the first generated word, it can be generated through the following steps:

[0320] The script text is encoded to obtain encoding features; high-dimensional features of the encoding features are extracted to obtain high-dimensional matrix features; attention mechanism processing is performed on the high-dimensional matrix features to obtain attention processing results; slicing operation is performed on the attention processing results to obtain slicing processing results; the index identifier corresponding to the slicing processing result in the preset vocabulary is obtained, wherein the index identifier corresponding to the slicing processing result in the preset vocabulary is the first index identifier; the first index identifier is decoded to obtain the first generated word of the preliminary summary text.

[0321] For non-first generated words, they can be generated by the following steps:

[0322] Extract high-dimensional features of the index identifier corresponding to the previous generated word to obtain identifier high-dimensional matrix features; perform attention mechanism processing on the identifier high-dimensional matrix features to obtain identifier attention processing results; obtain the index identifier corresponding to the identifier attention processing result in the preset vocabulary, wherein the index identifier corresponding to the identifier attention processing result in the preset vocabulary is a second index identifier; perform decoding processing on the second index identifier to obtain the non-first generated word of the preliminary summary text.

[0323] Optionally, in one implementation, before step 201, the embodiment of the present application may further include the following steps T1 to T14:

[0324] T1. The server performs summary generation processing on the target training text to obtain a preliminary training summary text; wherein the target training text is any training text among the multiple training texts.

[0325] T2. The server segments the preliminary training summary text to obtain a plurality of preliminary training summary sentences.

[0326] T3. The server corrects the generalization deviation of each of the preliminary selected training summary sentences based on the target training text to obtain a corresponding training summary correction sentence.

[0327] T4. The server determines a training summary correction text based on the plurality of training summary correction sentences.

[0328] T5. The server completes the information of the training summary correction text based on the target training text to obtain a training summary completion text.

[0329] T6. The server segments the training summary completion text to obtain multiple training summary completion sentences.

[0330] T7. The server performs generalization deviation correction on each training summary completion sentence based on the target training text to obtain a corresponding training summary completion correction sentence.

[0331] T8. The server determines the fine screening label summary text corresponding to the target training text based on the multiple training summary completion and correction sentences; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary training summary text, the training summary correction text, and the training summary completion text.

[0332] T9. The server obtains a preliminary summary generation model, wherein the preliminary summary generation model is a pre-trained summary generation model trained based on a training text and a fine screening label summary text corresponding to the training text, the training text corresponds to a coarse screening label summary text and a fine screening label summary text, the coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text.

[0333] T10. The server generates a policy model to be trained based on the model parameters of the preliminary summary generation model, wherein the model structure of the policy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the policy model to be trained are consistent with the preliminary summary generation model.

[0334] T11. The server inputs the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determines a first loss function based on the first training result and the fine-screened label summary text.

[0335] T12. The server inputs the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determines a second loss function based on the second training result, the first training result, the coarse screening label summary text, and the fine screening label summary text.

[0336] T13. The server determines a total loss function based on the first loss function and the second loss function.

[0337] T14. The server updates the model parameters of the strategy model to be trained based on the total loss function until convergence, and obtains a trained strategy model, where the trained strategy model is the trained summary generation model.

[0338] 202. The server segments the preliminary summary text to obtain a plurality of preliminary summary sentences.

[0339] 203. The server fills the script text and the preliminary summary sentence to be processed into the summary deviation correction prompt template to obtain the text to be corrected, wherein the text to be corrected is used to prompt the large language model to perform summary deviation correction on the preliminary summary sentence to be processed, and the preliminary summary sentence to be processed is any preliminary summary sentence among multiple preliminary summary sentences.

[0340] 204. The server inputs the text to be revised into a large language model, and obtains a text understanding result to be revised output by the large language model in response to the text to be revised, wherein the text understanding result to be revised includes a summary revision sentence corresponding to the preliminary summary sentence to be processed.

[0341] 205. The server determines a summary revision text based on the plurality of summary revision statements.

[0342] 206. The server fills the script text and the summary revised text into the information completion prompt template to obtain the text to be completed, wherein the text to be completed is used to prompt the large language model to complete the information of the summary revised text.

[0343] 207. The server inputs the text to be completed into the large language model, and obtains a text understanding result of the text to be completed that is output by the large language model in response to the text to be completed, wherein the text understanding result of the text to be completed includes the summary completion text.

[0344] 208. The server segments the summary completion text to obtain multiple summary completion sentences.

[0345] 209. The server performs summary deviation correction on each summary completion sentence based on the script text to obtain a corresponding summary completion correction sentence.

[0346] 210. The server determines the final selected summary text based on the multiple summary completion and correction sentences.

[0347] The specific execution process of step 201 to step 210 has been described in detail above and will not be repeated here.

[0348] In the summary generation method provided in the embodiment of the present application, the server can first perform summary generation processing on the text to be processed to obtain a preliminary summary text. Then the preliminary summary text is divided according to the sentence to obtain a plurality of preliminary summary sentences. For each of the plurality of preliminary summary sentences, based on the text to be processed, the summary deviation of the preliminary summary sentence is found, and the summary deviation is corrected to obtain the corresponding summary correction sentence, and a total of a plurality of summary correction sentences are obtained. Subsequently, a summary correction text is obtained based on the plurality of summary correction sentences. Based on the text to be processed, the summary correction text is then subjected to information completion processing to obtain a summary completion text. Finally, a final summary text is generated based on the summary completion text. In the embodiment of the present application, after obtaining the preliminary summary text, the preliminary summary text can be subjected to summary deviation correction and information completion to obtain a summary completion text, and then the final final summary text is obtained based on the summary completion text. The processing process of summarizing deviation correction is used to correct the summarizing deviation of the preliminary summary text relative to the text to be processed, and the processing process of information completion is used to complete the information missing of the summary correction text relative to the text to be processed, so as to obtain a summary text with higher accuracy.

[0349] The embodiments of the present application can improve the accuracy of the abstract extraction process.

[0350] In order to better implement the above method, the present application embodiment also provides a summary generation model training device, such as Figure 3 As shown, the device comprises:

[0351] A preliminary summary unit 301 is used to perform summary generation processing on the text to be processed to obtain a preliminary summary text;

[0352] A text segmentation unit 302 is used to segment the preliminary summary text to obtain a plurality of preliminary summary sentences;

[0353] A deviation correction unit 303 is used to correct the summary deviation of each of the preliminary selected summary sentences based on the text to be processed to obtain a corresponding summary correction sentence;

[0354] A revised text unit 304, configured to determine a summary revised text based on the plurality of summary revised sentences;

[0355] An information completion unit 305 is used to complete the information of the summary correction text based on the text to be processed to obtain a summary completion text;

[0356] The final summary selection unit 306 is used to determine the final summary text based on the summary completion text.

[0357] In one embodiment, the final selection summary unit 306 includes:

[0358] A completion text segmentation subunit is used to segment the summary completion text to obtain a plurality of summary completion sentences;

[0359] A deviation correction subunit is used to perform summary deviation correction on each summary completion sentence based on the text to be processed to obtain a corresponding summary completion correction sentence;

[0360] The final selected text subunit is used to determine the final selected summary text based on the multiple summary completion and correction sentences.

[0361] In one implementation, the deviation correction unit 303 includes:

[0362] A correction prompt subunit is used to fill the text to be processed and the preliminary summary sentence to be processed into a summary deviation correction prompt template to obtain the text to be corrected, wherein the text to be corrected is used to prompt the large language model to correct the generalization deviation of the preliminary summary sentence to be processed, and the preliminary summary sentence to be processed is any one of the multiple preliminary summary sentences;

[0363] The correction response subunit is used to input the text to be corrected into the large language model to obtain the text to be corrected understanding result output by the large language model in response to the text to be corrected, and the text to be corrected understanding result includes the summary correction sentence corresponding to the preliminary summary sentence to be processed.

[0364] In one implementation, the information completion unit 305 includes:

[0365] A completion prompt subunit is used to fill the text to be processed and the summary correction text into the information completion prompt template to obtain the text to be completed, wherein the text to be completed is used to prompt the large language model to complete the information of the summary correction text;

[0366] The completion response subunit is used to input the text to be completed into the large language model, and obtain the understanding result of the text to be completed output by the large language model in response to the text to be completed, and the understanding result of the text to be completed includes the summary completion text.

[0367] In one implementation, the preliminary summary unit 301 is specifically configured to perform summary generation processing on the text to be processed using a trained summary generation model to obtain a preliminary summary text.

[0368] In one embodiment, the device further comprises:

[0369] A preliminary model acquisition unit is used to acquire a preliminary summary generation model, wherein the preliminary summary generation model is obtained by training a pre-trained summary generation model based on a training text and a fine screening label summary text corresponding to the training text, the training text corresponds to a coarse screening label summary text and a fine screening label summary text, the coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text;

[0370] A strategy model unit to be trained, used to generate a strategy model to be trained based on the model parameters of the preliminary summary generation model, wherein the model structure of the strategy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the strategy model to be trained are consistent with the preliminary summary generation model;

[0371] A first loss function unit is used to input the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determine a first loss function based on the first training result and the fine screening label summary text;

[0372] A second loss function unit is used to input the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determine a second loss function based on the second training result, the first training result, the coarse screening label summary text and the fine screening label summary text;

[0373] a total loss function unit, configured to determine a total loss function based on the first loss function and the second loss function;

[0374] The training completed model unit is used to update the model parameters of the to-be-trained strategy model based on the total loss function until convergence, so as to obtain a trained strategy model, wherein the trained strategy model is the trained summary generation model.

[0375] In one embodiment, the device further comprises:

[0376] A preliminary training summary unit is used to perform summary generation processing on a target training text to obtain a preliminary training summary text; wherein the target training text is any training text among the plurality of training texts;

[0377] A training intermediate text unit, used for performing information optimization processing on the preliminary selected training summary text to obtain a training intermediate text;

[0378] The fine screening summary text unit is used to determine the fine screening label summary text corresponding to the target training text based on the training intermediate text; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary training summary text, the training intermediate text.

[0379] In one embodiment, the training intermediate text includes a training summary correction text and a training summary completion text; accordingly, the training intermediate text unit includes:

[0380] A training segmentation subunit, used to segment the preliminary training summary text to obtain a plurality of preliminary training summary sentences;

[0381] A training correction subunit, configured to correct the generalization deviation of each of the preliminary selected training summary sentences based on the target training text to obtain a corresponding training summary correction sentence;

[0382] A training revision determination subunit, configured to determine a training summary revision text based on a plurality of the training summary revision sentences;

[0383] The information completion subunit is used to complete the information of the training summary correction text based on the target training text to obtain the training summary completion text.

[0384] In one embodiment, the fine screening summary text unit includes:

[0385] A completion segmentation subunit, used to segment the training summary completion text to obtain a plurality of training summary completion sentences;

[0386] A completion deviation correction subunit is used to perform summary deviation correction on each training summary completion sentence based on the target training text to obtain a corresponding training summary completion correction sentence;

[0387] The fine screening summary generation subunit is used to determine the fine screening label summary text corresponding to the target training text based on multiple training summary completion and correction sentences; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary training summary text, the training summary correction text, and the training summary completion text.

[0388] In one implementation, the preliminary summary text includes a plurality of generated words, and the plurality of generated words include the first generated word; accordingly, the preliminary summary unit 301 includes:

[0389] The encoding subunit is used to encode the text to be processed to obtain encoding features;

[0390] A high-dimensional feature extraction subunit, used to extract high-dimensional features of the coding features to obtain high-dimensional matrix features;

[0391] An attention subunit, used for performing attention mechanism processing on the high-dimensional matrix features to obtain an attention processing result;

[0392] A slicing subunit, used for performing a slicing operation on the attention processing result to obtain a slicing processing result;

[0393] A first index subunit is used to obtain an index identifier corresponding to the slice processing result in a preset vocabulary, wherein the index identifier corresponding to the slice processing result in the preset vocabulary is a first index identifier;

[0394] The first index decoding subunit is used to decode the first index identifier to obtain a first generated word of the preliminary selected summary text.

[0395] In one implementation, the preliminary summary text includes a plurality of generated words, the plurality of generated words include a non-first generated word, and the non-first generated word is any generated word except the first generated word; accordingly, the preliminary summary unit 301 includes:

[0396] The identification high-dimensional sub-unit is used to extract the high-dimensional features of the index identification corresponding to the previous generated word, and obtain the identification high-dimensional matrix features;

[0397] The identification attention subunit is used to perform attention mechanism processing on the identification high-dimensional matrix features to obtain identification attention processing results;

[0398] A second index subunit is used to obtain an index identifier corresponding to the mark attention processing result in the preset vocabulary, wherein the index identifier corresponding to the mark attention processing result in the preset vocabulary is a second index identifier;

[0399] The second index decoding subunit is used to decode the second index identifier to obtain the non-first generated word of the preliminary selected summary text.

[0400] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0401] In the summary generation method provided in the embodiment of the present application, the text to be processed can be first subjected to summary generation processing to obtain a preliminary summary text. Then the preliminary summary text is segmented according to sentences to obtain a plurality of preliminary summary sentences. For each of the plurality of preliminary summary sentences, based on the text to be processed, the summary deviation of the preliminary summary sentence is searched, and the summary deviation is corrected to obtain the corresponding summary correction sentence, and a plurality of summary correction sentences are obtained in total. Subsequently, a summary correction text is obtained based on the plurality of summary correction sentences. Based on the text to be processed, the summary correction text is subjected to information completion processing to obtain a summary completion text. Finally, a final summary text is generated based on the summary completion text. In the embodiment of the present application, after obtaining the preliminary summary text, the preliminary summary text can be subjected to summary deviation correction and information completion to obtain a summary completion text, and then the final final summary text is obtained based on the summary completion text. The processing process of summarizing deviation correction is used to correct the summarizing deviation of the preliminary summary text relative to the text to be processed, and the processing process of information completion is used to complete the information missing of the summary correction text relative to the text to be processed, so as to obtain a summary text with higher accuracy.

[0402] The embodiments of the present application can improve the accuracy of the abstract extraction process.

[0403] The present application also provides an electronic device. In this embodiment, the electronic device of this embodiment is described in detail by taking the server as an example. For example, Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0404] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0405] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0406] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and summary generation model training by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0407] The electronic device also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0408] The electronic device may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0409] The electronic device may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The electronic device may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.

[0410] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions in the various method embodiments of the present application.

[0411] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0412] To this end, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored, and the instructions can be loaded by a processor to execute the steps in any of the summary generation methods provided in the embodiments of the present application. For example, the instructions can execute each step in each method embodiment of the present application.

[0413] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0414] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including instructions, the instructions being stored in a computer-readable storage medium. A processor of a computer device reads the instructions from the computer-readable storage medium, and the processor executes the instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.

[0415] Since the instructions stored in the storage medium can execute the steps in any one of the summary generation methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the summary generation methods provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.

[0416] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0417] The above is a detailed introduction to a summary generation method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A method for generating a summary, characterized in that: The method comprises: Obtaining a preliminary summary generation model, wherein the preliminary summary generation model is obtained by training a pre-trained summary generation model based on a training text and a fine screening label summary text corresponding to the training text, wherein the training text corresponds to a coarse screening label summary text and a fine screening label summary text, wherein the coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text; Based on the model parameters of the preliminary summary generation model, generating a strategy model to be trained, wherein the model structure of the strategy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the strategy model to be trained are consistent with the preliminary summary generation model; Inputting the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determining a first loss function based on the first training result and the fine-screened label summary text; Inputting the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determining a second loss function based on the second training result, the first training result, the coarse screening label summary text, and the fine screening label summary text; Determine a total loss function based on the first loss function and the second loss function; Based on the total loss function, updating the model parameters of the to-be-trained strategy model until convergence, to obtain a trained strategy model, wherein the trained strategy model is the trained summary generation model; Performing summary generation processing on the text to be processed to obtain a preliminary summary text; wherein the method includes: performing summary generation processing on the text to be processed using a trained summary generation model to obtain a preliminary summary text; Segmenting the preliminary summary text to obtain a plurality of preliminary summary sentences; Based on the text to be processed, each of the preliminary selected summary sentences is corrected for summary deviation to obtain a corresponding summary correction sentence; Determining a summary revision text based on the plurality of summary revision sentences; Based on the text to be processed, the summary correction text is supplemented with information to obtain a summary supplement text; Based on the summary completion text, a final summary text is determined.

2. The method according to claim 1, characterized in that The step of determining the final summary text based on the summary completion text includes: Segmenting the summary completion text to obtain multiple summary completion sentences; Based on the text to be processed, each summary completion sentence is corrected for generalization deviation to obtain a corresponding summary completion correction sentence; The final selected summary text is determined based on the multiple summary completion and correction sentences.

3. The method according to claim 1, characterized in that Based on the text to be processed, each of the preliminary selected summary sentences is corrected for summary deviation to obtain a corresponding summary correction sentence, including: Filling the to-be-processed text and the to-be-processed preliminary summary sentence into a summary deviation correction prompt template to obtain the to-be-corrected text, wherein the to-be-corrected text is used to prompt the large language model to perform summary deviation correction on the to-be-processed preliminary summary sentence, and the to-be-processed preliminary summary sentence is any one of the multiple preliminary summary sentences; The text to be revised is input into the large language model to obtain a text understanding result to be revised that is output by the large language model in response to the text to be revised, wherein the text understanding result to be revised includes a summary revision sentence corresponding to the preliminary summary sentence to be processed.

4. The method according to claim 3, characterized in that The text understanding result to be corrected also includes a profile deviation type, and the profile deviation type refers to the category to which the profile deviation belongs.

5. The method according to claim 1, characterized in that The step of completing the information of the summary correction text based on the text to be processed to obtain the summary completion text includes: Filling the to-be-processed text and the summary correction text into the information completion prompt template to obtain the to-be-completed text, wherein the to-be-completed text is used to prompt the large language model to complete the information of the summary correction text; The text to be completed is input into the large language model to obtain a text to be completed understanding result output by the large language model in response to the text to be completed, wherein the text to be completed understanding result includes the summary completion text.

6. The method according to claim 1, characterized in that Before obtaining the preliminary summary generation model, the method further includes: Performing summary generation processing on the target training text to obtain a preliminary training summary text; wherein the target training text is any training text among the multiple training texts; Performing information optimization processing on the preliminary selected training summary text to obtain a training intermediate text; Based on the training intermediate text, a fine screening label summary text corresponding to the target training text is determined; the coarse screening label summary text corresponding to the target training text is any one of the following: the preliminary selection training summary text, the training intermediate text.

7. The method according to claim 6, characterized in that The training intermediate text includes a training summary correction text and a training summary supplement text; The step of performing information optimization processing on the preliminary selected training summary text to obtain a training intermediate text includes: Segmenting the preliminary training summary text to obtain a plurality of preliminary training summary sentences; Based on the target training text, each of the preliminary selected training summary sentences is corrected for generalization deviation to obtain a corresponding training summary correction sentence; Determining a training summary correction text based on the plurality of training summary correction sentences; Based on the target training text, the training summary correction text is supplemented to obtain a training summary supplement text.

8. The method according to claim 7, wherein determining the fine-screened label summary text corresponding to the target training text based on the training intermediate text comprises: Segmenting the training summary completion text to obtain a plurality of training summary completion sentences; Based on the target training text, performing generalization deviation correction on each training summary completion sentence to obtain a corresponding training summary completion correction sentence; Determining a fine-screened label summary text corresponding to the target training text based on the plurality of training summary completion and correction sentences; The rough screening label summary text corresponding to the target training text is any one of the following: the preliminary selection training summary text, the training summary correction text, and the training summary completion text.

9. The method according to claim 1, characterized in that The preliminary summary text includes a plurality of generated words, and the plurality of generated words includes a first generated word; The method of using the trained summary generation model to perform summary generation processing on the text to be processed to obtain a preliminary summary text includes: Encoding the text to be processed to obtain encoding features; Extracting high-dimensional features of the coding features to obtain high-dimensional matrix features; Performing attention mechanism processing on the high-dimensional matrix features to obtain an attention processing result; Performing a slicing operation on the attention processing result to obtain a slicing processing result; Obtaining an index identifier corresponding to the slice processing result in a preset vocabulary, wherein the index identifier corresponding to the slice processing result in the preset vocabulary is a first index identifier; The first index identifier is decoded to obtain a first generated word of the preliminary selected summary text.

10. The method according to claim 1, characterized in that The preliminary summary text includes a plurality of generated words, wherein the plurality of generated words include a non-first generated word, and the non-first generated word is any generated word except the first generated word; The method of using the trained summary generation model to perform summary generation processing on the text to be processed to obtain a preliminary summary text includes: Extract the high-dimensional features of the index identifier corresponding to the previous generated word to obtain the identifier high-dimensional matrix features; Performing attention mechanism processing on the identification high-dimensional matrix features to obtain identification attention processing results; Obtaining an index identifier corresponding to the identification attention processing result in a preset vocabulary, wherein the index identifier corresponding to the identification attention processing result in the preset vocabulary is a second index identifier; The second index identifier is decoded to obtain a non-first generated word of the primary selected summary text.

11. A summary generation device, characterized in that: The device comprises: The device is used to: obtain a preliminary summary generation model, wherein the preliminary summary generation model is obtained by training a pre-trained summary generation model based on a training text and a fine screening label summary text corresponding to the training text, the training text corresponds to a coarse screening label summary text and a fine screening label summary text, the coarse screening label summary text is a low-accuracy summary corresponding to the training text, and the fine screening label summary text is a high-accuracy summary corresponding to the training text; Based on the model parameters of the preliminary summary generation model, generating a strategy model to be trained, wherein the model structure of the strategy model to be trained is consistent with the pre-trained summary generation model, and the model parameters of the strategy model to be trained are consistent with the preliminary summary generation model; Inputting the training text into the strategy model to be trained to obtain a first training result output by the strategy model to be trained; and determining a first loss function based on the first training result and the fine-screened label summary text; Inputting the training text into the preliminary summary generation model to obtain a second training result output by the preliminary summary generation model; and determining a second loss function based on the second training result, the first training result, the coarse screening label summary text, and the fine screening label summary text; Determine a total loss function based on the first loss function and the second loss function; Based on the total loss function, updating the model parameters of the to-be-trained strategy model until convergence, to obtain a trained strategy model, wherein the trained strategy model is the trained summary generation model; The preliminary summary unit is used to perform summary generation processing on the text to be processed to obtain a preliminary summary text; wherein the preliminary summary unit is specifically used to: perform summary generation processing on the text to be processed using the trained summary generation model to obtain a preliminary summary text; A text segmentation unit, used to segment the preliminary summary text to obtain a plurality of preliminary summary sentences; A deviation correction unit, configured to correct the summary deviation of each of the preliminary selected summary sentences based on the text to be processed, to obtain a corresponding summary correction sentence; A revised text unit, used to determine a summary revised text based on the plurality of summary revised sentences; An information completion unit, configured to complete the information of the summary correction text based on the text to be processed to obtain a summary completion text; The final summary unit is used to determine the final summary text based on the summary completion text.

12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions; the processor loads instructions from the memory to execute the steps in the summary generation method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the abstract generation method according to any one of claims 1 to 10.

14. A computer program product, characterized in that The method comprises instructions, which, when executed by a processor, implement the steps in the abstract generation method according to any one of claims 1 to 10.