Text Summarization Method, Apparatus, and Storage Medium

Through the method of extracting and generating text summary, the problem of quickly extracting important content from massive information is solved, achieving more accurate information extraction and effective savings in user time.

CN113486172BActive Publication Date: 2025-05-30BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110786087.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-12
Publication Date
2025-05-30
Estimated Expiration
2041-07-12

AI Technical Summary

Technical Problem

Intelligently and quickly extracting important content (i.e., abstracts) from massive information is an urgent problem, especially when users use news applications through their mobile phones, they need to quickly determine whether to continue reading the news to save time.

Method used

By obtaining the pending target text, the target character information and target sentence information of the target text are extracted, and a text summary is generated based on this information. The target character information and the target sentence information are used to represent the character information and sentence information in the target text that meets the preset importance level, and are processed through the pretrained feature extraction model and the abstract generation model.

Benefits of technology

It realizes more accurate generation of text summary, can accurately express the main content of the target text, improves the efficiency and accuracy of information extraction, and helps users quickly understand news content and save time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113486172B_ABST
    Figure CN113486172B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, an apparatus, and a storage medium for generating a text summary. The method includes: obtaining a target text to be processed; extracting target character information and target sentence information of the target text, where the target character information and the target sentence information are respectively used to characterize character information and sentence information in the target text that meet a preset importance level; and generating a text summary corresponding to the target text according to the target character information and the target sentence information. Thus, by extracting the target character information, relatively important characters in the target text can be located, and by extracting the target sentence information, relatively important sentences in the target text can be located. Introducing an evaluation of the importance levels of characters and sentences in the target text, considering the target text locally and globally, and selectively focusing on the content in the target text are beneficial to better summarize the target text to improve the accuracy of generating the text summary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of text processing, and in particular, to a method, apparatus, and storage medium for generating a text summary. Background Art

[0002] With the popularization of the Internet, the amount of information is increasing, and the massive information brings the problem of information overload to users. Therefore, it is an urgent problem to intelligently and quickly extract important content (i.e., summary) from the massive information. For example, when a user uses a news application on a mobile phone, the news summary can help the user quickly determine whether to continue reading the news, thereby effectively saving time for the user. Summary of the Invention

[0003] To overcome the problems existing in the related art, the present disclosure provides a method, apparatus, and storage medium for generating a text summary.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for generating a text summary is provided. The method includes:

[0005] Obtain a target text to be processed;

[0006] Extract target character information and target sentence information of the target text, where the target character information and the target sentence information are respectively used to characterize character information and sentence information in the target text that meet a preset importance level;

[0007] Generate a text summary corresponding to the target text according to the target character information and the target sentence information.

[0008] In some embodiments, the extracting target character information and target sentence information of the target text includes:

[0009] Perform a sentence splitting process on the target text to obtain a plurality of sentences;

[0010] Use a preset sentence start symbol and a preset sentence separator to splice the plurality of sentences to obtain a target string;

[0011] Input the target string into a pre-trained feature extraction model to obtain the target character information and the target sentence information.

[0012] In some embodiments, the method further includes:

[0013] Obtain the position information of each sentence in the target text;

[0014] The inputting the target string into a pre-trained feature extraction model to obtain the target character information and the target sentence information includes:

[0015] Input the target string and the position information into the feature extraction model to obtain the target character information and the target sentence information.

[0016] In some embodiments, the feature extraction model is obtained in the following manner:

[0017] Obtain a first training data set, where the first training data set includes training texts, training character information corresponding to the training texts, and training sentence information, and the training character information and the training sentence information are respectively used to represent character information and sentence information in the training texts that meet a preset importance level;

[0018] Use the first training data set to train a first preset model to obtain the feature extraction model.

[0019] In some embodiments, the step of using the first training data set to train the first preset model to obtain the feature extraction model includes:

[0020] Determine input information corresponding to the training text, where the input information at least includes strings obtained by performing sentence splitting on the training text;

[0021] Input the input information into the first preset model to obtain first character information and first sentence information output by the first preset model;

[0022] If the stop training condition of the first preset model is not satisfied, calculate a first loss value according to the first character information and the training character information, and calculate a second loss value according to the first sentence information and the training sentence information;

[0023] Update the first preset model at least according to the first loss value and the second loss value, and use the updated first preset model for the next training until the stop training condition of the first preset model is satisfied.

[0024] In some embodiments, the step of generating a text summary corresponding to the target text according to the target character information and the target sentence information includes:

