Text abstract generation method and device, electronic equipment and storage medium

Through the method of sub-text extraction and incremental summary updating of the text to be processed, the problem of insufficient accuracy in automatic text summary generation in the existing technology is solved, and more accurate and coherent text summary generation is achieved.

CN119357387APending Publication Date: 2025-01-24SHENZHEN XUMI YUNTU SPACE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411613595.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, when the automatic text digest generation method processes large-scale input, the generated digest results are not accurate enough, and there are problems of incomplete information integration and redundancy.

Method used

Through text extraction of the text to be processed, multiple sub-texts are obtained, and a main text and at least one sub-text are determined from these sub-texts. The main text and sub-text are separately extracted, and the main summary is incremented based on the sub-summary. Update to get the final target summary.

Benefits of technology

Effectively integrate multiple information sources in the long text, improve the accuracy and correlation of abstracts, and avoid the problems of incomplete information redundancy and incomplete integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357387A_ABST
    Figure CN119357387A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and provides a text abstract generation method and device, electronic equipment and a storage medium. The method comprises the steps of performing text extraction on a to-be-processed text to obtain a plurality of sub-texts, and determining a main text and at least one auxiliary text from the plurality of sub-texts; performing abstract extraction on the main text to obtain a main abstract, and performing abstract extraction on each auxiliary text to obtain an auxiliary abstract corresponding to each auxiliary text; and performing incremental updating on the main abstract according to each auxiliary abstract to obtain a target abstract corresponding to the to-be-processed text. The problem that the abstract generation result is not accurate enough is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method, device, electronic device and storage medium for generating a text summary. Background Art

[0002] With the advent of the big data era, the demand for processing and summarizing large amounts of text has increased significantly. Large Language Models (LLMs) have been widely used in automatic text summarization due to their excellent language understanding and generation capabilities. However, LLMs have limitations when processing large-scale inputs, resulting in inaccurate summaries. Summary of the invention

[0003] In view of this, the present application provides a method, device, electronic device and storage medium for generating a text summary to solve the problem that the summary results in the prior art are not accurate enough.

[0004] In a first aspect of the present application, a method for generating a text summary is provided, comprising: performing text extraction on a text to be processed to obtain multiple sub-texts, and determining a main text and at least one sub-text from the multiple sub-texts; performing summary extraction on the main text to obtain a main summary, performing summary extraction on each sub-text to obtain a sub-summary corresponding to each sub-text; and incrementally updating the main summary according to each sub-summary to obtain a target summary corresponding to the text to be processed.

[0005] According to a second aspect of the present application, a device for generating a text summary is provided, comprising: a text extraction module, configured to perform text extraction on a text to be processed to obtain multiple sub-texts, and determine a main text and at least one sub-text from the multiple sub-texts; a summary extraction module, configured to perform summary extraction on the main text to obtain a main summary, perform summary extraction on each sub-text to obtain a sub-summary corresponding to each sub-text; and a summary update module, configured to perform incremental update on the main summary according to each sub-summary to obtain a target summary corresponding to the text to be processed.

[0006] According to a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0007] According to a fourth aspect of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0008] At least one of the above technical solutions adopted in this application can achieve the following beneficial effects:

[0009] By extracting the text to be processed, multiple sub-texts are obtained, and a main text and at least one sub-text are determined from these sub-texts, the main text is abstracted to obtain the main abstract, and each sub-text is abstracted to obtain the corresponding sub-abstract, and the main abstract is incrementally updated according to each sub-abstract, and the new information in the sub-abstract is integrated into the main abstract. Finally, the main abstract after incremental update contains the main information of all sub-texts, that is, the target abstract corresponding to the text to be processed is obtained. In this way, the long text can be effectively converted into multiple information sources, and the key information of multiple information sources can be integrated and incrementally updated to obtain the target abstract, which avoids the problem of incomplete information integration caused by model token limitations in traditional summary generation, and improves the accuracy and relevance of the target abstract through incremental updates. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0011] Figure 1 It is a flowchart of a method for generating a text summary provided in an embodiment of the present application;

