Method, device and storage medium for generating text summary
By chunking processing and data cleaning of the initial text, combined with extraction and generative summary models, the problems of redundancy and information loss in the existing technology are solved, concise and accurate text summary generation are achieved, and user experience and efficiency are improved.
Patent Information
- Application Number
- CN202210424334.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-04-22
AI Technical Summary
The text summary generated by the prior art has redundant content, low accuracy, poor fluency, and direct intercepting text can easily lead to information loss, affecting user experience and work efficiency.
The initial text is cleaned and formatted by block processing. The first target text model is used to extract target information, and a summary is generated through the second target text model. Combining the extracted and generated abstract models, we ensure information integrity and accuracy.
The generated target summary is concise, accurate and smooth, avoiding information loss and improving user reading experience and work efficiency.
Smart Images

Figure CN114860873B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a method, device, and storage medium for generating a text summary. Background Art
[0002] With the rapid development of the Internet, the amount of text data on the Internet has grown exponentially.
[0003] Currently, to facilitate user reading, existing technologies analyze and model the input text, then use the model's summary as a summary for quick reading. While this approach is relatively simple, the resulting summary is often concise and contains redundant content, resulting in a poor user experience. Furthermore, since most models have a limit on the length of input text, existing technologies rely on direct truncation and input of the truncation into the model, which can easily lead to file information loss.
[0004] Therefore, how to provide a technical solution for a method of generating text summaries that is both concise, complete, and highly accurate has become a technical problem that needs to be solved urgently. Summary of the Invention
[0005] The purpose of some embodiments of the present application is to provide a method, device and storage medium for generating text summaries. Through the technical solutions of some embodiments of the present application, a target summary with high accuracy, conciseness and fluency can be generated based on text data, thereby improving the user experience.
[0006] In a first aspect, some embodiments of the present application provide a method for generating a text summary, comprising: performing block processing on an initial text to obtain processed text data, wherein the text data includes at least two text data blocks, and each text data block is represented by a set of candidate sentences; inputting the text data into a target summary generation model to obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract target information included in the text data, and the second target text model is used to generate the target summary based on the target information.
[0007] Some embodiments of the present application obtain a target summary by inputting text data after block processing of the initial text into a target summary generation model composed of a first target text model and a second target text model. In the process of generating a summary for a long text, compared with the related art method of directly extracting part from the initial text as input, the embodiments of the present application can block the long text to ensure that the target summary corresponding to the initial text is fully obtained, effectively avoiding the loss of text data, and at the same time, the obtained target summary has higher accuracy, better fluency and more standard format, thereby improving the user reading experience.
[0008] In some embodiments, before the initial text is segmented and the processed text data is obtained, the method further includes: performing data cleaning processing on at least part of the sentences in the original text to obtain the initial text, wherein the data cleaning processing includes: adjusting the sentence symbol format and removing at least one of noise information in the part of the sentences.
[0009] Some embodiments of the present application perform data cleaning on the original file, which can, on the one hand, correct the formatting problems of the original text and, on the other hand, effectively remove invalid information (ie, noise information) in the original text.
[0010] In some embodiments, before inputting the text data into the target summary generation model to obtain the target summary, the method further includes: performing data processing on the obtained sample data to obtain a processed sample data set; constructing a training data set and a verification data set based on the sample data set and the obtained reference summary set corresponding to the sample data set, wherein one sample data corresponds to one reference summary; using the training data set to train the first text model to obtain a first target text model to be tested, and using the training data set to train the second text model to obtain a second target text model to be tested; and confirming that the first target text model to be tested and the second target text model to be tested have passed verification based on at least the verification data set to obtain the target summary generation model.
[0011] Some embodiments of the present application train the first text model and the second text model separately in a non-end-to-end manner, and confirm that the trained first target text model to be tested and the trained second target text model to be tested are verified to obtain a target summary generation model, which effectively reduces the difficulty of model training and facilitates the maintenance and upgrade of the first target text model and the second target text model in the later stage.
[0012] In some embodiments, the step of confirming that the first target text model to be tested and the second target text model to be tested have passed verification at least based on the verification data set to obtain the target summary generation model includes: obtaining the first target text model to be tested and the second target text model to be tested after adjusting the parameters based on the verification data set and the loss function; obtaining the scores of the first target text model to be tested and the second target text model to be tested after adjusting the parameters, and obtaining the target summary generation model based on the scores.
[0013] Some embodiments of the present application can effectively avoid the problem of text information loss caused by directly intercepting part of the sample data as input by dividing the sample data into blocks and inputting it into the first target text model; then, the target summary generation model is obtained according to the score, which can ensure the accuracy of the target summary generation model finally obtained.
[0014] In some embodiments, inputting the text data into a target summary generation model to obtain a target summary includes: inputting the text data into the first target text model to obtain the target information through the first target text model, wherein the target information is a plurality of target sentences filtered out from the text data; and inputting the target information into the second target text model to obtain the target summary.
[0015] Some embodiments of the present application can ensure the accuracy and fluency of the target summary and improve the user experience by inputting the target information obtained by the first target text model into the second target text model to obtain the target summary.
[0016] In some embodiments, obtaining the target information through the first target text model includes: scoring and sorting each sentence included in the j-th text data block in the text data to obtain a queue; selecting a preset number of sentences from the queue as the j-th target sentence set, wherein the j-th text data block is any one of the at least two text data blocks; repeating the above process to obtain the target sentence set corresponding to each text data block to obtain the multiple target sentences.
[0017] Some embodiments of the present application score and sort each sentence in a text data block, and obtain a preset number of sentences with higher scores as target sentences, which can effectively extract important sentences in each text data block and ensure the accuracy of the generated target summary.
[0018] In some embodiments, after inputting the text data into the target summary generation model to obtain the target summary, the method further includes: extracting the numeric strings in the target summary and the initial text respectively; based on the numeric strings in the initial text, checking the numeric strings in the target summary to obtain erroneous characters; and replacing the erroneous characters according to the numeric strings in the initial text to obtain a replaced target summary.
[0019] Some embodiments of the present application ensure the accuracy of the generated target summary by verifying the digital string of the target summary.
[0020] In some embodiments, after replacing the erroneous characters according to the numeric character string in the initial text to obtain a replaced target summary, the method further includes: performing data cleaning processing on the replaced target summary to obtain a processed target summary, wherein the data cleaning processing includes: adjusting the sentence symbol format in the replaced target summary and removing at least one of noise information in the replaced target summary.
[0021] Some embodiments of the present application perform data cleaning on the target summary to ensure that the generated target summary is concise, well-formatted, and does not contain redundant content, thereby improving the user reading experience.
[0022] In some embodiments, the first text model is an extractive summarization model, and the second text model is a generative summarization model.
[0023] Some embodiments of the present application adopt different types of models as the first text model and the second text model. The combined use of the two types of models can improve the accuracy of the trained model.
[0024] In a second aspect, some embodiments of the present application provide a device for generating a text summary, comprising: a text processing module, configured to perform block processing on an initial text and obtain processed text data, wherein the text data includes at least two text data blocks, and each text data block is represented by a set of candidate sentences; a summary generation module, configured to input the text data into a target summary generation model and obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract target information included in the text data, and the second target text model is used to generate the target summary based on the target information.
[0025] In a third aspect, an embodiment of the present application provides a system comprising one or more computers and one or more storage devices storing instructions, wherein when the instructions are executed by the one or more computers, the one or more computers perform the operations of the corresponding methods of any embodiment in the first aspect.
[0026] In a fourth aspect, an embodiment of the present application provides one or more computer storage media storing instructions, which, when executed by one or more computers, enable the one or more computers to perform the operations of the corresponding methods of any embodiment in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the following is a brief introduction to the drawings required for use in some embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 A schematic diagram of a system for generating a text summary provided in some embodiments of the present application;
[0029] Figure 2 A flowchart of a method for training a summary generation model provided in some embodiments of the present application;
[0030] Figure 3 A flowchart of a method for generating a text summary provided in some embodiments of the present application;
[0031] Figure 4 This is one of the component block diagrams of the apparatus for generating a text summary provided in some embodiments of the present application;
[0032] Figure 5 This is a second block diagram of a device for generating a text summary provided in some embodiments of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.
[0034] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0035] In the related art, pre-trained language models are gradually being widely used in natural language processing tasks. This model is obtained by training a general language model using a large-scale corpus. On the one hand, when directly using a pre-trained language model to obtain a text summary corresponding to the text, although it is convenient and easy, it is easy to contain redundant content, the text summary is not concise, and the fluency and user experience are poor. On the other hand, due to the limitation of the pre-trained language model on the length of the text, when using a general pre-trained language model to extract text information, it is necessary to intercept the original text, which easily causes the loss of important information in the text and affects the relevant business processing process. For example, in the field of text processing, staff need to process a large amount of text information. Since the text information is long, if the text is directly intercepted, it is easy to cause the loss of text content, affecting work efficiency. Moreover, due to the different cultural levels of the relevant objects, the text content is too long (usually more than 1,500 words), and it is not easy to extract key content information using the pre-trained language model of the existing technology.
[0036] It can be seen from the above-mentioned related technologies that the existing methods for generating text summaries contain redundant content, and have low accuracy and poor fluency, which in turn affects work efficiency. In view of this, some embodiments of the present application input the text data after the initial text is segmented into blocks into a target summary generation model, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is used to extract the target information included in the text data, and the second target text model is used to generate the target summary based on the target information. Therefore, the model provided by some embodiments of the present application can obtain a concise, fluent and highly accurate target summary corresponding to the initial text, thereby improving the user's reading experience and work efficiency.
[0037] like Figure 1 As shown, some embodiments of the present application provide a system schematic diagram for generating a text summary, which includes a terminal device 100 and a summary generation server 200, wherein the terminal device 100 can be used to store text information and send the text information to the summary generation server 200 to obtain a target summary corresponding to the text information.
[0038] In addition, it should be noted that in other embodiments of the present application, the terminal device 100 has the function of storing data and generating a summary to obtain a target summary. In this case, the summary generation server 200 may not be provided, and only the terminal device 100 may execute the method for generating a text summary provided in the embodiments of the present application. The terminal device 100 may be a PC terminal or a mobile terminal.
[0039] Figure 1The target summary generation model obtained after training is deployed on the summary generation server 200. It is through this model that the summary generation server 200 can obtain the target summary corresponding to the text information.
[0040] The following first exemplifies the process of training the first text model and the second text model to obtain a target summary generation model with summary generation function.
[0041] Please see the attached Figure 2 , Figure 2 This is a flow chart of a method for training a summary generation model provided in some embodiments of the present application. The specific implementation process of the training method is exemplified below.
[0042] S210: Process the acquired sample data to obtain a processed sample data set.
[0043] In some embodiments of the present application, taking the field of text processing as an example, a text dataset (i.e., sample data) is first obtained, where the text dataset contains multiple texts. Then, punctuation errors, format errors, and noise information (such as mobile phone number information or address information) in the text content are adjusted or deleted.
[0044] S220 , constructing a training dataset and a validation dataset based on the sample data set and the obtained reference summary set corresponding to the sample data set, wherein a piece of sample data corresponds to a reference summary, and wherein a piece of sample data is a piece of text for which a summary needs to be extracted.
[0045] For example, in some embodiments of the present application, the training dataset and the validation dataset contain multiple sets of data, wherein each set of data includes a text (as a specific example of sample data) and a reference summary corresponding to the text, and the reference summary serves as the ideal output result of the trained model.
[0046] For example, in some embodiments of the present application, the reference summary in the reference summary set can be obtained by manually analyzing each sample data in the sample data set, or by analyzing each sample data based on a correlation summary algorithm (for example, a maximum margin correlation algorithm).
[0047] S230: Using the training data set to train the first text model to obtain a first target text model to be tested, and using the training data set to train the second text model to obtain a second target text model to be tested.
[0048] For example, in some embodiments of the present application, the text in the training dataset is used as the input of a first text model, and the reference summary corresponding to the text is used as the ideal output of the first text model (e.g., the BERT model), thereby training to obtain a first target text model to be tested. Similarly, the text in the training dataset is used as the input of a second text model (e.g., the RoBERTa model), and the reference summary corresponding to the text is used as the output of the second text model, thereby training to obtain a second target text model to be tested.
[0049] It should be noted that in order to facilitate the subsequent maintenance and upgrade of the target summary generation model, some embodiments of the present application adopt a non-end-to-end approach to train the first text model and the second text model to finally obtain the target summary generation model. When any of the models (i.e., the first target text model and the second target text model) has a problem, it can be replaced, maintained or upgraded. This approach improves the efficiency of model repair and reduces costs.
[0050] S240: Confirm, based at least on the verification data set, that the first target text model to be tested and the second target text model to be tested have passed verification, and obtain the target summary generation model.
[0051] In some embodiments of the present application, in order to obtain a target summary generation model with high accuracy, it is necessary to use a validation dataset to jointly verify the first target text model to be tested and the second target text model to be tested. That is, the text in the validation dataset is input into the first target text model to be tested, and the reference sentence data output by the first target text model to be tested is obtained. The reference sentence data is input into the second target text model to be tested, and the summary data corresponding to the text output by the second target text model to be tested is obtained. Thereafter, based on the summary data and the reference summary data in the validation dataset, the parameters of the first target text model and the second target text model are optimized until the first target text model and the second target text model are confirmed to have passed the verification, thereby obtaining the target summary generation model.
[0052] In some embodiments of the present application, S240 may specifically include: obtaining the first target text model to be tested after adjusting the parameters and the second target text model to be tested after adjusting the parameters according to the verification data set and the loss function; obtaining the scores of the first target text model to be tested after adjusting the parameters and the second target text model to be tested after adjusting the parameters, and obtaining the target summary generation model based on the scores.
[0053] In some embodiments of the present application, S240 may also include: looping the following process: using the loss function to adjust the parameters of the first target text model to be tested and the second target text model to be tested at least twice, and scoring the first target text model to be tested and the second target text model to be tested after each parameter adjustment, obtaining the comprehensive score (that is, the score) of the first target text model to be tested and the second target text model to be tested after each parameter adjustment, and using the first target text model to be tested and the second target text model to be tested after the parameter adjustment with the highest comprehensive score after at least two parameter adjustments as the first target text model and the second target text model, and using the first target text model and the second target text model as target summary generation models.
[0054] For example, as a specific example of the present application, the loss function of the first target text model to be tested is obtained by the following formula:
[0055]
[0056] Among them, L1 is the loss function of the first target text model to be tested, y s is the label of the sth sentence, X is the original text, p is the distribution probability, and |N| is the length of the reference sentence data generated by the first target text model to be tested.
[0057] The loss function of the second target text model to be tested is obtained by the following formula:
[0058]
[0059] Among them, L2 is the loss function of the second target text model to be tested, y t is the tth character in the text, y 1:t-1 represents the first t-1 characters of the sentence, Y represents the summary data generated by the second target text model to be tested, and |Y| represents the length of the summary data generated by the second target text model to be tested.
[0060] In addition, in some embodiments of the present application, the first text model can be an extractive summarization model, and the second text model can be a generative summarization model. For example, both the extractive summarization model and the generative model can be BERT models or BERT-derived models. In actual application scenarios, an appropriate model can be selected for training based on actual conditions, and this application does not impose specific limitations here.
[0061] The following is an example of the specific process of the method for generating a text summary provided by the summary generation server 200 or the terminal device 100 in some embodiments of the present application, in combination with the target summary generation model obtained by training. It can be understood that in order to enable the summary generation server 200 or the terminal device 100 to have the summary generation function provided by the embodiments of the present application, it is necessary to deploy the target summary generation model obtained by training in the above manner on these devices. For details, please refer to the attached Figure 3 , Figure 3 Some embodiments of the present application provide a method for generating a text summary, the method comprising:
[0062] S310 , performing block processing on the initial text to obtain processed text data, wherein the text data includes at least two text data blocks, and each text data block is represented by a candidate sentence set.
[0063] In some embodiments of the present application, because the initial text is long, for example, exceeding the 512-word limit of the target summary generation model, it is considered a long text. To avoid the problem of information loss in the initial text, the initial text needs to be first segmented. That is, the initial text is divided into multiple text data blocks, where each text data block contains multiple candidate sentences.
[0064] In some embodiments of the present application, before S310 (not shown in the figure), the method for generating a text summary may include: performing data cleaning processing on at least part of the sentences in the original text to obtain the initial text, wherein the data cleaning processing includes: adjusting the sentence symbol format and removing at least one of noise information in the part of the sentences.
[0065] For example, as a specific example of the present application, taking the field of text processing as an example, a text (as a specific example of the original text) will include basic information of the relevant objects (as a specific example of noise information), such as name, ID number, mobile phone number and address information, and due to the reasons of the relevant objects or staff, there will also be punctuation errors, format errors and meaningless sentences in the text (as a specific example of noise information), such as: "For specific content, see the original text and [picture]" and other meaningless text. Therefore, in order to improve the accuracy and conciseness of the generated summary, the text needs to be cleaned before it is input into the target summary generation model. The data cleaning process includes: modifying punctuation errors in the text and unifying the half-width characters of punctuation marks into full-width characters; using regular expressions to match the basic information of the relevant objects such as name, ID number, mobile phone number and address information, and deleting them, as well as deleting meaningless sentences in the text content.
[0066] S320: Input the text data into a target summary generation model to obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract target information included in the text data, and the second target text model is used to generate the target summary according to the target information.
[0067] In some embodiments of the present application, S320 may specifically include: inputting the text data into the first target text model, obtaining the target information through the first target text model, wherein the target information is multiple target sentences filtered out from the text data; inputting the target information into the second target text model to obtain the target summary.
[0068] For example, in some embodiments of the present application, multiple text data blocks in the text data in S310 are input into the first target text model. The first target text model filters out a preset number of target sentences from each text data block, for example, 2 target sentences are filtered out from each text data block. Alternatively, the number of target sentences filtered out from each text data block may be inconsistent, for example, 2 target sentences are filtered out from the first text data block, 4 target sentences are filtered out from the second text data block, 3 target sentences are filtered out from the third text data block, and so on. The target sentences filtered out from all text data blocks are then combined into target information and input into the second target text model to obtain a target summary.
[0069] In some embodiments of the present application, obtaining the target information through the first target text model includes: scoring and sorting each sentence included in the j-th text data block in the text data to obtain a queue; selecting a preset number of sentences from the queue as the j-th target sentence set, wherein the j-th text data block is any one of the at least two text data blocks; repeating the above process to obtain the target sentence set corresponding to each text data block to obtain the multiple target sentences.
[0070] For example, as a specific example of the present application, a text is divided into 5 text data blocks, and each text data block contains 5 sentences. The first target text model scores and sorts the 5 sentences in each text data block. For example, a queue is formed according to the order of the scores of each sentence in the first text data block from large to small, and the first two sentences in the queue are selected from the queue to obtain the first target sentence set; a queue is formed according to the order of the scores of each sentence in the second text data block from large to small, and the first two sentences in the queue are selected from the queue to obtain the second target sentence set, and so on, until the fifth target sentence set is obtained. Finally, the sentences in the first target sentence set, the second target sentence set, the third target sentence set, the fourth target sentence set and the fifth target sentence set are spliced to obtain the target sentence set.
[0071] In other embodiments of the present application, a text is divided into five text data blocks, and the number of sentences contained in each text data block may be different, and the specific number can be set according to the actual situation. In addition, when scoring and sorting the sentences in each text data block, the sentences can be sorted from large to small according to the score of each sentence, or from small to large, or sentences with scores higher than the set score can be directly selected as target sentences. Specifically, it can be set according to the actual application scenario, and this application does not make any specific restrictions here.
[0072] In order to ensure that there are no errors in the numeric character strings in the obtained target summary, in some embodiments of the present application, after S320, the method for generating a text summary may include: S330 (not shown in the figure), respectively extracting the numeric character strings in the target summary and the initial text; based on the numeric character strings in the initial text, checking the numeric character strings in the target summary to obtain erroneous characters; replacing the erroneous characters according to the numeric character strings in the initial text to obtain the replaced target summary.
[0073] For example, as a specific example of the present application, after obtaining the target summary corresponding to the text, the detection algorithm (for example, the Levenstein edit distance algorithm) can be used to detect and correct the numeric strings in the target summary. First, the numeric strings in the initial text and the target summary are extracted using a regular expression, and then the Levenstein edit distance algorithm is used to calculate the Levenstein edit distance between the target summary and each numeric string in the initial text, and finally the numeric string in the target summary with the shortest Levenstein edit distance in the initial text is replaced with the numeric string in the target summary. In addition, in actual applications, since shorter numbers are less prone to errors, numbers with fewer than 3 digits in the target summary do not participate in this process. For numbers containing decimal points, in order to eliminate the interference of the decimal point on the edit distance, the decimal point is removed before the calculation and replacement are performed.
[0074] For example, as a specific example of the present application, by comparing the original text with the target abstract generated from the original text, it is found that "December 209" in the target abstract should be "December 2009", and there is an error here. After using the Levenshtein edit distance algorithm to replace the incorrect digital string, the replaced target abstract is obtained.
[0075] In order to obtain a target abstract with a standardized format and no redundant information, and improve the readability of the target abstract, in some embodiments of the present application, after S330, the method for generating a text abstract may include: S340 (not shown in the figure): performing data cleaning processing on the replaced target abstract to obtain a processed target abstract, where the data cleaning processing includes at least one of adjusting the sentence symbol format in the replaced target abstract and removing the noise information in the replaced target abstract.
[0076] For example, as a specific example of the present application, the generated target abstract includes redundant information such as incorrect use of names, mobile phone numbers, punctuation marks, and "Note: Template handling, details can be found in the original text". In order to obtain a concise and complete target abstract, it is necessary to perform data cleaning processing on the target abstract to obtain the final processed target abstract.
[0077] The following combines the attached Figure 4 Specifically elaborate Figure 1 the implementation process of the method for generating a text abstract executed by the abstract generation server 200 in the present application when generating an abstract.
[0078] The following takes extracting the abstract information of the text as an example and combines it with Figure 4 exemplarily elaborates the method for generating a text abstract provided by some embodiments of the present application.
[0079] Please refer to the attached Figure 4 , Figure 4 which is a block diagram of the composition of the device for generating a text abstract provided by some embodiments of the present application. It should be noted that the terminal device 100 has sent the text to the abstract generation server 200, and the target abstract generation model set by the generation server 200 is composed of a target extraction abstract model (as a specific example of the first target text model) and a target generation abstract model (as a specific example of the second target text model).
[0080] The following exemplarily elaborates the above process.
[0081] First, perform data cleaning processing on at least some sentences in the original text to obtain an initial text.
[0082] As a specific example of the present application, Figure 4The data pre-processing module 410 is configured to perform data cleaning on the original text to obtain the initial text, for example, adjusting punctuation formatting issues in the text, deleting meaningless redundant content, and deleting the accuser's information.
[0083] Second, the initial text is divided into blocks to obtain the processed text data.
[0084] As a specific example of the present application, since the original text of the text is long, the initial text obtained by the data pre-processing module is also long. Therefore, in order to ensure the integrity of the text, it is necessary to use the block module 420 to block the initial text of the text to obtain the text data after the block processing (that is, text data). For example, the text data after the block processing may include n text data blocks, where n is an integer greater than 1.
[0085] Third, the text data is input into the first target text model to obtain target information.
[0086] As a specific example of the present application, the above text data is input into the target extractive summarization model 430 to obtain text compression information (ie, target information) output by the target extractive summarization model 430 .
[0087] It should be understood that the target extractive summarization model 430 is obtained by training the extractive summarization model to be trained using the training dataset.
[0088] Fourth, the target information is input into the second target text model to obtain the target summary.
[0089] As a specific example of the present application, text compression information is input into the target generative summarization model 440 to obtain an initial text summary (i.e., a target summary) output by the target generative summarization model 440. It should be understood that the target generative summarization model 440 is obtained by training the generative summarization model to be trained using the training dataset.
[0090] Fifth, the target summary is subjected to data cleaning processing and digital string detection processing to obtain a processed target summary.
[0091] As a specific example of the present application, the initial text summary is input into the data post-processing module 450, which is at least configured to correct punctuation formatting problems of the initial text summary, remove redundant content in the initial text summary, and detect and correct digital string problems to obtain a text summary.
[0092] In addition, to demonstrate that the target summary generation model provided by some embodiments of the present application is more accurate and effective than the language model obtained based on the pre-trained language model, some embodiments of the present application input the original text data of a certain text into the language model and the target summary generation model of the present application, respectively, to obtain the target summary. After comparative analysis, the analysis results shown in Table 1 can be obtained. As can be seen from Table 1, under the three evaluation indicators (i.e., Rouge-1, Rouge-2, and Rouge-L), the target summary generation model provided by some embodiments of the present application has a higher score than the language model (i.e., the BertSumm model in Table 1). Obviously, the target summary generation model provided by some embodiments of the present application has better accuracy and application effect.
[0093] Table 1
[0094] Rouge-1 Rouge-2 Rouge-3 BertSumm Model 59.21 28.49 58.22 Target summary generation model 64.35 29.46 63.11
[0095] Please refer to Figure 5 , Figure 5 The following is a block diagram illustrating the components of a device for generating a text summary, provided in some embodiments of the present application. It should be understood that the device for generating a text summary corresponds to the aforementioned method embodiment and is capable of performing each of the steps involved in the aforementioned method embodiment. The specific functions of the device for generating a text summary can be found in the description above, and a detailed description is omitted here to avoid repetition.
[0096] Figure 5 The device for generating a text summary includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for generating a text summary. The device for generating a text summary includes: a text processing module 510, which is at least configured to perform block processing on the initial text and obtain processed text data, wherein the text data includes at least two text data blocks, and each text data block is represented by a set of candidate sentences. A summary generation module 520, which is at least configured to input the text data into a target summary generation model and obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract the target information included in the text data, and the second target text model is used to generate the target summary based on the target information.
[0097] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0098] Some embodiments of the present application also provide a system comprising one or more computers and one or more storage devices storing instructions, wherein when the instructions are executed by the one or more computers, the one or more computers perform the operations of the method of any of the above embodiments.
[0099] Some embodiments of the present application further provide one or more computer storage media storing instructions, which, when executed by one or more computers, enable the one or more computers to perform the operations of the method of any of the above embodiments.
[0100] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.
[0101] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0102] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
Claims
1. A method for generating a text summary, characterized in that: include: Performing block processing on the initial text to obtain processed text data, wherein the text data includes at least two text data blocks, and each text data block is represented by a set of candidate sentences; Inputting the text data into a target summary generation model to obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract target sentences from each text data block in the text data, and target information is obtained by splicing the target sentences in each text data block, and the second target text model is used to generate the target summary according to the target information; In the training phase for obtaining the first target text model and the second target text model, a non-end-to-end training method is used for the first text model and the second text model; in the verification phase, a joint verification method is used for the first target text model to be tested and the second target text model to be tested, specifically including: Input the text in the validation set into the first target text model to be tested, obtain reference sentence data output by the first target text model to be tested, input the reference sentence data into the second target text model to be tested, obtain summary data corresponding to the text output by the second target text model to be tested; based on the summary data and the reference summary data in the validation data set, optimize the parameters of the first target text model and the second target text model until it is confirmed that the first target text model and the second target text model pass the verification, thereby obtaining a target summary generation model; After obtaining the target summary, the method further includes: Extract the numeric strings from the target summary and the initial text respectively, remove the decimal points in the numeric strings, and the number of digits in the numeric strings is not less than 3; based on the numeric strings in the initial text, check the numeric strings in the target summary to obtain erroneous characters; replace the erroneous characters according to the numeric strings in the initial text to obtain a replaced target summary.
2. The method according to claim 1, wherein Before the initial text is divided into blocks and the processed text data is obtained, the method further includes: Performing data cleaning processing on at least part of the sentences in the original text to obtain the initial text, wherein the data cleaning processing includes: adjusting the sentence symbol format and removing noise information in the part of the sentences.
3. The method according to claim 2, wherein Before inputting the text data into the target summary generation model to obtain the target summary, the method further includes: Performing data processing on the acquired sample data to obtain a processed sample data set; Constructing a training dataset and a validation dataset based on the sample data set and the obtained reference summary set corresponding to the sample data set, wherein one piece of sample data corresponds to one reference summary; Using the training data set to train the first text model to obtain a first target text model to be tested, and using the training data set to train the second text model to obtain a second target text model to be tested; At least based on the verification data set, confirm that the first target text model to be tested and the second target text model to be tested pass the verification, and obtain the target summary generation model.
4. The method according to claim 3, wherein The step of confirming, at least based on the verification data set, that the first target text model to be tested and the second target text model to be tested pass verification, and obtaining the target summary generation model, includes: According to the verification data set and the loss function, obtaining a first target text model to be tested after adjusting parameters and a second target text model to be tested after adjusting parameters; The scores of the first target text model to be tested after the parameter adjustment and the second target text model to be tested after the parameter adjustment are obtained, and the target summary generation model is obtained according to the scores.
5. The method according to claim 2, wherein The step of inputting the text data into a target summary generation model to obtain a target summary includes: Inputting the text data into the first target text model, and acquiring the target information through the first target text model, wherein the target information is a plurality of target sentences screened from the text data; The target information is input into the second target text model to obtain the target summary.
6. The method according to claim 5, wherein The acquiring the target information through the first target text model includes: Scoring and sorting each sentence included in the j-th text data block in the text data to obtain a queue; Selecting a preset number of sentences from the queue as a j-th target sentence set, wherein the j-th text data block is any one of the at least two text data blocks; Repeat the above process to obtain a target sentence set corresponding to each text data block, thereby obtaining the plurality of target sentences.
7. The method according to claim 1, wherein After replacing the erroneous characters according to the numeric character string in the initial text to obtain the replaced target digest, the method further includes: Performing data cleaning processing on the replaced target summary to obtain a processed target summary, wherein the data cleaning processing includes: adjusting the sentence symbol format in the replaced target summary and removing noise information in the replaced target summary.
8. The method according to any one of claims 1 to 7, wherein: The first text model is an extractive summarization model, and the second text model is a generative summarization model.
9. A device for generating a text summary, characterized in that: The apparatus is configured to execute the method according to claim 1, comprising: a text processing module configured to perform block processing on the initial text to obtain processed text data, wherein the text data includes at least two text data blocks, each text data block being represented by a set of candidate sentences; The summary generation module is configured to input the text data into a target summary generation model to obtain a target summary, wherein the target summary generation model includes a first target text model and a second target text model, the first target text model is obtained by training a first text model, and the second target text model is obtained by training a second text model, the first target text model is used to extract target information included in the text data, and the second target text model is used to generate the target summary based on the target information.
10. One or more computer storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform the operations of the method of any one of claims 1-8.