[0025] Input the target character information and the target sentence information into a pre-trained summary generation model to determine the text summary corresponding to the target text.

[0026] In some embodiments, the summary generation model is obtained in the following manner:

[0027] Obtain a second training dataset, where the second training dataset includes specified text, second character information and second sentence information corresponding to the specified text, and summary information corresponding to the specified text; wherein, the second character information and the second sentence information are respectively used to characterize the character information and sentence information in the specified text that meet a preset importance level;

[0028] Use the second training dataset to train a second preset model to obtain the summary generation model.

[0029] In some embodiments, the using the second training dataset to train a second preset model to obtain the summary generation model includes:

[0030] Input the second character information and the second sentence information into the second preset model to obtain text information output by the second preset model;

[0031] Determine whether the stop training condition of the second preset model is satisfied;

[0032] If it is determined that the stop training condition of the second preset model is not satisfied, calculate a third loss value according to the text information and the summary information;

[0033] Update the second preset model at least according to the third loss value, and use the updated second preset model for the next training until the stop training condition of the second preset model is satisfied.

[0034] In some embodiments, the determining whether the stop training condition of the second preset model is satisfied includes:

[0035] Use a summary evaluation algorithm to score the second preset model used in this training to obtain a target score;

[0036] If the target score is less than or equal to a specified score, determine that the stop training condition of the model is not satisfied;

[0037] If the target score is greater than the specified score, determine that the stop training condition of the model is satisfied.

[0038] According to a second aspect of the present disclosure, there is provided a text summary generation device, the device includes:

[0039] A first acquisition module configured to acquire a target text to be processed;

[0040] An extraction module configured to extract target character information and target sentence information of the target text, where the target character information and the target sentence information are respectively used to characterize the character information and sentence information in the target text that meet a preset importance level;

[0041] An abstract generation module, configured to generate a text abstract corresponding to the target text according to the target character information and the target sentence information.

[0042] According to a third aspect of the present disclosure, there is provided a text abstract generation device, including:

[0043] A processor;

[0044] A memory for storing instructions executable by the processor;

[0045] Wherein, the processor is configured to:

[0046] Obtain a target text to be processed;

[0047] Extract target character information and target sentence information of the target text, where the target character information and the target sentence information are respectively used to characterize character information and sentence information in the target text that meet a preset importance level;

[0048] Generate a text abstract corresponding to the target text according to the target character information and the target sentence information.

[0049] According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the program instructions are executed by a processor, the steps of the method described in the first aspect of the present disclosure are implemented.

[0050] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0051] Obtain a target text to be processed, extract target character information and target sentence information of the target text, and then generate a text abstract corresponding to the target text according to the target character information and the target sentence information. Among them, the target character information and the target sentence information are respectively used to characterize character information and sentence information in the target text that meet a preset importance level. Thus, by extracting the target character information, the more important characters in the target text can be located, and by extracting the target sentence information, the more important sentences in the target text can be located. Introducing an evaluation of the importance of characters and sentences in the target text, considering the target text locally and globally, and selectively focusing on the content in the target text is beneficial to better summarize the target text and improve the accuracy of generating the text abstract.

[0052] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0054] Figure 1 It is a flowchart of a method for generating a text summary shown according to an exemplary embodiment.

[0055] Figure 2 It is a flowchart of another method for generating a text summary shown according to an exemplary embodiment.

[0056] Figure 3 It is an exemplary flowchart of a way to obtain a feature extraction model in the method for generating a text summary shown according to an exemplary embodiment.

[0057] Figure 4 It is an exemplary flowchart of a way to obtain a summary generation model in the method for generating a text summary shown according to an exemplary embodiment.

[0058] Figure 5 It is a block diagram of a device for generating a text summary shown according to an exemplary embodiment.

[0059] Figure 6 It is a block diagram of a device for generating a text summary shown according to an exemplary embodiment.

[0060] Figure 7 It is a block diagram of a device for generating a text summary shown according to an exemplary embodiment. Detailed implementation

[0061] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0062] Before introducing the method provided by the present disclosure, the application scenarios involved in each embodiment of the present disclosure will be introduced first. The application scenarios involved in the present disclosure can be any scenario that requires generating a summary for a certain text to extract important content from the text. The application scenarios can be content notifications (for example, the display of notification content of an application in the notification bar of an electronic device), text reading (for example, the text summary displayed at the top of a text reading page), etc. Taking the application scenario as a text reading scenario as an example, in the text reading page of a news application on a terminal, summary information can be generated for the news content of the current page, and the generated summary information can be displayed at the top of the page. Through the displayed summary information, users can quickly determine whether to continue reading the news, which can effectively save time for users. Exemplarily, the above terminal can be, for example, a mobile terminal such as a smart phone, a tablet computer, a smart watch, a smart bracelet, a PDA (Personal Digital Assistant), or a fixed terminal such as a desktop computer.