[0012] Figure 2 It is a flowchart of another method for generating a text summary provided in an embodiment of the present application;

[0013] Figure 3 It is a structural schematic diagram of a device for generating a text summary provided in an embodiment of the present application;

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

[0015] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0016] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0017] In addition, it should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0018] With the advent of the big data era, the demand for processing and summarizing large amounts of text has increased significantly. Large language models have been widely used for automatic text summarization due to their excellent language understanding and generation capabilities. However, LLMs encounter some challenges when processing large-scale inputs, especially in generating coherent, accurate, and non-redundant summaries.

[0019] Current technical solutions mostly use unstructured memory systems to assist LLM in processing input text. Such systems help the model understand the context by storing and retrieving key information, but their limitations are mainly reflected in the following aspects:

[0020] 1. Information organization method: Unstructured memory systems usually store information in a linear or planar structure, lacking effective organization and hierarchy, resulting in low efficiency in information retrieval and updating.

[0021] 2. Information overload problem: When processing large amounts of text, unstructured memory systems tend to accumulate too much information, causing information overload, which in turn affects the model’s summary generation effect.

[0022] 3. Abstract quality: Due to insufficient information organization and retrieval, the generated abstract may be redundant, omit important content, or lack coherence between different paragraphs.

[0023] Therefore, this application introduces structured knowledge representation and chained structured update strategy to improve the accuracy and coherence of the summary.

[0024] A method and device for generating a text summary according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0025] Figure 1 Schematic diagram of a method for generating a text summary provided in an embodiment of the present application. Figure 1 As shown, the method for generating the text summary includes:

[0026] S101 , extracting a text to be processed to obtain a plurality of sub-texts, and determining a main text and at least one sub-text from the plurality of sub-texts.

[0027] Specifically, the text to be processed can represent the text for which a target summary needs to be generated. When the large language model is restricted by tokens, the sub-texts in the text to be processed can be obtained in paragraphs, and summaries are generated and merged for the sub-texts to obtain the target summary. When extracting sub-texts from the text to be processed, they can be divided according to the paragraphs, chapters, topics or logical structures of the text to be processed. Each sub-text can correspond to a complete information unit, such as a paragraph, a theme, an event description, etc., or even a sentence, which is not limited here. Therefore, the text to be processed can also be understood as a long text for which a target summary needs to be generated, that is, a text that cannot be processed by a large language model at one time to obtain a target summary. Of course, it can also be multiple similar documents, that is, the present application solution can also be used to generate a generalized target summary for multiple similar texts.

[0028] Furthermore, a main text can be selected from multiple sub-texts, and a main summary can be generated based on the main text, and other sub-texts can be used as sub-texts to supplement the main summary. It should be understood that the distinction between the main text and the sub-text can be understood as dividing the sub-texts, setting one sub-text as the basis for updating the information center and summary, namely the main text, and using other sub-texts as other information sources and sub-texts for updating the summary of the main text. When determining whether the corresponding sub-text is the main text or sub-text, it can be determined according to the processing order of the sub-texts, that is, the first processed sub-text is used as the main text and the remaining sub-texts are used as rune cloths. It does not indicate the importance or length of the corresponding sub-text content. For example, when processing a long text, the processing can be started from the first paragraph of the text. If each paragraph of the long text is used as a sub-text, then the first paragraph can be used as the main text and the remaining paragraphs as sub-texts.

[0029] S102, extracting a summary from the main text to obtain a main summary, and extracting a summary from each sub-text to obtain a sub-summary corresponding to each sub-text.

[0030] S103, incrementally updating the main summary according to each sub-summary to obtain a target summary corresponding to the text to be processed.

[0031] Specifically, the information in the sub-summaries is integrated into the main summary. After each incremental update, the main summary will contain more key information corresponding to the sub-texts, gradually approaching the target summary containing complete key information. After the main summary has been incrementally updated by all sub-summaries, it will be output as the final target summary.

[0032] According to the technical solution provided in the above embodiment, through a distributed summary generation scheme, the target summary can not only contain all the key information of the text to be processed, but also be concise and clear in summary expression, avoiding information redundancy of long text summary results, and obtaining a coherent and accurate target summary.

