Text processing method and device
By performing multiple rounds of abstract extraction and splicing of the to-process text, combining the target type text units in the text, the target summary is determined, which solves the problems of many abstract content, excessive complexity and weak generalization in the prior art, and achieves more accurate and coherent text summary generation.
Patent Information
- Application Number
- CN202411970241.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-15
AI Technical Summary
When generating text summary, the prior art is prone to problems such as excessive, excessive and weak generalization of the summary, or ignore important information for the sake of simplicity, resulting in incoherence of the content, unable to ensure the central idea of the text, and deviating from the true meaning of the text expression.
The initial summary is obtained by performing the first summary extraction of the to be processed text, and then splicing it and performing the summary extraction again to obtain the intermediate summary. At the same time, obtain the target type text unit in the text, such as a subtitle, and determine the final target summary based on the probability values in the initial summary, intermediate summary and target type text unit.
Improves the accuracy and coherence of text summary, ensuring that the length of the summary is within a reasonable range, thereby improving the user experience.
Smart Images

Figure CN119829761A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202311862648.5 filed on December 29, 2023, with invention name “Text processing method and device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence technology, and in particular to a text processing method. The present application also relates to a text processing device, a computing device, and a computer-readable storage medium. Background Art
[0003] With the development of Internet technology, text summarization is an important research field in natural language processing. It can extract shorter texts containing key information from longer texts, and plays an important role in intelligent question-answering robots, news summaries, landing page summaries and other fields.
[0004] In the prior art, an automatic target text summarization algorithm can be used to effectively compress and refine text content, so as to extract relevant information that meets the needs from massive information.
[0005] However, in the process of summarizing long texts using the above method, on the one hand, in order to ensure the integrity of the content, it is easy to have problems such as too much content, too much complexity, and weak generalization. On the other hand, in order to make the summary concise enough, it is easy to ignore important information, resulting in incoherent content, and unable to ensure the central idea of the text, resulting in deviation from the true meaning of the text. Therefore, an effective method is urgently needed to solve such problems. Summary of the invention
[0006] In view of this, the embodiment of the present application provides a text processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a text processing device, a computing device, and a computer-readable storage medium.
[0007] According to a first aspect of an embodiment of the present application, a text processing method is provided, comprising: Extracting summaries from the text to be processed to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively; Performing summary extraction on the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary; Obtaining target type text units contained in the text to be processed; In a case where the target type text unit is included in the at least two initial summaries, a target summary of the text to be processed is determined from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value.
[0008] According to a second aspect of an embodiment of the present application, there is provided a text processing device, including: A first extraction module is configured to extract a summary of the text to be processed, and obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively; A second extraction module is configured to perform summary extraction on the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary; An acquisition module is configured to acquire a target type text unit contained in the text to be processed; The determination module is configured to determine the target summary of the text to be processed among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value when the at least two initial summaries contain the target type text unit.
[0009] According to a third aspect of an embodiment of the present application, a computing device is provided, including: Memory and processor; The memory is used to store computer-executable instructions, and the processor implements the steps of the text processing method when executing the computer-executable instructions.
[0010] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the text processing method are implemented.
[0011] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the text processing method when executed by the chip.
[0012] The text processing method provided by the present application extracts a summary of a text to be processed to obtain at least two initial summaries and first probability values respectively corresponding to the at least two initial summaries, extracts a summary of the splicing result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary, obtains a target type text unit contained in the text to be processed, and when the at least two initial summaries contain the target type text unit, determines the target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value.
[0013] The embodiment of the present application obtains an intermediate summary of the text to be processed by splicing the initial summary obtained by the first summary extraction of the text to be processed, and performs a second summary extraction on the splicing result. In addition, the embodiment of the present application can also obtain the target type text unit contained in the text to be processed to determine the target summary of the text to be processed among the initial summary, the intermediate summary and the target type text unit. When the text to be processed is a long text, this processing method is conducive to ensuring the accuracy and coherence of the extraction result of the target summary, and is also conducive to controlling the length of the extracted target summary to ensure that its length is within a reasonable range, thereby helping to improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a structural schematic diagram of a text processing method provided by an embodiment of the present application; Figure 2 is a flowchart of a text processing method provided by an embodiment of the present application; Figure 3 This is a schematic diagram of a news text summary extraction process provided by an embodiment of the present application; Figure 4 It is a processing flow chart of a text processing method applied to a news scenario provided by an embodiment of the present application; Figure 5 is a structural schematic diagram of a text processing device provided by an embodiment of the present application; Figure 6 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0015] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0016] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0017] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0018] First, the terms involved in one or more embodiments of the present invention are explained.
[0019] Text summarization: refers to the extraction, summary or refinement of key information from a text or a collection of texts to summarize and display the main content or gist of the original text.
[0020] Question answering model: A model trained using question answering data.
[0021] In the present application, a text processing method is provided. The present application also relates to a text processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0022] See also Figure 1 The structural schematic diagram of the text processing process shown in the figure, by inputting the text to be processed into the question-answering model, so as to extract the summary of the text to be processed through the question-answering model, and obtaining at least two initial summaries of the text to be processed and the first probability values corresponding to the at least two initial summaries respectively; then the at least two initial summaries are spliced, and the splicing result is input into the question-answering model for summary extraction, so as to obtain one or at least two intermediate summaries of the text to be processed, and the second probability value corresponding to each intermediate summary; in addition, the text to be processed can also be input into the outline extraction model for outline extraction to obtain the outline content of the text to be processed, wherein the outline content is composed of the target type text units contained in the text to be processed, namely, subheadings. Therefore, finally, the initial summary, the intermediate summary and the subheading can be comprehensively processed according to the first probability value and the second probability value to obtain the target summary of the text to be processed.
[0023] Figure 2A flowchart of a text processing method provided according to an embodiment of the present application is shown, which specifically includes the following steps: Step S202: extracting a summary of the text to be processed to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries.
[0024] Specifically, the text to be processed is the text from which the summary needs to be extracted. The text to be processed includes but is not limited to a sentence, a paragraph, multiple paragraphs, an article or multiple articles, and other texts of various lengths, and can be texts in different languages such as simplified Chinese, traditional Chinese, English, Tibetan, etc., and can be document files in different formats (such as txt, doc / docx, xls / xlsx, ppt / pptx, pdf format documents), etc. This application does not impose any restrictions on this.
[0025] Existing text summarization includes the following forms: (1) Extractive Summarization Extractive summarization is to extract a few sentences from the text to form a summary. The advantage of extractive summarization is that it is not easy to produce text that completely deviates from the main idea of the article.
[0026] The current cutting-edge technology for extractive summarization is to use BERT-related models to extract summaries, such as the BertSum model.
[0027] (2) Generative Summarization Generative summarization is to use an end-to-end model to directly generate summaries from text. The cutting-edge technology of generative summarization is mainly the seq2seq+attention model. Currently, most of the models used in the implementation of generative summarization are improvements based on the transformer model.
[0028] (3) Hybrid Text Summarization Hybrid text summarization mainly extracts some sentences from the original text, and then inputs the extracted sentences into the generative summary processing model to obtain a generative summary.
[0029] The summary of the embodiment of the present application is an extractive summary. In the process of extracting the summary of the processed text, the summary extraction process can be performed on the processed text through a summary extraction tool, or the summary extraction process can be performed through a model.
[0030] In the specific implementation, in order to ensure the accuracy of the abstract extraction result, multiple abstracts can be extracted from the text to be processed, and at least two of the multiple abstracts can be selected as the initial abstracts of the text to be processed, that is, the text to be processed is abstracted to obtain at least two initial abstracts and the first probability values corresponding to the at least two initial abstracts, which can be implemented in the following way: Extracting abstracts from the text to be processed to obtain at least two abstracts to be screened and first probability values corresponding to the at least two abstracts to be screened respectively; The at least two abstracts to be screened are sorted according to the first probability value, and at least two initial abstracts of the at least two abstracts to be screened and the first probability values respectively corresponding to the at least two initial abstracts are determined according to the sorting result.
[0031] Specifically, as described above, the embodiment of the present application can extract a summary of the text to be processed through a summary extraction tool or a model. When extracting a summary of the text to be processed through the summary extraction tool or the model, the text to be processed can first be input into the summary extraction tool or the model, and the summary extraction tool or the model performs summary extraction processing on the text to be processed and outputs a corresponding extraction result. The extraction result can include at least two summaries to be screened, and a first probability value corresponding to each of the at least two summaries to be screened; the first probability value is used to characterize the probability of the summary to be screened being the target summary of the text to be processed.
[0032] After obtaining at least two abstracts to be screened and their corresponding first probability values, the abstracts to be screened can be sorted according to the size of the first probability values and in descending order, and then a certain number of abstracts to be screened with top rankings are selected from the at least two abstracts to be screened according to the sorting result as initial abstracts of the text to be processed.
[0033] In actual applications, the total length of the initial summaries can be set in advance, that is, the word count threshold corresponding to the contents of at least two initial summaries, for example, it can be set to 300 words or 1000 words, etc., and then the summaries to be screened that meet the conditions are screened according to the sorting results. First, the summary to be screened that ranks first in the sorting results is selected, and it is determined whether its word count is greater than the preset threshold. If not, continue to select the summary to be screened that ranks second, and determine whether the sum of the total word counts of the summary to be screened that ranks first and the summary to be screened that ranks second is greater than the preset word count threshold, and so on, until the word count threshold is reached, then the selected summary to be screened that ranks in the front position is used as the initial summary.
[0034] Usually, to avoid missing important sentences, the word count threshold of the initial summary can be set larger, usually 1,000 words, with the goal of selecting as much summary content as possible.
[0035] Alternatively, after obtaining at least two abstracts to be screened and their corresponding first probability values, the abstract to be screened whose first probability value is greater than a preset probability threshold may be used as the initial abstract of the text to be processed.
[0036] The embodiment of the present application first determines the abstracts to be screened of the text to be processed, and then determines the abstract with a larger probability from the abstracts to be screened as the initial abstract according to the probability values corresponding to the abstracts to be screened, so as to further determine the target abstract of the text to be processed based on the initial abstract, which is conducive to ensuring the accuracy and credibility of the determined target abstract.
[0037] In a specific implementation, when extracting a summary of a text to be processed using a question-answering model, extracting a summary of the text to be processed, obtaining at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively, includes: The text to be processed is input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model, and first probability values corresponding to the at least two initial summaries respectively.
[0038] Specifically, the question-answering model provided in the embodiment of the present application uses text and questions as training samples and the answers to the questions in the text as sample labels to train and generate a question-answering model to be trained, and the question-answering model can be a BERT model or other model that can implement natural language processing.
[0039] Since the question-answering model has the advantage of being able to accurately locate the answer to a question, applying it to text summary extraction can also accurately locate the main content of the text.
[0040] Therefore, the embodiment of the present application can input the text to be processed into the question-answering model, and the question-answering model extracts the summary of the text to be processed and generates the corresponding extraction result. Among them, the extraction result can include the probability of each word unit in the text to be processed as the starting position of the summary and the probability of each word unit as the ending position of the summary, so as to filter the initial summary of the text to be processed according to the probability corresponding to each word unit, and the first probability value corresponding to the initial summary can be the sum of the probability values corresponding to the starting position word unit and the ending position word unit in the initial summary.
[0041] Alternatively, when extracting a summary of the text to be processed by using the question-answering model, extracting a summary of the text to be processed to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively include: Determine the starting sliding position of the text to be processed; Based on the starting sliding position, sliding the feature extraction window in the text to be processed according to a preset sliding step length, and taking at least two text segments extracted by the feature extraction window during the sliding process as a text segment set of the text to be processed; Abstracts are extracted from at least two text segments included in the text segment set to obtain at least two initial abstracts and first probability values corresponding to the at least two initial abstracts.
[0042] Furthermore, summary extraction is performed on at least two text fragments included in the text fragment set respectively to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries. Specifically, the at least two text fragments included in the text fragment set can be respectively input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model and first probability values corresponding to the at least two initial summaries; that is, summary extraction is performed on each of the at least two text fragments included in the text fragment set to obtain an initial summary corresponding to each text fragment and a first probability value corresponding to the initial summary; for example, when there are two extracted text fragments, two initial summaries corresponding to the two text fragments and a first probability value corresponding to each initial summary will be obtained.
[0043] Specifically, since the maximum length of the input of the question-answering model only supports 512 characters, when the length of the text to be processed is long, that is, the number of characters contained in the text to be processed is greater than 512, it is necessary to divide the text to be processed into segments before inputting it into the question-answering model. Specifically, this can be done by using a sliding window method, in which the first character of the text to be processed is used as the starting sliding position of the feature extraction window, and the feature extraction window starts from the starting sliding position and slides in the text to be processed according to a preset sliding step size, so as to truncate the text to be processed into multiple short texts, wherein the preset sliding step size is less than or equal to the length of the feature extraction window.
[0044] In practical applications, the text segments extracted by the feature extraction window during the sliding process can be used as the text segment set of the text to be processed, and at least two text segments contained in the text segment set can be respectively input into the question-answering model, and the question-answering model extracts the summary of each text segment and generates the corresponding extraction result. The extraction result can include the probability of each word unit in the text segment as the starting position of the summary and the probability of each word unit as the ending position of the summary, so as to filter the initial summary of the text to be processed according to the probability corresponding to each word unit, and the first probability value corresponding to the initial summary can be the sum of the probability values corresponding to the word unit at the starting position and the word unit at the ending position in the initial summary.
[0045] The embodiment of the present application filters the abstracts to be screened to filter out the abstracts with smaller probability values, which is beneficial to improving the quality of the initial abstracts, reducing the interference of low-quality initial abstracts on the abstract extraction of the processed text, and is beneficial to improving the accuracy of the target abstract extraction results of the processed text.
[0046] Step S204: extracting a summary from the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary.
[0047] Specifically, after obtaining at least two initial summaries and the first probability values corresponding to at least two initial summaries respectively, the initial summaries can be spliced according to their positions in the text to be processed, and summary extraction can be performed on the splicing results to obtain one or at least two intermediate summaries of the text to be processed, and the second probability values corresponding to each intermediate summary can be used to characterize the accuracy of the intermediate summary as a summary of the text to be processed.
[0048] In a specific implementation, when a question-answering model is used to extract a summary of the text to be processed, a summary is extracted from the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary, including: The at least two initial summaries are concatenated, and the concatenation result is input into the question-answering model for summary extraction processing to obtain an intermediate summary of the text to be processed output by the question-answering model, and a second probability value corresponding to the intermediate summary.
[0049] Specifically, if the text to be processed is input into the question-answering model, and the question-answering model is used to extract a summary of the text to be processed, and the initial summary of the text to be processed and the first probability value corresponding to each initial summary are obtained, then after the initial summaries are spliced to obtain the corresponding splicing results, the splicing results can also be input into the question-answering model to continue summary extraction, and the intermediate summary of the text to be processed and the second probability value corresponding to each intermediate summary are obtained.
[0050] In an embodiment of the present application, when the text to be processed is long, it is necessary to cut the text to be processed into short text segments through a sliding window, and determine the initial summary of the text to be processed in turn based on each short text. However, since the correlation between the short texts is not considered in the process of determining the initial summary, the accuracy of the determined initial summary may be low. In an embodiment of the present application, the initial summaries are spliced together and the splicing result is input into the question-answering model again for summary extraction. During this extraction process, the question-answering model extracts the intermediate summary according to the correlation between the initial summaries, which is conducive to ensuring the accuracy and credibility of the target summary subsequently determined based on the initial summary and the intermediate summary.
[0051] Step S206, obtaining the target type text unit contained in the text to be processed.
[0052] Specifically, the target type text unit may be a subheading contained in the text to be processed, and the target type text unit is composed of a certain number of continuous word units in the text to be processed.
[0053] Among them, because the text to be processed needs to be segmented into language units such as words, punctuation marks, numbers or letters before any actual processing is done on it, these units are called word units. For English text, a word unit can be a word, a punctuation mark, a number, etc. For Chinese text, the smallest word unit can be a word, a character, a punctuation mark, a number, etc.
[0054] In the embodiment of the present application, the target type text unit contained in the text to be processed is obtained, that is, the subheading contained in the text to be processed is obtained. Therefore, obtaining the target type text unit contained in the text to be processed includes: The text to be processed is input into an outline extraction model for processing, and a target type text unit of the text to be processed output by the outline extraction model is obtained.
[0055] Specifically, since the outline, i.e., the general outline or key points, specifically refers to the key points of the entire article, or specifically refers to the key points of the systematic arrangement of works, lectures, plans, etc., and has a certain logic, therefore, in the embodiment of the present application, if the text to be processed contains subheadings, the outline of the text to be processed can be determined based on the subheadings.
[0056] Specifically, when the text to be processed contains subheadings, the text to be processed can be input into an outline extraction model, so that the outline extraction model can be used to process the text to be processed to obtain the outline information contained in the text to be processed, and the outline information is composed of the subheadings contained in the text to be processed.
[0057] Since the subheading itself is a summary of part of the content of the text to be processed, in the embodiment of the present application, obtaining the subheadings contained in the text to be processed and subsequently determining the target summary of the text to be processed based on the subheadings, the initial summary and the intermediate summary is conducive to improving the accuracy of the target summary. And using the outline extraction model to extract outline information is conducive to ensuring the accuracy of the extraction result.
[0058] Step S208, when the at least two initial summaries include the target type text unit, determine the target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value.
[0059] Specifically, when an initial summary, an intermediate summary and a target type text unit are obtained, the target summary of the text to be processed can be determined from at least two initial summaries, intermediate summaries and / or target type text units according to the first probability value and the second probability value.
[0060] In a specific implementation, determining the target summary of the to-be-processed text from among the at least two initial summaries, the intermediate summaries and / or the target type text units according to the first probability value and the second probability value includes: Sorting the at least two initial summaries in descending order according to the first probability value to generate a corresponding first sorting result; Determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit; If yes, the target type text unit is determined as the target summary of the text to be processed; If not, a target summary of the to-be-processed text is determined from the at least two initial summaries and the intermediate summaries according to the first probability value and the second probability value.
[0061] Alternatively, when the result of determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit is no, the method further includes: sorting the intermediate summaries in descending order according to the second probability values to generate a corresponding second sorting result; Determining whether the intermediate summary of the target position in the second sorting result is consistent with the target type text unit; If so, the target type text unit is determined as the target summary of the text to be processed.
[0062] Specifically, as mentioned above, since the target type text unit can be a subheading, therefore, in order to determine the target summary of the text to be processed among at least two initial summaries, intermediate summaries and / or target type text units, it is necessary to first determine whether the subheading can be used as the target summary of the text to be processed. Specifically, all the extracted outline information is traversed to determine the subheadings contained in the outline information, and the probability value corresponding to each subheading is determined.
[0063] Among them, to determine the probability value corresponding to the subheading, specifically, each subheading can be compared with the initial summary or the intermediate summary, and when it is determined that the initial summary contains the subheading, or the initial summary is consistent with the subheading, the first probability value corresponding to the initial summary can be used as the probability value of the subheading, or, when it is determined that the intermediate summary contains the subheading, or the intermediate summary is consistent with the subheading, the second probability value corresponding to the intermediate summary can be used as the probability value of the subheading.
[0064] Then, at least two initial summaries can be sorted in descending order according to the first probability value to generate a corresponding first sorting result, and determine whether the initial summary ranked first (target position) in the first sorting result contains the target subheading in each subheading, or whether it is consistent with the target subheading in each subheading. If it is included or consistent, the target subheading is determined as the target summary of the text to be processed, that is, as mentioned above, the probability value corresponding to the target subheading is consistent with the first probability value corresponding to the initial summary. Then, when the first probability value of the initial summary ranked first is the largest, the probability value corresponding to the target subheading is also the largest among all subheadings. At this time, the target subheading can be determined as the target summary of the text to be processed; if it is not included or inconsistent, the summary with a larger probability value can be selected from the initial summary and the intermediate summary according to the first probability value and the second probability value as the target summary of the text to be processed.
[0065] Alternatively, when determining that in the first sorting result, the initial summary ranked first (target position) does not contain the target subheading in each subheading, or is inconsistent with the target subheading, the intermediate summaries can be sorted in descending order according to the second probability value to generate the corresponding second sorting result, and determine whether the intermediate summary ranked first (target position) in the second sorting result contains the target subheading in each subheading, or is consistent with the target subheading in each subheading. If it does, the target subheading is determined as the target summary of the text to be processed. As above, when the probability value corresponding to the target subheading is consistent with the second probability value corresponding to the intermediate summary, then when the second probability value of the intermediate summary ranked first is the largest, the probability value corresponding to the target subheading is also the largest among all subheadings. At this time, the target subheading can be determined as the target summary of the text to be processed; if it does not contain or is inconsistent, the summary with a larger probability value can be selected from the initial summary and the intermediate summary according to the first probability value and the second probability value as the target summary of the text to be processed.
[0066] Since the subheading itself is a summary of part of the content of the text to be processed, in an embodiment of the present application, obtaining the subheadings contained in the text to be processed, and subsequently determining the target summary of the text to be processed based on the subheadings, initial summary and intermediate summary, is conducive to improving the accuracy of the target summary.
[0067] Specifically, the specific implementation method of selecting the summary with a larger probability value from the initial summary and the intermediate summary as the target summary of the text to be processed is as follows: The step of determining a target summary of the to-be-processed text from among the at least two initial summaries and the intermediate summaries according to the first probability value and the second probability value includes: According to the first probability value and the second probability value, among the at least two initial summaries and the intermediate summaries, an initial summaries or intermediate summaries whose probability values satisfy a preset probability condition is determined as a target summaries of the text to be processed.
[0068] Among them, the preset probability condition can be set according to actual needs. For example, the preset probability condition can be the condition of the initial summary or intermediate summary with the largest probability value, or the condition of the initial summary or intermediate summary with a probability value greater than or equal to a preset probability threshold (such as ninety percent), or the condition of the top three initial summaries or intermediate summaries after sorting in order from large to small.
[0069] In the embodiments of the present specification, taking the condition that the preset probability condition is the initial summary or the intermediate summary with the largest probability value as an example, a detailed description is given of determining, according to the first probability value and the second probability value, the initial summary or the intermediate summary whose probability value satisfies the preset probability condition among the at least two initial summaries and the intermediate summaries as the target summary of the text to be processed.
[0070] Specifically, at least two initial summaries and intermediate summaries are sorted in descending order according to the first probability value and the second probability value, and then the first-ranked initial summary or intermediate summary is determined as the target summary of the text to be processed.
[0071] In the text processing method provided in the embodiments of the present specification, when the target summary of the text to be processed cannot be determined based on the subheadings, in order to ensure the accuracy of the acquired target summary, a suitable summary can be selected as the target summary from at least two initial summaries or intermediate summaries using first probability values corresponding to at least two initial summaries and second probability values corresponding to the intermediate summary, thereby improving the accuracy of the target summary.
[0072] In a specific implementation, in order to ensure the coherence of the target summary determined from the initial summary, the intermediate summary and / or the target type text unit, determining the target summary of the to-be-processed text from the at least two initial summaries, the intermediate summary and / or the target type text unit according to the first probability value and the second probability value includes: Determine, according to the first probability value and the second probability value, a reference abstract of the text to be processed from among the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; A target abstract of the text to be processed is determined according to the reference abstract and text units in the text to be processed that are associated with the reference abstract.
[0073] Alternatively, determining a target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value includes: According to the first probability value and the second probability value, determining a first reference abstract of the text to be processed from the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; Determine a first target abstract of the text to be processed according to the first reference abstract and text units in the text to be processed that are associated with the first reference abstract; In the case where the first target summary does not satisfy a preset condition, determining a second reference summary of the to-be-processed text from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value; A second target summary of the text to be processed is determined based on the first target summary, the second reference summary and a text unit in the text to be processed that is associated with the second reference summary, and if the second target summary meets a preset condition, the second target summary is determined as the target summary of the text to be processed.
[0074] Specifically, in order to ensure the coherence and readability of the target summary, the transition words contained in the initial summary or the target summary, such as however, but, so, therefore, and the like, may be removed first, and then the initial summary may be sorted in descending order according to the first probability value to generate a first sorting result, and the intermediate summaries may be sorted in descending order according to the second probability value to generate a second sorting result, and then the initial summary ranked first in the first sorting result or the intermediate summary ranked first in the second sorting result may be used as the first reference summary, and text units associated with the first reference summary may be extracted from the text to be processed, specifically, the previous sentence and the next sentence of the first reference summary may be extracted from the text to be processed, and the length of the summary text may be limited using the preset word count threshold of the target summary, and finally the sentences may be sorted according to the sentence index to obtain the final target summary.
[0075] In specific implementation, the text to be processed includes news text; Correspondingly, determining a target summary of the to-be-processed text from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value includes: According to the first probability value and the second probability value, a target summary of the news text is determined from among the at least two initial summaries, the intermediate summaries and / or the target type text unit.
[0076] Specifically, in the news field, users usually read the news title first when browsing news of interest. If the news title can arouse interest, they will click on the news to browse the specific content. However, in order to increase user retention time, most existing news usually goes into too much detail before getting to the point. For users, browsing a lot of useless information will waste a lot of time. If the main content of the news can be extracted for users, it will help users save a lot of time and allow users to browse more news and obtain more information in a limited time.
[0077] The current existing technology can only extract sentences that are similar or related to news headlines, but cannot extract sentences that are consistent with the semantic content expressed in the title. In addition, when using models for information extraction, the training corpus used for model training is scarce. There are many short text summaries in Chinese, but long text summaries in Chinese are very scarce. It is impossible to directly use summary corpus data to train a good long text summary model. In addition, most of the existing cutting-edge technologies focus on the research of generative summaries, and there are relatively few studies on extractive summaries. However, due to the limitations of generative summaries, they cannot be applied in many real scenarios.
[0078] Based on this, the embodiment of the present application adopts an extractive method, the application scenario is the news field, and the main technology used is intelligent question answering. The schematic diagram of the summary extraction process of a news text provided by the embodiment of the present application is as follows Figure 3 shown.
[0079] Specifically, intelligent question-answering technology will be applied to text summary extraction in the news field. The first summary of the news text will be extracted through the question-answering model, and the initial summaries obtained will be spliced. The spliced results will be subjected to a second summary extraction through the question-answering model to obtain the intermediate summary of the news text.
[0080] Since the question-answering model usually locates all possible answer spans of the question, that is, the starting position of the answer, and then takes the answer with the highest probability as the final answer result. However, this does not meet the task goal of extracting key sentences from the text summary. Therefore, it needs to be processed. The specific processing flow is as follows: 1. Filter out the probability ranking results of all answer spans and locate the sentence where the answer is located.
[0081] 2. Set a word limit. You can first set it to 300 words (that is, the word count of the abstract obtained cannot exceed 300 words), and then select sentences based on the probability sorting results until the word limit is reached. In general, the word limit of the initial abstract is larger, usually set to 1,000 words, in order to select as much content as possible and avoid missing important sentences. The input of the second question-answering model is the splicing result of the initial abstract. If the question-answering model is a BERT model, the length of the text input to the question-answering model at one time is limited. When the article is long, the text needs to be cut into multiple samples using segments of text through a sliding window. When comparing sentence probabilities, the comparability of sentences between multiple samples is relatively poor, and the comparability of sentences within a sample is relatively strong. Therefore, by using the sentences extracted by the first question-answering model to organize them into paragraphs and then pass them through the question-answering model again, most sentences can be compared in one sample, which increases the credibility of the extracted abstract.
[0082] In addition, the embodiment of the present application can also use the outline extraction model to obtain the subheadings contained in the news text, so as to comprehensively process the initial summary, the intermediate summary and the target type text unit to obtain the target summary of the news text.
[0083] The comprehensive processing module receives data from three directions, including: the first question-answering model processing results, the second question-answering model processing results, and the text outline extraction results (i.e. the news subheading extraction results). The module first needs to determine whether the subheading can be used as the target summary, and then it needs to ensure the coherence of the target summary.
[0084] In order to ensure the accuracy of the summary content of the target summary, we first need to traverse all the extracted outline contents and obtain the sentence probability value corresponding to each subheading. If the probability value ranks first among all the sentences in the entire article, it is considered that the outline text composed of subheadings can be used as the summary content of this article. When judging, the sentence with the highest probability in the first question-answering model processing result and the sentence with the highest probability in the second question-answering model processing result, as long as one of them is in the extracted outline, it is considered that the outline text can be used as the summary content of this article.
[0085] In addition, to ensure the coherence and readability of the target summary, the transition words contained in the initial summary or intermediate summary, such as however, but, so, therefore, and also, can be deleted; then the sentences with the highest probability ranking are selected, and the previous and next sentences of these sentences are extracted from the news text, and then the length of the summary text is limited by the number of words, and finally the sentences are sorted according to the sentence index to obtain the final summary.
[0086] When the news text is a long text, this processing method is helpful to ensure the accuracy and coherence of the target summary extraction results, and at the same time it is helpful to control the length of the extracted target summary to ensure that its length is within a reasonable range, thereby improving the user experience.
[0087] The text processing method provided by the present application extracts a summary of a text to be processed to obtain at least two initial summaries and first probability values respectively corresponding to the at least two initial summaries, extracts a summary of the splicing result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary, obtains a target type text unit contained in the text to be processed, and when the at least two initial summaries contain the target type text unit, determines the target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value.
[0088] The embodiment of the present application obtains an intermediate summary of the text to be processed by splicing the initial summary obtained by the first summary extraction of the text to be processed, and performs a second summary extraction on the splicing result. In addition, the embodiment of the present application can also obtain the target type text unit contained in the text to be processed to determine the target summary of the text to be processed among the initial summary, the intermediate summary and the target type text unit. When the text to be processed is a long text, this processing method is conducive to ensuring the accuracy and coherence of the extraction result of the target summary, and is also conducive to controlling the length of the extracted target summary to ensure that its length is within a reasonable range, thereby helping to improve the user experience.
[0089] The following combination Figure 4 Taking the application of the text processing method provided in this application to extract the summary of news text as an example, the text processing method is further explained. Figure 4 A processing flow chart of a text processing method applied to a news scenario provided by an embodiment of the present application is shown, which specifically includes the following steps.
[0090] Step 402: Input the news text into the question-answering model for summary extraction, and obtain at least two to-be-screened summaries of the news text output by the question-answering model, and first probability values corresponding to the at least two to-be-screened summaries.
[0091] Step 404: sort the at least two abstracts to be screened according to the first probability value, and determine at least two initial abstracts of the at least two abstracts to be screened and the first probability values respectively corresponding to the at least two initial abstracts according to the sorting result.
[0092] Step 406, concatenate at least two initial summaries, and input the concatenation result into the question-answering model for summary extraction processing, to obtain an intermediate summary of the news text output by the question-answering model, and a second probability value corresponding to the intermediate summary.
[0093] Step 408, input the news text into the outline extraction model for processing, and obtain the subheadings of the news text output by the outline extraction model.
[0094] Step 410: When at least two initial summaries contain subheadings, the at least two initial summaries are sorted in descending order according to the first probability values to generate a corresponding first sorting result.
[0095] Step 412: Determine whether the initial abstract ranked first in the first sorting result is consistent with the subtitle.
[0096] If not, execute step 414; if so, execute step 420.
[0097] Step 414: sort the intermediate summaries in descending order according to the second probability values to generate a corresponding second sorting result.
[0098] Step 416, determining whether the first-ranked intermediate abstract in the second sorting result is consistent with the subtitle.
[0099] If not, execute step 418; if so, execute step 420.
[0100] Step 418, determining a target summary of the news text from at least two initial summaries and intermediate summaries according to the first probability value and the second probability value.
[0101] Step 420, determining the subheading as the target summary of the news text.
[0102] The embodiment of the present application splices the initial summaries obtained by performing a first summary extraction on the news text, and performs a second summary extraction on the splicing result to obtain an intermediate summary of the news text. In addition, the embodiment of the present application can also obtain the target type text unit contained in the news text to determine the target summary of the news text among the initial summary, the intermediate summary and the target type text unit. When the news text is a long text, this processing method is conducive to ensuring the accuracy and coherence of the extraction results of the target summary, and is also conducive to controlling the length of the extracted target summary to ensure that its length is within a reasonable range, thereby helping to improve the user experience.
[0103] Corresponding to the above method embodiment, the present application also provides a text processing device embodiment, Figure 5 FIG. 1 shows a schematic diagram of the structure of a text processing device provided by an embodiment of the present application. Figure 5 As shown, the device comprises: The first extraction module 502 is configured to extract a summary of the text to be processed, and obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively; A second extraction module 504 is configured to perform summary extraction on the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary; An acquisition module 506 is configured to acquire a target type text unit contained in the text to be processed; The determination module 508 is configured to determine the target summary of the text to be processed among the at least two initial summaries, the intermediate summaries and / or the target type text unit based on the first probability value and the second probability value when the at least two initial summaries contain the target type text unit.
[0104] Optionally, the first extraction module 502 is further configured to: Extracting abstracts from the text to be processed to obtain at least two abstracts to be screened and first probability values corresponding to the at least two abstracts to be screened respectively; The at least two abstracts to be screened are sorted according to the first probability value, and at least two initial abstracts of the at least two abstracts to be screened and the first probability values respectively corresponding to the at least two initial abstracts are determined according to the sorting result.
[0105] Optionally, the determining module 508 is further configured to: Sorting the at least two initial summaries in descending order according to the first probability value to generate a corresponding first sorting result; Determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit; If so, the target type text unit is determined as the target summary of the text to be processed.
[0106] Optionally, the determining module 508 is further configured to: sorting the intermediate summaries in descending order according to the second probability values to generate a corresponding second sorting result; Determining whether the intermediate summary of the target position in the second sorting result is consistent with the target type text unit; If so, the target type text unit is determined as the target summary of the text to be processed.
[0107] Optionally, the determining module 508 is further configured to: According to the first probability value and the second probability value, a target summary of the to-be-processed text is determined from among the at least two initial summaries and the intermediate summaries.
[0108] Optionally, the acquisition module 506 is further configured to: The text to be processed is input into an outline extraction model for processing, and a target type text unit of the text to be processed output by the outline extraction model is obtained.
[0109] Optionally, the determining module 508 is further configured to: Determine, according to the first probability value and the second probability value, a reference abstract of the text to be processed from among the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; A target abstract of the text to be processed is determined according to the reference abstract and text units in the text to be processed that are associated with the reference abstract.
[0110] Optionally, the determining module 508 is further configured to: According to the first probability value and the second probability value, determining a first reference abstract of the text to be processed from the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; Determine a first target summary of the text to be processed according to the first reference summary and text units in the text to be processed that are associated with the first reference summary; In the case where the first target summary does not satisfy a preset condition, determining a second reference summary of the to-be-processed text from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value; A second target summary of the text to be processed is determined based on the first target summary, the second reference summary and a text unit in the text to be processed that is associated with the second reference summary, and if the second target summary meets a preset condition, the second target summary is determined as the target summary of the text to be processed.
[0111] Optionally, the first extraction module 502 is further configured to: The text to be processed is input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model, and first probability values corresponding to the at least two initial summaries respectively.
[0112] Optionally, the second extraction module 504 is further configured to: The at least two initial summaries are concatenated, and the concatenation result is input into the question-answering model for summary extraction processing to obtain an intermediate summary of the text to be processed output by the question-answering model, and a second probability value corresponding to the intermediate summary.
[0113] Optionally, the first extraction module 502 is further configured to: Determine the starting sliding position of the text to be processed; Based on the starting sliding position, sliding the feature extraction window in the text to be processed according to a preset sliding step length, and taking at least two text segments extracted by the feature extraction window during the sliding process as a text segment set of the text to be processed; Abstracts are extracted from at least two text segments included in the text segment set to obtain at least two initial abstracts and first probability values corresponding to the at least two initial abstracts.
[0114] Optionally, the first extraction module 502 is further configured to: At least two text fragments included in the text fragment set are respectively input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model, and first probability values corresponding to the at least two initial summaries.
[0115] Optionally, the determining module 508 is further configured to: According to the first probability value and the second probability value, among the at least two initial summaries and the intermediate summaries, an initial summaries or intermediate summaries whose probability values satisfy a preset probability condition is determined as a target summaries of the text to be processed.
[0116] The above is a schematic scheme of a text processing device of the present embodiment. It should be noted that the technical scheme of the text processing device and the technical scheme of the above-mentioned text processing method belong to the same concept. For details not described in detail in the technical scheme of the text processing device, please refer to the description of the technical scheme of the above-mentioned text processing method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0117] Figure 6The block diagram of a computing device 600 according to an embodiment of the present application is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.
[0118] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0119] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0120] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.
[0121] The processor 620 is used to execute computer executable instructions of the text processing method.
[0122] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above text processing method.
[0123] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used in a text processing method when executed by a processor.
[0124] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above text processing method.
[0125] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0126] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the text processing method when executed by the chip.
[0127] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0128] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0129] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A text processing method, characterized in that: include: Extracting summaries from the text to be processed to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively; Performing summary extraction on the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary; Obtaining target type text units contained in the text to be processed; In a case where the target type text unit is included in the at least two initial summaries, a target summary of the text to be processed is determined from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value.
2. The text processing method according to claim 1, characterized in that: The extracting summary of the text to be processed to obtain at least two initial summaries and first probability values respectively corresponding to the at least two initial summaries includes: Extracting abstracts from the text to be processed to obtain at least two abstracts to be screened and first probability values corresponding to the at least two abstracts to be screened respectively; The at least two abstracts to be screened are sorted according to the first probability value, and at least two initial abstracts of the at least two abstracts to be screened and the first probability values respectively corresponding to the at least two initial abstracts are determined according to the sorting result.
3. The text processing method according to claim 1, characterized in that: The step of determining a target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value includes: Sorting the at least two initial summaries in descending order according to the first probability value to generate a corresponding first sorting result; Determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit; If so, the target type text unit is determined as the target summary of the text to be processed.
4. The text processing method according to claim 3, characterized in that: When the result of determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit is no, the method further includes: sorting the intermediate summaries in descending order according to the second probability values to generate a corresponding second sorting result; Determining whether the intermediate summary of the target position in the second sorting result is consistent with the target type text unit; If so, the target type text unit is determined as the target summary of the text to be processed.
5. The text processing method according to claim 3, characterized in that: In the case where the result of determining whether the initial summary of the target position in the first sorting result is consistent with the target type text unit is no, the method further includes: According to the first probability value and the second probability value, a target summary of the to-be-processed text is determined from among the at least two initial summaries and the intermediate summaries.
6. The text processing method according to claim 1, characterized in that: The step of obtaining a target type text unit contained in the text to be processed includes: The text to be processed is input into an outline extraction model for processing, and a target type text unit of the text to be processed output by the outline extraction model is obtained.
7. The text processing method according to claim 1, characterized in that: The step of determining a target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value includes: Determine, according to the first probability value and the second probability value, a reference abstract of the text to be processed from among the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; A target abstract of the text to be processed is determined according to the reference abstract and text units in the text to be processed that are associated with the reference abstract.
8. The text processing method according to claim 1, characterized in that: The step of determining a target summary of the text to be processed from the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value includes: According to the first probability value and the second probability value, determining a first reference abstract of the text to be processed from the at least two initial abstracts, the intermediate abstracts and / or the target type text unit; Determine a first target abstract of the text to be processed according to the first reference abstract and text units in the text to be processed that are associated with the first reference abstract; In the case where the first target summary does not satisfy a preset condition, determining a second reference summary of the to-be-processed text from among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value; A second target summary of the text to be processed is determined based on the first target summary, the second reference summary and a text unit in the text to be processed that is associated with the second reference summary, and if the second target summary meets a preset condition, the second target summary is determined as the target summary of the text to be processed.
9. The text processing method according to claim 1, characterized in that: The extracting summary of the text to be processed to obtain at least two initial summaries and first probability values respectively corresponding to the at least two initial summaries includes: The text to be processed is input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model, and first probability values corresponding to the at least two initial summaries respectively.
10. The text processing method according to claim 9, characterized in that: The extracting a summary from the splicing result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary includes: The at least two initial summaries are concatenated, and the concatenation result is input into the question-answering model for summary extraction processing to obtain an intermediate summary of the text to be processed output by the question-answering model, and a second probability value corresponding to the intermediate summary.
11. The text processing method according to claim 1, characterized in that: The extracting summary of the text to be processed to obtain at least two initial summaries and first probability values respectively corresponding to the at least two initial summaries includes: Determine the starting sliding position of the text to be processed; Based on the starting sliding position, sliding the feature extraction window in the text to be processed according to a preset sliding step length, and taking at least two text segments extracted by the feature extraction window during the sliding process as a text segment set of the text to be processed; Abstracts are extracted from at least two text segments included in the text segment set to obtain at least two initial abstracts and first probability values corresponding to the at least two initial abstracts.
12. The text processing method according to claim 11, characterized in that: The extracting summaries of the at least two text segments included in the text segment set to obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively includes: At least two text fragments included in the text fragment set are respectively input into the question-answering model for summary extraction processing to obtain at least two initial summaries of the text to be processed output by the question-answering model, and first probability values corresponding to the at least two initial summaries.
13. The text processing method according to claim 5, characterized in that: The step of determining a target summary of the to-be-processed text from among the at least two initial summaries and the intermediate summaries according to the first probability value and the second probability value includes: According to the first probability value and the second probability value, among the at least two initial summaries and the intermediate summaries, an initial summaries or intermediate summaries whose probability values satisfy a preset probability condition is determined as a target summaries of the text to be processed.
14. A text processing device, characterized in that: include: A first extraction module is configured to extract a summary of the text to be processed, and obtain at least two initial summaries and first probability values corresponding to the at least two initial summaries respectively; A second extraction module is configured to perform summary extraction on the concatenation result of the at least two initial summaries to obtain an intermediate summary and a second probability value corresponding to the intermediate summary; An acquisition module is configured to acquire a target type text unit contained in the text to be processed; The determination module is configured to determine the target summary of the text to be processed among the at least two initial summaries, the intermediate summaries and / or the target type text unit according to the first probability value and the second probability value when the at least two initial summaries contain the target type text unit.
15. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the text processing method according to any one of claims 1 to 13.
16. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the text processing method described in any one of claims 1 to 13 are implemented.
Citation Information
Cited By
Abstract generation method and device, storage medium and program product
CN121117201A