[0063] In related technologies, usually a relatively long text is input into a model for generating a summary to obtain the summary information output by the model. However, the overly long text will increase the difficulty of model encoding, resulting in the model being unable to focus on the truly important parts of the text. For example, instead of paying attention to important sentences (or words) in the text, it wrongly focuses on unimportant sentences (or words) in the text, resulting in a poor summary effect.

[0064] To solve the above technical problems, the present disclosure provides a text summary generation method, apparatus, and storage medium to improve the accuracy of generating text summaries.

[0065] Figure 1 is a flowchart of a text summary generation method shown according to an exemplary embodiment, as Figure 1 shown, the method may include the following steps:

[0066] In step 11, obtain a target text to be processed;

[0067] In step 12, extract target character information and target sentence information of the target text;

[0068] In step 13, generate a text summary corresponding to the target text according to the target character information and the target sentence information.

[0069] Among them, the target character information and the target sentence information are respectively used to characterize the character information and sentence information in the target text that meet the preset importance level. In the present disclosure, the preset importance level is a high importance level.

[0070] A piece of text is usually composed of at least one sentence, and each sentence is composed of at least one character. Obviously, the importance of each sentence and character in this piece of text is different. The more important the sentence or character is, the more it can represent this piece of text and the more likely it is to become part of the abstract of this piece of text. Similarly, in the target text, the higher the importance of a character or sentence, the more representative it is and the more likely it is to become part of the abstract corresponding to the target text.

[0071] The target character information is used to represent the character information in the target text that meets the preset importance level, that is, to represent the character information with a high importance level in the target text. The target sentence information is used to represent the sentence information in the target text that meets the preset importance level, that is, to represent the sentence information with a high importance level in the target text.

[0072] After extracting the representative target character information and target sentence information in the target text, and then generating the text abstract corresponding to the target text according to the target character information and target sentence information, it can ensure that the generated text abstract is representative and can accurately express the main content of the target text.

[0073] Through the above technical solution, the target text to be processed is obtained, and the target character information and target sentence information of the target text are extracted. Then, according to the target character information and target sentence information, the text abstract corresponding to the target text is generated. Among them, the target character information and target sentence information are respectively used to represent the character information and sentence information in the target text that meet the preset importance level. Thus, by extracting the target character information, the more important characters in the target text can be located. And by extracting the target sentence information, the more important sentences in the target text can be located. Introducing the evaluation of the importance of characters and sentences in the target text, considering the target text locally and globally, and selectively focusing on the content in the target text is beneficial to better summarize the target text to improve the accuracy of generating the text abstract.

[0074] To enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present invention, the above steps and related content will be described in more detail below.

[0075] In a possible implementation manner, step 12 may include the following steps, as Figure 2 shown.

[0076] In step 21, the target text is segmented into multiple clauses.

[0077] In step 22, using the preset clause start symbol and preset clause separator, the multiple clauses are concatenated to obtain the target string.

[0078] In step 23, the target string is input into the pre-trained feature extraction model to obtain target character information and target sentence information.

[0079] The sentence splitting process for the target text can use the commonly used sentence splitting methods currently. For example, when a specified punctuation mark (such as a period, comma, exclamation mark, question mark, ellipsis, etc.) is recognized, the sentence is split at that position.

[0080] In step 22, the sentence start symbol and the sentence separator can be predefined. The sentence start symbol is placed at the start of the sentence splitting, and the sentence separator is placed between two sentences to splice the multiple sentences obtained in step 21 to obtain the target string.

[0081] Exemplarily, the multiple sentences can be spliced in the order of their appearance in the target text to obtain the target string. Again, for example, the sentences obtained in step 21 can be spliced in a random order.

[0082] For example, assume that the sentence composition of the target text is {dd1, dd2, dd3, dd4, dd5}, where dd1 to dd5 respectively represent the sentences in the target text (the commas only serve as separators and have no actual meaning), and assume that the sentence start symbol is set as [CLS] and the sentence separator is set as [SEP]. Then, a possible splicing result (i.e., the target string) can be:

[0083] [CLS]dd1[SEP][CLS]dd2[SEP][CLS]dd3[SEP][CLS]dd4[SEP][CLS]dd5[SEP].