[0033] In some embodiments, text extraction is performed on the processed text to obtain multiple sub-texts, including: performing semantic analysis on the processed text to obtain semantic analysis results, and identifying token restrictions of a large language model, the large language model represents a model for processing the processed text to generate a target summary, and the token restriction represents the number of tokens that the large language model can accommodate to perform a task; based on the token restriction and the semantic analysis results, the processed text is processed to obtain sub-texts.

[0034] Specifically, first, a semantic analysis can be performed on the text to be processed to identify the key information and logical structure therein so as to more reasonably divide the sub-texts. Specific semantic analysis methods may include: word segmentation and part-of-speech tagging, that is, dividing the text to be processed into words or phrases and marking their parts of speech (such as verbs, nouns, adjectives, etc.) to identify the content theme and information hierarchy of the text to be processed; through topic modeling, the theme or topic of the text to be processed is identified, and the semantically similar parts are grouped through clustering methods; through syntactic analysis, the structure of the sentence is analyzed to determine the relationship between the sentences, thereby determining the position of each paragraph or sentence in the overall content. In this way, a semantic analysis result can be generated to help identify the theme, key information and logical structure of the text to be processed, and provide guidance for subsequent text segmentation.

[0035] At the same time, determine the input length limit of the large language model in order to reasonably divide the text and ensure that the length of each sub-text is within the range that the model can handle. That is, the large language model usually has a maximum token limit (that is, the maximum number of characters or words that can be processed), where a token can be understood as the smallest unit in the text, which can be a character, a word or a phrase. By querying or setting this token limit, you can get the amount of content that the large language model can process in one input. In this way, you can know the upper limit of the number of tokens of the large language model, and control the length of the sub-text in combination with the results of semantic analysis. Based on the token limit and the results of semantic analysis, the text to be processed is divided to obtain multiple character texts.

[0036] Among them, based on the results of semantic analysis, the text to be processed can be divided into semantically relatively independent paragraphs or fragments, and the number of tokens of each sub-text can be calculated one by one during the division process to ensure that the length of each sub-text is within the token limit of the large language model. If a sub-text exceeds the token limit, the sub-text content can be further refined and split into smaller semantic units. If some sub-text information is incomplete, adjacent semantic units can be merged to ensure that each sub-text has sufficient information density, that is, the semantic integrity and logic of the sub-text are met as much as possible within the token limit of the large language model.

[0037] It should be noted that the division of the text to be processed described here can be understood as the way of inputting the text to be processed in the process of inputting the text to be processed into the large language model for processing, that is, when the text to be processed is processed but the entire text to be processed cannot be input at one time, the way of where to cut off the input text. As an example, a text to be processed contains four paragraphs A, B, C, and D. The semantic analysis result shows that AB can display more complete information, and CD can display more complete information. The token limit of the large language model can accept the input length of three paragraphs. Therefore, the large language model can give priority to accepting the two paragraphs AB as the sub-text to be processed first as the main text, generate the corresponding main summary for AB, and then accept the two paragraphs CD to generate the corresponding sub-summary of CD, and update the main summary corresponding to AB based on the sub-summary corresponding to CD to obtain the target summary.

[0038] According to the technical solution provided in the above embodiment, the text to be processed is divided into controllable and independent sub-texts through the dual strategies of semantic analysis and token control, so that the large language model can process these texts one by one without exceeding the token limit, thereby efficiently and completely extracting the key information of the target summary. This can avoid information loss or stage problems when the model processes too long text, ensuring that the generated summary is more accurate and coherent.

[0039] In some embodiments, extracting a summary from the main text to obtain a main summary includes: collecting relevant data from the main text based on a predefined summary structure, the relevant data corresponding to the summary structure; and mapping the collected relevant data to the summary structure to obtain the main summary.

[0040] Specifically, a summary structure can be predefined so that the generated summary is formatted and clear and easy to read. The summary structure can be represented in the form of key-value pairs, and the fields in the structure can be customized according to the needs of specific tasks.