[0084] After obtaining the target string, the target string can be input into the pre-trained feature extraction model to obtain target character information and target sentence information.

[0085] In a possible embodiment, the target string can be directly input into the feature extraction model to obtain target character information and target sentence information.

[0086] Exemplarily, the feature extraction model can be trained in the following way:

[0087] Obtain the first training dataset;

[0088] Use the first training dataset to train the first preset model to obtain the feature extraction model.

[0089] Among them, the first training data set may include multiple groups of data, where each group of data may include training text, training character information corresponding to the training text, and training sentence information. The training character information is used to represent the character information in the training text that meets the preset importance level, and the training sentence information is used to represent the sentence information in the training text that meets the preset importance level. The description of the preset importance level has been given above and will not be repeated here.

[0090] The training character information can be obtained through the abstract corresponding to the training text (hereinafter referred to as the training text abstract). For a piece of training text, the training text abstract corresponding to the training text can be obtained (for example, the training text abstract can be manually extracted). Furthermore, the characters in the training text that can match the characters included in the training text abstract can be determined to form the training character information. Among them, the character matching can be that the characters are the same or have a high degree of similarity.

[0091] Exemplarily, the training character information can be implemented by means of annotation. When annotating, the annotation rules can be specified in advance. For example, a first label used to indicate that the character is not in the training text abstract, a second label used to indicate that the character is at the beginning of the specified character (or character combination) in the training text abstract, and a third label used to indicate that the character is not at the beginning of the specified character combination in the training text abstract can be set. Based on the above rule settings, the characters labeled with the second label and the third label will be extracted as the training character information. Therefore, based on the above-specified annotation rules, assuming that the character composition of the training text is {A1 A2A3 A4A5 A6A7A8 A9 A10}, and the training text abstract corresponding to the training text is {A2A3A6A7A8A10}, where A1 to A10 are the characters in the training text respectively. Then, the manual annotation result can be: A1, A4, A5, A9 correspond to the first label, A2, A6, A10 correspond to the second label, and A3, A7, A8 correspond to the third label. Furthermore, the training character information can be determined as A2A3A6A7A8A10 (the order is not limited).

[0092] The training sentence information corresponding to the training text can also be obtained from the training text summary. First, the training text is segmented into sentences, and then each sentence in the training text is scored for its importance. After obtaining the importance scores of each sentence, the training sentence information can be extracted. Among them, the score corresponding to each sentence can be determined by calculating the similarity between the sentence and the training summary, and the higher the similarity, the higher the score. Exemplarily, the ROUGE-L score of each sentence can be calculated to score the sentences in the training text. Among them, Rouge is short for Recall-Oriented Understudy for Gisting Evaluation, which is a set of metrics for evaluating automatic summarization and machine translation. By comparing a specified text (i.e., a sentence) with a set of reference summaries (i.e., the training text summary), the corresponding score is obtained to measure the similarity between the automatically generated summary or translation and the reference summary.

[0093] After obtaining the first training dataset based on the above method, the first preset model can be trained using the first training dataset, and then a feature extraction model can be obtained.

[0094] Exemplarily, training the first preset model using the first training dataset to obtain a feature extraction model may include the following steps, as Figure 3 shown:

[0095] In step 31, determine the input information corresponding to the training text;

[0096] In step 32, input the input information into the first preset model to obtain the first character information and the first sentence information output by the first preset model;

[0097] In step 33, if the stop training condition of the first preset model is not satisfied, calculate the first loss value according to the first character information and the training character information, and calculate the second loss value according to the first sentence information and the training sentence information;

[0098] In step 34, update the first preset model at least according to the first loss value and the second loss value, and use the updated first preset model for the next training until the stop training condition of the first preset model is satisfied.

[0099] Among them, the input information at least includes the string obtained by segmenting the training text into sentences. Exemplarily, the training text can be segmented into sentences, and the resulting string can be used as the input information.

[0100] After obtaining the output information, the input information is input into the first preset model to obtain the first character information and the first sentence information output by the first preset model. Exemplarily, the first preset model may be an encoder model, such as BERT (Bidirectional Encoder Representations from Transformers, representing the bidirectional encoder representation of the Transformer model).

[0101] After obtaining the first character information and the first sentence information, it can be determined whether the current training meets the stop training condition of the first preset model. Among them, the stop training condition of the first preset model can be set in advance. For example, it can be set to determine whether the stop training condition of the first preset model is met by any one of the training duration, the number of training times, and the loss value. Exemplarily, the stop training condition of the first preset model can be that the training duration reaches a specified duration. For another example, the stop training condition of the first preset model can be that the number of training times reaches a specified number. For another example, the stop training condition of the first preset model can be that the model loss is less than a specified threshold.

[0102] Exemplarily, the above first loss value and second loss value can be calculated based on the cross-entropy loss function. And it is common knowledge in the art to update the internal parameters of the model based on the loss value, which will not be elaborated here.

[0103] The above steps 31 to 34 can be regarded as the steps in a training process. In one training, after determining the training text to be used in this training, steps 31 and 32 are executed in sequence to obtain the content output by the first preset model used in this training, and then it is determined whether the stop training condition of the first preset model is met. If it is met, the model used in this training can be used as the trained model, that is, the feature extraction model. If it is not met, the first loss value and the second loss value are obtained through step 33, and then the updated first preset model is obtained through step 34, and the updated first preset model is used for the next training. Thus, in the next training, according to the training text to be used in this training and the updated first preset model, start from step 31 again to continue the model training until the stop training condition of the second preset model is met.

[0104] In another possible implementation manner, in order to improve the extraction accuracy of the target character information and the target sentence information, additional information can also be provided for the feature extraction model to use. In this implementation manner, the position information of each sub-clause in the target text can be obtained first to identify the occurrence position of the sub-clause in the target text. Correspondingly, step 23 may include the following steps:

[0105] Input the target string and location information into the feature extraction model to obtain the target character information and target sentence information.

[0106] Generally, the position where a sentence appears in a text is somewhat related to the importance of the sentence. For example, summary texts usually appear in the first or last sentence of a text. Therefore, not only the target string representing the target text is input into the feature extraction model, but also the position where each clause in the target text appears is input simultaneously, so as to provide richer information for the feature extraction model and facilitate the feature extraction model to output more accurate target character information and target sentence information.

[0107] It should be noted that in this embodiment, the model training method is the same as that in steps 31 to 34 provided above. The difference is that in this embodiment, the input information used in the training process includes not only the strings obtained by clause splitting the training text, but also the position information of each clause in the training text.

[0108] Return to Figure 1 In step 13, according to the target character information and target sentence information, generate a text summary corresponding to the target text.

[0109] In a possible implementation manner, step 13 may include the following steps:

[0110] Input the target character information and target sentence information into the pre-trained summary generation model to determine the text summary corresponding to the target text.

[0111] Exemplarily, the summary generation model can be trained in the following way:

[0112] Obtain the second training data set;

[0113] Use the second training data set to train the second preset model to obtain the summary generation model.

[0114] Among them, the second training data set may include multiple groups of data. Each group of data may include a specified text, second character information and second sentence information corresponding to the specified text, and summary information corresponding to the specified text.

[0115] The second character information is used to represent the character information in the specified text that meets the preset importance level, and the second sentence information is used to represent the sentence information in the specified text that meets the preset importance level. The description of the preset importance level has been given above and will not be repeated here.

[0116] Exemplarily, with reference to the method for determining training character information for the training text given above, the second character information corresponding to the specified text can be determined, and with reference to the method for determining training sentence information for the training text given above, the second sentence information corresponding to the specified text can be determined.

[0117] For another example, the specified text can be input into the first preset model (or, the feature extraction model), and the second character information and the second sentence information can be obtained according to the output content of the model.

[0118] After obtaining the second training dataset, the second preset model can be trained using the second training dataset to obtain the abstract generation model.

[0119] Exemplarily, training the second preset model using the second training dataset to obtain the abstract generation model can include the following steps, as Figure 4 shown:

[0120] In step 41, the second character information and the second sentence information are input into the second preset model to obtain the text information output by the second preset model;

[0121] In step 42, it is determined whether the stop training condition of the second preset model is satisfied;

[0122] In step 43, if it is determined that the stop training condition of the second preset model is not satisfied, the third loss value is calculated according to the text information and the abstract information;

[0123] In step 44, at least the second preset model is updated according to the third loss value, and the updated second preset model is used for the next training until the stop training condition of the second preset model is satisfied.

[0124] In some embodiments, exemplarily, the second preset model can be a decoder model, that is, the decoder of the Transformer model.