[0041] Furthermore, relevant data can be collected from the main text and stored in the form of a summary structure to obtain a main summary. It should be understood that the relevant data can be represented as data that can be stored based on the summary structure. For example, in the scenario of event description, there may be summary structure keys: event name, event, location, participants, event description, results, etc., so that the corresponding values ​​​​can be obtained from the main text based on the above keys. Of course, when constructing the summary structure, the keys in the summary structure can be pre-defined based on the content of the text to be processed, or only the key-value pair structure can be pre-defined, and the large language model can automatically determine the appropriate key-value pair content during the processing process.

[0042] Then, relevant information collected from the main text is filled into the summary structure to obtain the main summary, that is, all the collected information content is mapped to the corresponding key, such as filling "important person" into the "participant" key. Of course, when filling in information, some repeated or conflicting information can also be integrated to ensure that the value in each key is accurate and concise. For example, if there are multiple descriptions of "places" in the main text, the most important ones can be retained or merged. Of course, the specific situation can be identified by the large language model. If some keys lack relevant data, they can be marked as "insufficient information" to indicate that incremental updates may be required later. There is no restriction here.

[0043] Similarly, for each sub-text to be processed subsequently, relevant data may be extracted based on the predefined summary structure to obtain a sub-summary, and the sub-summary may be stored, which may also include key-value pair information.

[0044] According to the technical solution provided by the above embodiment, relevant data is extracted from the main text through a predefined summary structure to obtain a main summary, which can ensure that the content of the generated summary is clear and the information is concentrated, and provides a basis for subsequent incremental updates.

[0045] In some embodiments, the summary structure includes a key-value pair structure, and the main summary is incrementally updated according to each sub-summary to obtain a target summary corresponding to the text to be processed, including: extracting the key-value pair data in the sub-summary and the key-value pair data of the main summary; according to the key-value pair data in the sub-summary, the key-value pair data in the main summary is incrementally updated to obtain the target summary.

[0046] Specifically, key-value pair data can be extracted from the sub-summary, and the main summary can be incrementally updated based on the key-value pair data of each sub-summary. Each key-value pair in the sub-summary can be checked one by one and compared with the key-value pairs extracted from the main summary, and the key-value pair content of the main summary can be updated to obtain the target summary.

[0047] In this way, a structured summary containing comprehensive information from the main text and the paratext can be generated.

[0048] In other embodiments, the key-value pair data includes a key and a value, and the key-value pair data in the primary summary is incrementally updated according to the key-value pair data in the sub-summary to obtain a target summary, including: if the primary summary already contains the key in the sub-summary, the value corresponding to the key in the included sub-summary is added to the primary summary; if the primary summary does not contain the key in the sub-summary, the key in the sub-summary that is not included and the value corresponding to the key in the sub-summary are added to the primary summary; the primary summary is updated according to all the key-value pair data in the sub-summary to obtain the target summary.

[0049] Specifically, the keys in the sub-summary can be checked one by one and compared with the keys in the main summary. If the key already exists in the main summary, the corresponding value of the key in the sub-summary can be added to the main summary or replace the value of the corresponding key in the main summary. It should be understood that the semantic analysis based on the large language model can be used to determine whether to directly add the value of the corresponding key to the main summary or replace the value corresponding to the key in the main summary. For example, when the value corresponding to the key in the sub-summary is more accurate or complete, the corresponding value in the main summary can be replaced by the corresponding value in the sub-summary. This will not be expanded here.

[0050] If one or some key-value pairs in the secondary summary are not mentioned in the primary summary, they can be added to the primary summary as new key-value pairs, thus ensuring the integrity of the target summary.

[0051] Of course, when incrementally updating the main summary, the main summary can also be updated directly based on the secondary text, that is, the key-value pair data is directly extracted from the secondary text, without the need to generate a secondary summary, and the key-value pair data is compared with the key-value pair data in the main summary to update the key-value pair content of the main summary. There is no restriction here.