[0125] In a possible implementation manner, the stop training condition of the second preset model in step 42 can be set in advance. That is, the stop training condition of the second preset model can be set in advance. For example, it can be set to determine whether the stop training condition of the second preset model is satisfied through any one of the training duration, the number of training times, and the loss value. Exemplarily, the stop training condition of the second preset model can be that the training duration reaches the specified duration. For another example, the stop training condition of the second preset model can be that the number of training times reaches the specified number. For another example, the stop training condition of the second preset model can be that the model loss is less than the specified threshold.

[0126] In another possible implementation manner, step 42 can include the following steps:

[0127] Using the abstract evaluation algorithm, score the second preset model used in this training to obtain the target score;

[0128] If the target score is less than or equal to the specified score, it is determined that the model stopping training condition is not satisfied;

[0129] If the target score is greater than the specified score, it is determined that the model stopping training condition is satisfied.

[0130] Exemplarily, the scoring of the preset model used in this training can also be performed based on the calculation of the ROUGE-L score. For example, input a piece of text into the preset model used in this training to obtain the text content output by the preset model, and calculate the ROUGE-L score between the text output by the model and the abstract corresponding to this piece of text to obtain the target score of the preset model used this time.

[0131] After obtaining the target score, compare the target score with the specified score. Among them, the specified score can be freely set according to actual needs. For example, set it to a specified value. For another example, the specified score can be the maximum value of the scores of each intermediate model in multiple training processes since the initial training of the preset model began. In this way, the model with the best score since the start of training can be selected as the final abstract generation model.

[0132] Exemplarily, the above third loss value can be calculated based on the cross-entropy loss function. And updating the internal parameters of the model based on the loss value belongs to the common knowledge in the art and will not be elaborated here.

[0133] Steps 41 to 44 above can be regarded as the steps in a training process. In a training process, after determining the second character information and the second sentence information to be used in this training, execute step 41 to obtain the text information output by the second preset model used in this training, and then determine whether the model stopping training condition of the second preset model is satisfied through step 42. If satisfied, the model used in this training can be used as the trained model, that is, the abstract generation model. If not satisfied, calculate the third loss value through step 43, then obtain the updated second preset model through step 44, and use the updated second preset model for the next training. Thus, in the next training, according to the second character information, the second sentence information, and the updated second preset model that should be used in this training, start from step 41 again to continue the model training until the model stopping training condition of the second preset model is satisfied.

[0134] It should be noted that, in one possible case, the first preset model and the second preset model can be trained separately according to the steps provided above to obtain a feature extraction model and a summary generation model, and their training processes are independent of each other and do not affect each other. In another possible case, the first preset model and the second preset model can be jointly trained in the same Transformer model. In this case, the specified text in the second training dataset is the training text in the first training dataset, and the training process can be described as follows:

[0135] Determine the input information corresponding to the training text;

[0136] Input the input information into the first preset model used in this training to obtain the first character information and the first sentence information output by the first preset model;

[0137] Input the obtained first character information and first sentence information (as the second character information and second sentence information described in step 41) into the second preset model used in this training to obtain the text information output by the second preset model;

[0138] If the stop training condition is not met, update the first preset model and the second preset model according to the first loss value, the second loss value, and the third loss value until the stop training condition is met.

[0139] Among them, the judgment of whether the above stop training condition is met can refer to step 42.

[0140] In the above manner, the feature extraction model and the summary generation model are trained simultaneously to enhance the data processing correlation between the two models and facilitate obtaining a more accurate text summary.

[0141] Figure 5 It is a block diagram of a text summary generation device shown according to an exemplary embodiment. As Figure 5 shown, the device 50 may include:

[0142] The first acquisition module 51 is configured to acquire the target text to be processed;

[0143] The extraction module 52 is configured to extract the target character information and target sentence information of the target text, and the target character information and target sentence information are respectively used to characterize the character information and sentence information in the target text that meet the preset importance level;

[0144] The summary generation module 53 is configured to generate a text summary corresponding to the target text according to the target character information and the target sentence information.

[0145] In some embodiments, the extraction module 52 includes:

[0146] A sentence splitting sub-module, configured to split the target text into sentences to obtain multiple sentences;

[0147] A splicing sub-module, configured to splice the multiple sentences by using a preset sentence starting symbol and a preset sentence separator to obtain a target string;

[0148] A first processing sub-module, configured to input the target string into a pre-trained feature extraction model to obtain the target character information and the target sentence information.

[0149] In some embodiments, the apparatus 50 further includes:

[0150] A second acquisition module, configured to acquire the position information of each sentence in the target text;

[0151] The first processing sub-module is used to input the target string and the position information into the feature extraction model to obtain the target character information and the target sentence information.

[0152] In some embodiments, the feature extraction model is obtained through the following modules:

[0153] A third acquisition module, configured to acquire a first training data set, where the first training data set includes training texts, training character information and training sentence information corresponding to the training texts, and the training character information and the training sentence information are respectively used to characterize the character information and sentence information that meet the preset importance degree in the training texts;

[0154] A first training module, configured to train a first preset model by using the first training data set to obtain the feature extraction model.

[0155] In some embodiments, the first training module includes:

[0156] A first determination sub-module, configured to determine input information corresponding to the training text, where the input information at least includes a string obtained by splitting the training text into sentences;

[0157] A second processing sub-module, configured to input the input information into the first preset model to obtain first character information and first sentence information output by the first preset model;

[0158] A first calculation sub-module, configured to, if the stop training condition of the first preset model is not satisfied, calculate a first loss value according to the first character information and the training character information, and calculate a second loss value according to the first sentence information and the training sentence information;

[0159] The first update sub-module is configured to update the first preset model at least according to the first loss value and the second loss value, and use the updated first preset model for the next training until the stop training condition of the first preset model is satisfied.

[0160] In some embodiments, the summary generation module 53 includes:

[0161] The third processing sub-module is configured to input the target character information and the target sentence information into a pre-trained summary generation model to determine the text summary corresponding to the target text.

[0162] In some embodiments, the summary generation model is obtained through the following modules:

[0163] The fourth acquisition module is configured to acquire a second training data set, where the second training data set includes a specified text, second character information and second sentence information corresponding to the specified text, and summary information corresponding to the specified text; wherein, the second character information and the second sentence information are respectively used to characterize the character information and sentence information in the specified text that meet a preset importance level;

[0164] The second training module is configured to train a second preset model using the second training data set to obtain the summary generation model.

[0165] In some embodiments, the second training module includes:

[0166] The fourth processing sub-module is configured to input the second character information and the second sentence information into the second preset model to obtain text information output by the second preset model;

[0167] The judgment sub-module is configured to judge whether the stop training condition of the second preset model is satisfied;

[0168] The second calculation sub-module is configured to, if it is determined that the stop training condition of the second preset model is not satisfied, calculate a third loss value according to the text information and the summary information;

[0169] The second update sub-module is configured to update the second preset model at least according to the third loss value, and use the updated second preset model for the next training until the stop training condition of the second preset model is satisfied.

[0170] In some embodiments, the determination sub-module is configured to: use an abstract evaluation algorithm to score the second preset model used in the current training to obtain a target score; if the target score is less than or equal to a specified score, determine that the model stopping training condition is not satisfied; if the target score is greater than the specified score, determine that the model stopping training condition is satisfied.

[0171] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0172] The present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the program instructions are executed by a processor, the steps of the text abstract generation method provided by the present disclosure are implemented.

[0173] Figure 6 FIG. is a block diagram of a text abstract generation device 800 shown according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0174] Referring to Figure 6 , the device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0175] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above text abstract generation method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0176] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0177] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.

[0178] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0179] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0180] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0181] The sensor assembly 814 includes one or more sensors for providing an assessment of various aspects of the status of the device 800. For example, the sensor assembly 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and a change in the temperature of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0182] The communication component 816 is configured to facilitate communication between the device 800 and other devices in a wired or wireless manner. The device 800 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0183] In an exemplary embodiment, the device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described text summary generation method.

[0184] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 804 including instructions, is also provided, and the above instructions can be executed by a processor 820 of the device 800 to complete the above-described text summary generation method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0185] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device. The computer program has a code portion for performing the above-described text summarization method when executed by the programmable device.

[0186] Figure 7 FIG. 4 is a block diagram of a text summarization device 1900 shown in accordance with an exemplary embodiment. For example, the device 1900 may be provided as a server. Referring to Figure 7 FIG. 4, the device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above-described text summarization method. The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.

[0187] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are to be considered as exemplary only, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0188] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating a text summary, characterized in that, the method includes: obtaining a target text to be processed; performing sentence splitting on the target text to obtain multiple sentences, and extracting target character information and target sentence information of the target text based on the multiple sentences, where the target character information and the target sentence information are respectively used to characterize character information and sentence information in the target text that meet a preset importance level; wherein, the target character information and the target sentence information are obtained by inputting a target string into a pre-trained feature extraction model, and the target string is generated by placing a preset sentence start symbol at the start of each sentence and a preset sentence separator between two sentences; inputting the target character information and the target sentence information into a pre-trained summary generation model to determine the text summary corresponding to the target text.