[0052] According to the technical solution provided by the above embodiment, by analyzing and comparing the key-value pair data in the sub-summary with the key-value pair data in the main summary, the main summary can be updated and added to, so that the content of the main summary is gradually enriched, and finally a target summary containing all key information is generated. In this way, the sub-summary generated by the secondary text incrementally updates the main summary, which ensures the integrity and accuracy of the target summary and avoids redundancy, thereby improving the quality of the target summary.

[0053] In some embodiments, before performing text extraction on the processed text to obtain multiple sub-texts, it also includes: obtaining a training set, the training set includes corresponding reference summaries and reference texts; using a pre-trained large language model to process the reference text to obtain an evaluation summary; training the pre-trained large language model based on the reference summary and the evaluation summary to obtain a large language model.

[0054] Specifically, before using the large language model to generate summaries, model training can be performed first to obtain a large language model that can efficiently process the text to be processed;

[0055] First, a training set including reference abstracts and reference texts can be obtained. The reference abstracts can come from manual abstracts of professionals, literature, reports or other reliable documents. At the same time, the reference texts corresponding to the reference abstracts are obtained to train the large language model before training.

[0056] The training process can be understood as using the pre-trained large language model to process the reference text to obtain the corresponding evaluation summary, and optimizing the summary generation capability of the large language model based on the evaluation summary and the reference summary.

[0057] Among them, the generated evaluation summary can be compared with a high-quality reference summary to identify the differences between the two. These differences may include aspects such as information completeness, accuracy, coherence, and grammar. The model can be fine-tuned and optimized based on the difference results, that is, the loss between the evaluation summary and the reference summary (such as cross entropy loss) is calculated to evaluate the gap between the evaluation summary generated by the evaluation model and the reference summary, or the parameters of the model can be adjusted through optimization methods such as back propagation and gradient descent to obtain a large language model.

[0058] According to the technical solution provided in the above embodiment, by obtaining reference summaries, generating evaluation summaries and performing model training, the summary generation capability of the large language can be effectively improved, thereby enabling the large language model to more accurately extract and integrate information when processing various long texts, and ultimately generate a coherent and useful target summary.

[0059] In some embodiments, a pre-trained large language model is trained based on a reference summary and an evaluation summary to obtain a large language model, including: extracting key information points from the reference summary and extracting evaluation information points from the evaluation summary, the key information points representing all information stored in the reference summary, and the evaluation information points representing all information stored in the evaluation summary; based on the key information points and the evaluation information points, calculating the accuracy and recall of the evaluation summary; training the pre-trained large language model based on maximizing the accuracy and maximizing the recall to obtain a large language model.

[0060] Specifically, the large language model can be trained and optimized by analyzing the key information points in the reference summary and the evaluation information points in the evaluation summary. The key information points can represent all the information in the reference summary, that is, the true value of the model training. All the information in the reference summary is regarded as the correct summary information extracted from the reference text. The evaluation information points represent the summary information generated by the large language model processing the training set during the training process, which may contain correct information points and incorrect information points. Therefore, the evaluation information points and key information points are compared and calculated, and the incorrect information points and correct information points in the evaluation information points are extracted to obtain the accuracy of the generated evaluation summary. The incorrect information points and correct information points in the evaluation information points can be obtained by comparing with the key information points. According to the correct information points and incorrect information points in the key information points and the evaluation information points, the accuracy and recall of the evaluation summary can be calculated, and then the accuracy and recall can be maximized to train the model and obtain the large language model.

[0061] Among them, the accuracy can be based on the formula Calculation, in formula (1), precision can represent the accuracy of the evaluation summary, where TP can represent the number of correct information points in the evaluation summary, FP can represent the number of incorrect information points in the evaluation summary, and recall can be based on the formula In formula (2), recall may represent the recall rate, TP may represent the number of correct information points in the evaluation summary, and FN may represent the number of information points in the reference summary that are not covered by the evaluation summary.

[0062] During the training process, a loss function can be designed to comprehensively consider the accuracy and recall rate, and the loss is calculated to update the model parameters through back propagation. In this way, the model can learn how to generate summaries more effectively through multiple iterations to improve the accuracy and recall rate. Of course, the accuracy of the model evaluation can also be verified by manual evaluation based on the accuracy and recall rate, which is not restricted here.