2. The method according to claim 1, characterized in that, the method further includes: obtaining the position information of each sentence in the target text; the step of inputting the target string into the pre-trained feature extraction model to obtain the target character information and the target sentence information includes: inputting the target string and the position information into the feature extraction model to obtain the target character information and the target sentence information.

3. The method according to claim 1, characterized in that, the feature extraction model is obtained by the following method: obtaining a first training data set, where the first training data set includes training texts, training character information corresponding to the training texts, and training sentence information, and the training character information and the training sentence information are respectively used to characterize character information and sentence information in the training texts that meet a preset importance level; using the first training data set to train a first preset model to obtain the feature extraction model.

4. The method according to claim 3, characterized in that, the step of using the first training data set to train the first preset model to obtain the feature extraction model includes: determining input information corresponding to the training text, where the input information at least includes a string obtained by performing sentence splitting on the training text; inputting the input information into the first preset model to obtain first character information and first sentence information output by the first preset model; if the stop training condition of the first preset model is not met, calculating a first loss value according to the first character information and the training character information, and calculating a second loss value according to the first sentence information and the training sentence information; updating the first preset model at least according to the first loss value and the second loss value, and using the updated first preset model for the next training until the stop training condition of the first preset model is met.

5. The method according to claim 1, characterized in that, the summary generation model is obtained by the following method: Obtain a second training dataset, where the second training dataset includes specified text, second character information and second sentence information corresponding to the specified text, and summary information corresponding to the specified text; wherein, the second character information and the second sentence information are respectively used to characterize the character information and sentence information in the specified text that meet a preset importance level; Train a second preset model using the second training dataset to obtain the summary generation model.

6. The method according to claim 5, wherein, the training the second preset model using the second training dataset to obtain the summary generation model includes: Input the second character information and the second sentence information into the second preset model to obtain text information output by the second preset model; Determine whether the stop training condition of the second preset model is satisfied; If it is determined that the stop training condition of the second preset model is not satisfied, calculate a third loss value according to the text information and the summary information; Update the second preset model at least according to the third loss value, and use the updated second preset model for the next training until the stop training condition of the second preset model is satisfied.

7. The method according to claim 6, wherein, the determining whether the stop training condition of the second preset model is satisfied includes: Use a summary evaluation algorithm to score the second preset model used in this training to obtain a target score; If the target score is less than or equal to a specified score, determine that the stop training condition of the model is not satisfied; If the target score is greater than the specified score, determine that the stop training condition of the model is satisfied.

8. A text summary generation device, wherein, the device includes: A first acquisition module configured to acquire a target text to be processed; An extraction module configured to perform clause splitting on the target text to obtain a plurality of clauses, and extract target character information and target sentence information of the target text based on the plurality of clauses, where the target character information and the target sentence information are respectively used to characterize the character information and sentence information in the target text that meet a preset importance level; wherein, the target character information and the target sentence information are obtained by inputting a target string into a pre-trained feature extraction model, and the target string is generated by placing a preset clause start symbol at the start of the clause and a preset clause separator between two clauses; A summary generation module configured to input the target character information and the target sentence information into a pre-trained summary generation model to determine the text summary corresponding to the target text.

9. A text summary generation device, wherein, it includes: A processor; A memory for storing instructions executable by the processor; wherein, the processor is configured to: Acquire a target text to be processed; Perform clause segmentation on the target text to obtain multiple clauses, and extract the target character information and target sentence information of the target text based on the multiple clauses. The target character information and target sentence information are respectively used to represent the character information and sentence information that meet the preset importance level in the target text. Among them, the target character information and the target sentence information are obtained by inputting the target string into a pre-trained feature extraction model. The target string is generated by placing a preset clause start symbol at the start of the clause and a preset clause separator between two clauses. Input the target character information and the target sentence information into a pre-trained abstract generation model to determine the text abstract corresponding to the target text.

10. A computer-readable storage medium, on which computer program instructions are stored, Characterized in that, When the program instructions are executed by a processor, the steps of the method according to any one of claims 1-8 are implemented.

Citation Information

Patent Citations

  • Method for quickly extracting text abstract

    CN110287309A

  • Text abstract extraction method and device, server and readable storage medium

    CN110781291A

  • Text abstract extraction method and device

    CN111125348A

  • Statement text segmentation method, apparatus and device, and computer readable storage medium

    CN112101003A

  • Keyword generation method and device, electronic equipment and computer storage medium

    CN112667800A