[0063] According to the technical solution provided in the above embodiment, by calculating the accuracy and recall rate from the corresponding information points in the reference summary and the evaluation summary, and training based on these indicators, the summary generation ability of the large language model can be effectively improved. This process ensures that the model can extract and integrate information more accurately and ultimately generate a high-quality target summary.

[0064] Figure 2 This is a flow chart of another method for generating a text summary provided in an embodiment of the present application. Figure 2 Further explain this plan.

[0065] First, the user can define a structure, namely the summary structure, for example, define a lightweight data exchange format (such as JavaScript Object Notation, JSON) as the framework of the target summary, and organize and represent information through such a structured format, for example:

[0066] Summary

[0067] Attribute:

[0068] Name:str,

[0069] Values:list[str],

[0070] }

[0071] }

[0072] Summary can represent the overall container, Attribute can represent the contained data object, for example, it can represent a set of key-value pairs. In the above structure, Name can represent the attribute name, and Values ​​can represent the value related to the attribute, which can be a string list.

[0073] In this way, the model receives document 1, document 2, ..., document n (i.e., multiple sub-texts), and extracts information from each sub-text based on the JSON structure to obtain a JSON summary of each sub-text. When extracting summary information from a document, you can use the JSON path to update the summary structure, for example: use the $.Name path to update the attributes of the document. This ensures that the key information of each document is extracted and stored according to the predetermined summary structure. Through continuous incremental updates, the summary of each sub-document will eventually be integrated until all documents are processed and the final target summary of all documents is obtained.

[0074] In this way, document information can be extracted through a predefined summary structure, and the structured summary can be updated using the structured JSON key method, that is, a JSON path is generated to integrate new keys or values ​​to obtain a target summary containing the key information of the entire document.

[0075] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0076] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0077] Figure 3 Schematic diagram of a text summary generation device provided in an embodiment of the present application. Figure 3 As shown, the text summary generation device includes:

[0078] The text extraction module 301 is configured to perform text extraction on the text to be processed to obtain multiple sub-texts, and determine a main text and at least one sub-text from the multiple sub-texts;

[0079] The summary extraction module 302 is configured to extract a summary from the main text to obtain a main summary, and extract a summary from each sub-text to obtain a sub-summary corresponding to each sub-text;

[0080] The summary updating module 303 is configured to incrementally update the main summary according to each sub-summary to obtain a target summary corresponding to the text to be processed.

[0081] In some embodiments, the text extraction module 301 is specifically used to perform semantic analysis on the text to be processed, obtain semantic analysis results, and identify token restrictions of the large language model, where the large language model represents a model for processing the text to be processed to generate a target summary, and the token restriction represents the number of tokens that the large language model can accommodate to perform the task; the text to be processed is processed based on the token restriction and the semantic analysis results to obtain a sub-text.

[0082] In some embodiments, the summary extraction module 302 is specifically used to collect relevant data from the main text based on a predefined summary structure, where the relevant data corresponds to the summary structure; and map the collected relevant data to the summary structure to obtain a main summary.

[0083] In some embodiments, the summary update module 303 is specifically used to extract key-value pair data in the secondary summary and key-value pair data in the primary summary; based on the key-value pair data in the secondary summary, the key-value pair data in the primary summary is incrementally updated to obtain the target summary.

[0084] In some embodiments, the summary update module 303 is specifically used to add the value corresponding to the key in the included sub-summary to the main summary if the main summary already contains the key in the sub-summary; if the main summary does not contain the key in the sub-summary, add the key in the sub-summary that is not included and the value corresponding to the key in the sub-summary to the main summary; update the main summary according to all key-value pair data in the sub-summary to obtain the target summary.

[0085] In some embodiments, the text extraction module 301 is specifically used to obtain a training set, which includes corresponding reference summaries and reference texts; use a pre-trained large language model to process the reference text to obtain an evaluation summary; and train the pre-trained large language model based on the reference summary and the evaluation summary to obtain a large language model.

[0086] In some embodiments, the text extraction module 301 is specifically used to extract key information points from the reference summary and to extract evaluation information points from the evaluation summary, the key information points representing all information stored in the reference summary and the evaluation information points representing all information stored in the evaluation summary; based on the key information points and the evaluation information points, the accuracy and recall of the evaluation summary are calculated; based on the maximization of the accuracy and the maximization of the recall, the pre-trained large language model is trained to obtain a large language model.

[0087] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0088] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0089] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.

[0090] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0091] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0092] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0093] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0094] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for generating a text summary, characterized in that: include: Performing text extraction on the text to be processed to obtain a plurality of sub-texts, and determining a main text and at least one sub-text from the plurality of sub-texts; Extracting a summary of the main text to obtain a main summary, and extracting a summary of each of the sub-texts to obtain a sub-summary corresponding to each of the sub-texts; The main summary is incrementally updated according to each of the sub-summaries to obtain a target summary corresponding to the text to be processed.

2. The method according to claim 1, characterized in that The text to be processed is extracted to obtain multiple sub-texts, including: Performing semantic analysis on the text to be processed to obtain a semantic analysis result, and identifying a token limit of a large language model, wherein the large language model represents a model for processing the text to be processed to generate the target summary, and the token limit represents the number of tokens that the large language model can accommodate for performing a task; The text to be processed is processed based on the token restriction and the semantic analysis result to obtain the subtext.

3. The method according to claim 1, characterized in that The extracting a summary of the main text to obtain a main summary includes: Based on a predefined summary structure, collecting relevant data from the main text, the relevant data corresponding to the summary structure; The collected related data are mapped into the summary structure to obtain the main summary.

4. The method according to claim 3, characterized in that The summary structure includes a key-value pair structure, and the incremental updating of the main summary according to each of the sub-summaries to obtain a target summary corresponding to the text to be processed includes: Extracting the key-value pair data in the secondary summary and the key-value pair data in the primary summary; The key-value pair data in the primary summary is incrementally updated according to the key-value pair data in the secondary summary to obtain the target summary.

5. The method according to claim 4, characterized in that The key-value pair data includes a key and a value, and the step of incrementally updating the key-value pair data in the primary summary according to the key-value pair data in the secondary summary to obtain the target summary includes: If the primary digest already contains the key in the secondary digest, then the value corresponding to the key in the secondary digest that has been contained is added to the primary digest; If the primary digest does not contain the key in the secondary digest, then adding the key in the secondary digest that is not contained and the value corresponding to the key in the secondary digest to the primary digest; The main summary is updated according to all key-value pair data in the secondary summary to obtain the target summary.

6. The method according to claim 2, characterized in that Before extracting the text to be processed to obtain a plurality of subtexts, the method further includes: Acquire a training set, wherein the training set includes a corresponding reference abstract and a reference text; Processing the reference text using the large language model before training to obtain an evaluation summary; The large language model before training is trained based on the reference summary and the evaluation summary to obtain the large language model.

7. The method according to claim 6, characterized in that The step of training the large language model before training based on the reference summary and the evaluation summary to obtain the large language model includes: Extracting key information points from the reference summary and extracting evaluation information points from the evaluation summary, wherein the key information points represent all information stored in the reference summary and the evaluation information points represent all information stored in the evaluation summary; Based on the key information points and the evaluation information points, calculating the accuracy and recall of the evaluation summary; The large language model before the training is trained based on the maximization of the precision rate and the maximization of the recall rate to obtain the large language model.

8. A device for generating a text summary, characterized in that: include: A text extraction module is configured to perform text extraction on the text to be processed to obtain a plurality of sub-texts, and determine a main text and at least one sub-text from the plurality of sub-texts; A summary extraction module is configured to extract a summary from the main text to obtain a main summary, and to extract a summary from each of the sub-texts to obtain a sub-summary corresponding to each of the sub-texts; The summary updating module is configured to incrementally update the main summary according to each of the sub-summaries to obtain a target summary corresponding to the text to be processed.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.