A method and apparatus for generating e-book text summaries

By utilizing feature encoding and aggregation of comment and follow-up texts in e-book reading scenarios, and combining this with an attention mechanism to generate summaries, the problem of traditional methods ignoring social value is solved, thereby improving the accuracy of summaries and recommendation performance.

CN120850967BActive Publication Date: 2026-01-30UNICOM WOYUEDU TECH CULTURE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511352699.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-01-30
Estimated Expiration
2045-09-22

AI Technical Summary

Technical Problem

Traditional extractive summarization methods neglect the social value of reader comments in e-book reading scenarios, causing the generated summaries to deviate from the core content that readers care about. This is especially true in long text scenarios, where relying solely on statistical features such as TF-IDF can easily lead to summaries that deviate from the core content that readers are truly concerned with.

Method used

By identifying the comment text and follow-up comments of the target sentence, feature encoding and aggregation are performed. An attention mechanism is used for interactive aggregation, and statistical features and deep learning features of key topic elements are combined to generate an e-book text summary.

Benefits of technology

It improves the accuracy of e-book text summaries, effectively utilizes the social value of readers' comments, uncovers deeper semantic clues in the text, and enhances the recommendation effect of internet reading platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850967B_ABST
    Figure CN120850967B_ABST
Patent Text Reader

Abstract

This application relates to an e-book text summarization method and apparatus. This method aggregates the feature representations of comment texts and their follow-up comments, utilizes an attention mechanism to achieve multi-level interactive aggregation, and combines statistical features and deep learning features of key topic elements. It can effectively utilize the social value of readers' comment texts. At the same time, by modeling the interaction relationship of comments, it can mine deeper semantic clues in the target text and improve the recommendation effect of e-books on Internet reading platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field, and in particular to a method and apparatus for generating e-book text summaries. Background Technology

[0002] Extractive summarization refers to directly selecting key sentences or fragments from the original text to form a summary, retaining the original words and phrases without rewriting. Its main processes include: text preprocessing, feature extraction, sentence importance scoring, and summary generation.

[0003] In e-book reading scenarios, reader comments on internet reading platforms contain rich semantic information and emotional biases. This social network data can effectively reflect readers' understanding of the text content. However, traditional extractive summarization methods rely solely on the statistical features or shallow semantic features of the text itself, ignoring the social value inherent in readers' comments and failing to capture the consensus judgments of the reader group regarding key elements of the text. Especially in long-text scenarios like e-books, simply relying on statistical features such as TF-IDF can easily lead to summaries that deviate from the core content that readers truly care about. Summary of the Invention

[0004] The main objective of this disclosure is to provide an e-book text summarization method and apparatus that can improve the accuracy of e-book text summarization.

[0005] A first aspect of this application proposes a method for generating ebook text summaries, the method comprising:

[0006] M comment texts for the target sentence and multiple follow-up texts corresponding to each comment text are determined to form M comment text pairs. Each comment text pair includes one comment text and multiple corresponding follow-up texts. The comment texts include at least the key thematic elements of the target text. The target sentence is any sentence in the target text.

[0007] Feature encoding is performed on all comment texts and all follow-up comment texts in the M comment text pairs to obtain a first feature representation of each comment text and a second feature representation of each follow-up comment text;

[0008] Aggregate the second feature representations corresponding to all follow-up texts in each comment text pair to obtain the first aggregated feature representations corresponding to all follow-up texts. Then, based on an attention mechanism, interactively aggregate the first feature representations corresponding to the comment texts and the first aggregated feature representations corresponding to all follow-up texts to obtain the second aggregated feature representations for each comment text pair. Concatenate the second aggregated feature representations of M comment text pairs to obtain the third aggregated feature representation of the target sentence.

[0009] An importance value for the target sentence is generated based on the third aggregation feature representation of the target sentence; based on the importance value, an extractive summarization method is used to generate a summary of the target text.

[0010] The eBook text summarization method provided in this embodiment has at least the following advantages:

[0011] This method aggregates the feature representations of comment texts and their follow-up comments, utilizes an attention mechanism to achieve multi-level interactive aggregation, and combines statistical features of key topic elements with deep learning features. It can effectively utilize the social value of readers' comment texts, and at the same time, by modeling the interaction relationship of comments, it can mine deeper semantic clues of readers in the target text, thereby improving the recommendation effect of e-books on Internet reading platforms.

[0012] In some implementations, generating a summary of the target text based on the importance value using an extractive summarization method includes:

[0013] Calculate the TF-IDF values ​​of all key topic elements corresponding to each target sentence in the target text;

[0014] Based on the TF-IDF values ​​of all key topic elements corresponding to each target sentence and the importance values, determine the sentence score corresponding to each target sentence;

[0015] Select the target sentences with the highest scores and combine them to generate a summary of the target text.

[0016] In some implementations, determining the sentence score for each target sentence based on the TF-IDF values ​​of all key topic elements corresponding to each target sentence and the importance values ​​includes:

[0017] The TF-IDF values ​​of all key topic elements corresponding to each target sentence are normalized to obtain the first normalized score;

[0018] The importance value corresponding to each target sentence is normalized to obtain the second normalized score;

[0019] The first normalized score and the second normalized score are weighted and summed to obtain the sentence score corresponding to each of the target sentences.

[0020] In some implementations, the step of feature encoding all comment texts and all follow-up comment texts in the M comment text pairs to obtain a first feature representation for each comment text and a second feature representation for each follow-up comment text includes:

[0021] Based on the first Transformer network, and using the word set corresponding to the comment text as the Q value, K value and V value of the multi-head attention mechanism in the first Transformer network, a first feature representation of the comment text is generated;

[0022] Based on the second Transformer network, and using the word set corresponding to the comment text as the Q value, K value and V value of the multi-head attention mechanism in the second Transformer network, a second feature representation of the comment text is generated.

[0023] In some implementations, the aggregation of the second feature representations corresponding to all follow-up texts in each of the comment text pairs to obtain the first aggregated feature representations corresponding to all follow-up texts includes:

[0024] The second feature representations corresponding to all follow-up texts in each of the comment text pairs are concatenated to obtain the first concatenated feature representation;

[0025] Based on the third Transformer network, and using the first concatenation feature representation as the Q value, K value and V value of the multi-head attention mechanism in the third Transformer network, the first aggregated feature representation corresponding to all comment texts is generated.

[0026] In some implementations, the step of interactively aggregating the first feature representation corresponding to the comment text and the first aggregated feature representation corresponding to all follow-up comment texts based on the attention mechanism to obtain the second aggregated feature representation for each comment text pair includes:

[0027] Based on the fourth Transformer network, the first feature representation corresponding to the comment text is used as the K value and V value of the multi-head attention mechanism in the fourth Transformer network, and the first aggregated feature representation corresponding to all follow-up comment texts is used as the Q value of the multi-head attention mechanism in the fourth Transformer network to generate the first interaction aggregated feature representation.

[0028] Based on the fifth Transformer network, the first feature representation corresponding to the comment text is used as the Q value of the multi-head attention mechanism in the fifth Transformer network, and the first aggregated feature representation corresponding to all follow-up comment texts is used as the K value and V value of the multi-head attention mechanism in the fifth Transformer network to generate the second interactive aggregated feature representation.

[0029] By concatenating the first interaction aggregation feature representation and the second interaction aggregation feature representation, a second aggregation feature representation is obtained for each of the comment text pairs.

[0030] In some implementations, the generation of the importance value of the target sentence based on the third aggregated feature representation of the target sentence includes:

[0031] The importance value of the target sentence is generated based on the following formula:

[0032] α 1i =vtanh(WF i +b);

[0033] Among them, F i Let v and W be the third aggregated feature representation of the i-th target sentence in the target text, where v and W are weight parameters, b is the bias, and α is the weight. 1i Let be the importance value of the i-th target sentence, and tanh be the mapping function of the hyperbolic tangent function.

[0034] A second aspect of this application provides an e-book text summarization apparatus, the apparatus comprising:

[0035] The data acquisition module is used to determine M comment texts of the target sentence and multiple follow-up comment texts corresponding to each comment text, so as to form M comment text pairs. Each comment text pair includes one comment text and multiple corresponding follow-up comment texts. The comment texts include at least the key thematic elements of the target text. The target sentence is any sentence in the target text.

[0036] The feature extraction module is used to encode features of all comment texts and all follow-up comment texts in the M comment text pairs to obtain a first feature representation of each comment text and a second feature representation of each follow-up comment text;

[0037] The feature aggregation module is used to aggregate the second feature representations corresponding to all follow-up texts in each comment text pair to obtain the first aggregated feature representations corresponding to all follow-up texts, and to interactively aggregate the first feature representations corresponding to the comment texts and the first aggregated feature representations corresponding to all follow-up texts based on an attention mechanism to obtain the second aggregated feature representations of each comment text pair; and to concatenate the second aggregated feature representations of M comment text pairs to obtain the third aggregated feature representation of the target sentence.

[0038] The summary generation module is used to generate an importance value of the target sentence based on the third aggregation feature representation of the target sentence, and to generate a summary of the target text based on the importance value using an extractive summary generation method.

[0039] A third aspect of this application provides an electronic device including at least one controller and a memory for communicatively connecting to the controller; the memory stores instructions executable by the at least one controller, the instructions being executed by the at least one controller to cause the at least one controller to perform an ebook text summarization generation method as described above.

[0040] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed, implements an e-book text summarization method as described above.

[0041] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating an eBook text summary generation method provided in an embodiment of this application;

[0044] Figure 2 This is a logical block diagram of an e-book text summary generation method provided in an embodiment of this application;

[0045] Figure 3 This is a schematic diagram of the structure of an e-book text summarization generation device provided in an embodiment of this application;

[0046] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.

[0049] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0050] Extractive summarization refers to directly selecting key sentences or fragments from the original text to form a summary, retaining the original words and phrases without rewriting. Its main processes include: text preprocessing, feature extraction, sentence importance scoring, and summary generation.

[0051] In e-book reading scenarios, reader comments on internet reading platforms contain rich semantic information and emotional biases. This social network data can effectively reflect readers' understanding of the text content. However, traditional extractive summarization methods rely solely on the statistical features or shallow semantic features of the text itself, ignoring the social value inherent in readers' comments and failing to capture the consensus judgments of the reader group regarding key elements of the text. Especially in long-text scenarios like e-books, simply relying on statistical features such as TF-IDF can easily lead to summaries that deviate from the core content that readers truly care about.

[0052] To address the aforementioned technical deficiencies, such as Figure 1 and Figure 2 This application provides a method for generating ebook text summaries, the method including the following steps S100 to S400:

[0053] Step S100: Determine M comment texts for the target sentence and multiple follow-up texts corresponding to each comment text to form M comment text pairs. Each comment text pair includes one comment text and multiple corresponding follow-up texts. The comment texts include at least the key thematic elements of the target text. The target sentence is any sentence in the target text.

[0054] In step S100, the target text refers to the ebook text for which summarization is required. The ebook text contains multiple target sentences, which can be segmented using common clause segmentation tools. In social networks (such as the comment section of QQ Reading), each target sentence has comment texts, and M comment texts are selected for each target sentence. Each comment text has multiple follow-up comment texts. It should be noted that it is a common phenomenon for readers or authors to post comment texts and follow-up comment texts on internet platforms, which will not be elaborated here.

[0055] In step S100, each paper includes at least the key thematic elements from the target text. It should be noted that text summarization (extraction) is a relatively mature technology. Key thematic elements refer to words or phrases extracted from the comment text that are related to the core semantics of the target sentence. For example, this can be achieved using keyword extraction algorithms in natural language processing, such as methods based on word frequency statistics or semantic similarity.

[0056] In this embodiment, limiting the target sentence to contain at least the key thematic elements of the target text is to improve the quality of the selected comment text. Since the comment text contains key thematic elements, the comment text and the corresponding follow-up text can be used to measure the elements that readers focus on on social networks, reflecting the social value of the sentence on social networks. The more key thematic elements it contains, the more important the comment text and the corresponding follow-up text are for improving the value of the summary generation.

[0057] For example, there is a target text, which has multiple target clauses. Each target clause selects M pairs of comment texts, and each pair of comment texts includes one comment text and multiple corresponding follow-up comment texts.

[0058] {A1,A2…,A M}; where A1 to A M Let each be a set of words from the first to the Mth comment text (the set can be divided by characters, or by characters and phrases, without limitation). For the i-th comment text, its multiple follow-up comment texts are: {B i1 B i2 ,…B ij …,B iN}, where B ij Let j be the j-th comment text corresponding to the i-th comment text. For the i-th comment text, there are N comment texts.

[0059] Step S200: Perform feature encoding on all comment texts and all follow-up comment texts in the M comment text pairs to obtain the first feature representation of each comment text and the second feature representation of each follow-up comment text.

[0060] In step S200, BERT can be used to extract feature representations from the text. The main purpose is to convert the text into feature vector form for subsequent processing. The BERT model is a pre-trained language model proposed by Google in 2018. Its core advantage lies in capturing the complete semantic relationships of words through a bidirectional encoder, significantly reducing the dependence of NLP tasks on labeled data.

[0061] In some embodiments, the Transformer model can also be used for feature extraction. The Transformer consists of a feedforward neural network and a multi-head attention mechanism, which will not be described in detail here.

[0062] Step S300: Aggregate the second feature representations corresponding to all follow-up texts in each comment text pair to obtain the first aggregated feature representations corresponding to all follow-up texts. Then, based on the attention mechanism, interactively aggregate the first feature representations corresponding to the comment texts and the first aggregated feature representations corresponding to all follow-up texts to obtain the second aggregated feature representations for each comment text pair. Concatenate the second aggregated feature representations of M comment text pairs to obtain the third aggregated feature representation of the target sentence.

[0063] In step S300, for each comment text pair (including one comment text and multiple follow-up comment texts), firstly, the second feature representations corresponding to all follow-up comment texts in the comment text pair are aggregated to obtain the first aggregated feature representations corresponding to all follow-up comment texts. The purpose here is to model the relationship between multiple follow-up comment texts in the comment text pair to facilitate subsequent mining. Then, based on an attention mechanism, the first feature representation corresponding to the comment text and the first aggregated feature representations corresponding to all follow-up comment texts are interactively aggregated to obtain the second aggregated feature representation of each comment text pair. The purpose of this step is to interact the representation of the comment text with the representations of each follow-up comment text, thereby enhancing the representations of the comment text and each follow-up comment text to supplement the information between the comment text and multiple follow-up comment texts. Finally, the second aggregated feature representations of M comment text pairs are concatenated to obtain the third aggregated feature representation of the target sentence, resulting in the enhanced third aggregated feature representation of the target sentence.

[0064] Step S400: Generate the importance value of the target sentence based on the third aggregation feature representation of the target sentence; based on the importance value, use an extractive summarization method to generate a summary of the target text.

[0065] In step S400, the extractive summary generation method mainly includes the following steps:

[0066] 1) Text preprocessing; cleaning and structuring of text data;

[0067] 2) Feature extraction; quantification of key sentence attributes;

[0068] 3) Sentence importance scoring; calculate the sum of the importance values ​​of all words in the sentence, normalize it, and use it as the sentence score;

[0069] 4) Summary generation; Select the K highest-scoring sentences and combine them into a summary;

[0070] This embodiment mainly uses the third aggregated feature representation of the target sentence to generate the importance value of the target sentence to assist in the sentence importance scoring step. In order to increase the value information in the social network (i.e., the social features mined from M comment text pairs) in the process of calculating the importance value of the sentence during the extraction summary generation process, the accuracy of summary generation is improved.

[0071] Specifically, the implementation process can be divided into four stages: First, comment data for the target sentence is obtained from the e-book reading platform. Comment texts containing key thematic elements and their follow-up comments are filtered to form a structured dataset. Then, word vector encoding is performed on both the main comment text and the follow-up comments. Next, the features of the follow-up comments for each comment text pair are hierarchically aggregated. Local aggregation is first performed between follow-up comments of the same comment text, and then a cross-attention mechanism is used for global interaction with the comment text features. Finally, the interaction features of all comment text pairs are concatenated and input into a classifier, which outputs an importance score for the target sentence. The sentences with the highest scores are selected to form a summary.

[0072] This method aggregates the feature representations of comment texts and their follow-up comments, utilizes an attention mechanism to achieve multi-level interactive aggregation, and combines statistical features of key topic elements with deep learning features. It can effectively utilize the social value of readers' comment texts, and at the same time, by modeling the interaction relationship of comments, it can mine deeper semantic clues of readers in the target text, thereby improving the recommendation effect of e-books on Internet reading platforms.

[0073] Furthermore, in step S400, an extractive summarization method is used based on importance values ​​to generate a summary of the target text, including the following steps S110 to S130:

[0074] Step S110: Calculate the TF-IDF (Term Frequency – Inverse Document Frequency) value of all key topic elements corresponding to each target sentence in the target text; where the TF-IDF value is used to measure the importance of words in the target sentence, which can be obtained by calculating the product of the word frequency in the target sentence and the inverse document frequency in the entire target text.

[0075] Step S120: Based on the TF-IDF values ​​and importance values ​​of all key topic elements corresponding to each target sentence, determine the sentence score corresponding to each target sentence; the sentence score is a comprehensive index that combines the TF-IDF values ​​of key topic elements and the importance value of the target sentence, and can be calculated using a linear weighting method to balance the impact of comment information and original text features on the summary generation.

[0076] Step S130: Select the target sentences with the highest scores and combine them to generate a summary of the target text.

[0077] Specifically, when calculating the TF-IDF values ​​of key topic elements, each sentence in the target text is first segmented into words, and the frequency of each word in the sentence is counted. Next, the inverse document frequency (IVF) is calculated based on the word distribution throughout the text. The TF-IDF value for each word is obtained by multiplying the word frequency by the IVF. Further, the TF-IDF values ​​of all key topic elements in each target sentence are normalized to eliminate biases caused by different sentence lengths or word counts. Simultaneously, the importance value of the target sentence is normalized to ensure that both are within the same dimension. Finally, the normalized TF-IDF score is combined with the importance value using a weighted summation method to obtain the final score for each sentence. Based on a preset threshold or quantity limit, the sentences with the highest scores are selected and combined in the original text order to form a summary of the target text.

[0078] This method integrates key thematic information from comments with sentence importance assessments, generating summaries that not only retain the core content of the original text but also emphasize key points relevant to readers' interests, thus helping to improve the accuracy of e-book recommendations on internet reading platforms.

[0079] Further, in step S120, based on the TF-IDF values ​​and importance values ​​of all key topic elements corresponding to each target sentence, the sentence score corresponding to each target sentence is determined, including the following steps S210 to S230:

[0080] Step S210: Normalize the TF-IDF values ​​of all key topic elements corresponding to each target sentence to obtain the first normalized score. Normalization refers to the process of converting numerical values ​​of different dimensions into a unified scale range. Specifically, linear normalization methods can be used, such as mapping the original numerical values ​​to the interval between 0 and 1.

[0081] Step S220: Normalize the importance value corresponding to each target sentence to obtain the second normalized score. Weighted summation refers to the process of linearly combining multiple independent scores according to a preset ratio. Specifically, it can be implemented using a fixed weight or dynamic weight allocation strategy. For example, the weights of the first normalized score and the second normalized score can be set to 0.5 and 0.5, respectively.

[0082] Step S230 involves weighted summation of the first and second normalized scores to obtain the sentence score for each target sentence. Normalization eliminates dimensional differences between different evaluation indicators, while weighted summation balances the influence of different features on the final decision.

[0083] Specifically, when calculating the sentence score, the TF-IDF values ​​of all key topic elements in the target sentence are first linearly normalized. For example, the original TF-IDF values ​​are converted into a first normalized score in the range of 0 to 1 using the maximum-minimum method. Then, the importance values ​​are normalized in the same way to obtain a second normalized score. Finally, the two normalized scores are linearly summed according to preset weight coefficients. For example, when both weight coefficients are set to 0.5, the sentence score is the arithmetic mean of the two scores.

[0084] This method effectively integrates key thematic elements of text content with relevance features from comment feedback, improving the reasonableness of sentence scoring results while maintaining computational efficiency. Through data standardization and weight allocation mechanisms, this method ensures that feature values ​​from different sources and with different dimensions can work synergistically, thereby providing a more accurate basis for sentence ranking in summary generation.

[0085] Further, in step S200, feature encoding is performed on all comment texts and all follow-up comment texts in the M comment text pairs to obtain a first feature representation for each comment text and a second feature representation for each follow-up comment text, including the following steps S310 and S320:

[0086] Step S310: Based on the first Transformer network, and using the word set corresponding to the comment text as the Q value, K value and V value of the multi-head attention mechanism in the first Transformer network, generate the first feature representation of the comment text.

[0087] Step S320: Based on the second Transformer network, and using the word set corresponding to the comment text as the Q value, K value and V value of the multi-head attention mechanism in the second Transformer network, a second feature representation of the comment text is generated.

[0088] The first Transformer network captures the semantic relationships within the comment text by using the comment text itself as input to the query (Q), key (K), and value (V). The second Transformer network extracts the independent semantic features of the follow-up comment text by using the follow-up comment text itself as input to the query, key, and value. The first and second Transformer networks have the same structure.

[0089] This method can extract the core thematic features of the comment text and the auxiliary semantic features of the follow-up comment text, thereby providing more accurate input for the subsequent aggregation module and improving the reliability of the target sentence importance score.

[0090] Further, in step S300, the second feature representations corresponding to all follow-up texts in each comment text pair are aggregated to obtain the first aggregated feature representations corresponding to all follow-up texts, including the following steps S410 and S420:

[0091] Step S410: Concatenate the second feature representations corresponding to all follow-up texts in each comment text pair to obtain the first concatenated feature representation.

[0092] Step S420: Based on the third Transformer network, and using the first concatenated feature representation as the Q value, K value and V value of the multi-head attention mechanism in the third Transformer network, generate the first aggregated feature representation corresponding to all comment texts.

[0093] The third Transformer network captures the interaction relationships between different comment texts by performing global correlation modeling on the concatenated features. The Q, K, and V values ​​in the multi-head attention mechanism all originate from the same input feature; this self-attention structure effectively uncovers potential correlation patterns within the features.

[0094] This method combines splicing with a self-attention mechanism, which not only preserves the spatial distribution of the original features but also dynamically allocates the contribution weights of different comment texts. For example, it assigns a higher attention coefficient to comments with high information density, thereby improving the discriminativeness of feature aggregation and providing a more discriminative semantic representation basis for subsequent summary generation.

[0095] Further, in step S300, the attention-based mechanism interactively aggregates the first feature representation corresponding to the comment text and the first aggregated feature representation corresponding to all follow-up comment texts to obtain the second aggregated feature representation for each comment text pair, including the following steps S510 to S530:

[0096] Step S510: Based on the fourth Transformer network, the first feature representation corresponding to the comment text is used as the K value and V value of the multi-head attention mechanism in the fourth Transformer network, and the first aggregated feature representation corresponding to all follow-up comment texts is used as the Q value of the multi-head attention mechanism in the fourth Transformer network to generate the first interaction aggregated feature representation.

[0097] Step S520: Based on the fifth Transformer network, the first feature representation corresponding to the comment text is used as the Q value of the multi-head attention mechanism in the fifth Transformer network, and the first aggregated feature representation corresponding to all follow-up comment texts is used as the K value and V value of the multi-head attention mechanism in the fifth Transformer network to generate the second interactive aggregated feature representation.

[0098] Step S530: Concatenate the first interactive aggregated feature representation and the second interactive aggregated feature representation to obtain the second aggregated feature representation of each comment text pair.

[0099] The fourth Transformer network is used to establish the relationship between the features of the comment text and the features of the follow-up comment text. The multi-head attention mechanism in the fifth Transformer network is similar to the structure of the fourth network, but it achieves reverse attention interaction by exchanging the input order of Q value and K value.

[0100] The first interactive aggregation feature representation refers to the attention calculation result with the comment aggregation feature as the query vector and the comment text feature as the key value vector. The second interactive aggregation feature representation refers to the attention calculation result with the comment text feature as the query vector and the comment aggregation feature as the key value vector. The two can be concatenated to form a bidirectional attention interaction feature.

[0101] This method constructs a bidirectional attention interaction structure, simultaneously calculating the guiding effect of comment text on follow-up text and the supporting effect of follow-up text on comment text, effectively avoiding the information omission problem that may be caused by unidirectional attention. This method enables bidirectional deep interaction between comment text and follow-up text, fully exploring the semantic connections between them, thereby improving the quality of aggregated feature expression. Specifically, in the scenario of e-book summary generation, this technology can accurately identify the supporting relationship between the core viewpoints in the comment text and the follow-up text, providing a more reliable feature foundation for subsequent sentence importance calculation, and ultimately generating a more information-dense text summary.

[0102] Furthermore, the importance value of the target sentence is generated based on the third aggregated feature representation of the target sentence, including:

[0103] The importance value of the target sentence is generated based on the following formula (additive attention):

[0104] α 1i =vtanh(WF i +b);

[0105] Among them, F i Let v and W be the third aggregated feature representation of the i-th target sentence in the target text, where v and W are weight parameters, b is the bias, and α is the weight. 1i Let be the importance value of the i-th target sentence.

[0106] This method can generate sentence importance scores that are highly matched with readers' concerns based on the deep semantic interaction between comment text and follow-up text, thereby improving the content relevance and readability of extractive summaries.

[0107] like Figure 3As shown, in some embodiments, one embodiment of this application provides an e-book text summarization generation apparatus, the apparatus comprising:

[0108] The data acquisition module 1001 is used to determine M comment texts of the target sentence and multiple follow-up texts corresponding to each comment text, so as to form M comment text pairs. Each comment text pair includes one comment text and multiple corresponding follow-up texts. The comment texts include at least the key thematic elements of the target text. The target sentence is any sentence in the target text.

[0109] The feature extraction module 1002 is used to perform feature encoding on all comment texts and all follow-up comment texts in M ​​comment text pairs to obtain the first feature representation of each comment text and the second feature representation of each follow-up comment text.

[0110] The feature aggregation module 1003 is used to aggregate the second feature representations corresponding to all follow-up texts in each comment text pair to obtain the first aggregated feature representations corresponding to all follow-up texts. Based on the attention mechanism, the first feature representations corresponding to the comment texts and the first aggregated feature representations corresponding to all follow-up texts are interactively aggregated to obtain the second aggregated feature representations of each comment text pair. The second aggregated feature representations of M comment text pairs are concatenated to obtain the third aggregated feature representation of the target sentence.

[0111] The summary generation module 1004 is used to generate the importance value of the target sentence based on the third aggregation feature representation of the target sentence, and based on the importance value, it uses an extractive summary generation method to generate a summary of the target text.

[0112] It should be noted that this embodiment of the e-book text summarization generation device is based on the same inventive concept as the above-described embodiment of the e-book text summarization generation method. Therefore, the relevant content of the above-described embodiment of the e-book text summarization generation method is also applicable to this embodiment of the e-book text summarization generation device, and will not be repeated here.

[0113] Reference Figure 4 This application also provides an electronic device, which includes:

[0114] At least one memory;

[0115] At least one processor;

[0116] At least one program;

[0117] The program is stored in memory, and the processor executes at least one program to implement the ebook text summarization method described above in this disclosure.

[0118] This electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.

[0119] The electronic devices according to embodiments of this application will now be described in detail.

[0120] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0121] The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the program code is stored in the memory 1700 and is called and executed by the processor 1600 using the e-book text summary generation method of the embodiments of this application.

[0122] The input / output interface 1800 is used to implement information input and output.

[0123] The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0124] Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900);

[0125] The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.

[0126] This application also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described ebook text summary generation method.

[0127] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0128] The embodiments described in this application are intended to more clearly illustrate the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0129] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0131] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0132] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0133] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0134] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0136] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0137] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0138] The above is a detailed description of the preferred embodiments of this application. However, the embodiments of this application are not limited to the above-described implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the embodiments of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of the embodiments of this application.

Claims

1. An electronic book text abstract generation method, characterized by, The method comprises: determining M comment texts of a target sentence and a plurality of follow-up texts corresponding to each comment text to form M comment text pairs, one of the comment text pairs comprising one comment text and a plurality of follow-up texts corresponding thereto; wherein the comment texts at least comprise key theme elements in the target texts; the target sentence is any one of the target texts; M is an integer greater than 1; performing feature coding on all the comment texts and all the follow-up texts in the M comment text pairs to obtain a first feature representation of each comment text and a second feature representation of each follow-up text; the performing feature coding on all the comment texts and all the follow-up texts in the M comment text pairs to obtain a first feature representation of each comment text and a second feature representation of each follow-up text comprises: generating the first feature representation of the comment text based on a first Transformer network and taking a word set corresponding to the comment text as Q value, K value and V value of multi-head attention mechanism in the first Transformer network respectively; generating the second feature representation of the follow-up text based on a second Transformer network and taking a word set corresponding to the follow-up text as Q value, K value and V value of multi-head attention mechanism in the second Transformer network respectively; aggregating the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain first aggregated feature representations corresponding to all the follow-up texts, and interactively aggregating the first feature representation corresponding to the comment text and the first aggregated feature representations corresponding to all the follow-up texts based on an attention mechanism to obtain a second aggregated feature representation of each of the comment text pairs; and splicing the second aggregated feature representations of the M comment text pairs to obtain a third aggregated feature representation of the target sentence; the aggregating the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain first aggregated feature representations corresponding to all the follow-up texts comprises: splicing the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain first spliced feature representations; and generating the first aggregated feature representations corresponding to all the follow-up texts based on a third Transformer network and taking the first spliced feature representations as Q value, K value and V value of multi-head attention mechanism in the third Transformer network respectively; the interactively aggregating the first feature representation corresponding to the comment text and the first aggregated feature representations corresponding to all the follow-up texts based on the attention mechanism to obtain the second aggregated feature representation of each of the comment text pairs comprises: The first feature representation corresponding to the review text is taken as K value and V value of a multi-head attention mechanism in the fourth Transformer network, the first aggregated feature representation corresponding to all follow-up review texts is taken as Q value of the multi-head attention mechanism in the fourth Transformer network, and a first interaction aggregated feature representation is generated based on the fourth Transformer network; the first feature representation corresponding to the review text is taken as Q value of a multi-head attention mechanism in the fifth Transformer network, the first aggregated feature representation corresponding to all follow-up review texts is taken as K value and V value of the multi-head attention mechanism in the fifth Transformer network, and a second interaction aggregated feature representation is generated based on the fifth Transformer network; the first interaction aggregated feature representation and the second interaction aggregated feature representation are spliced to obtain a second aggregated feature representation of each review text pair. The importance value of the target sentence is generated based on the third aggregated feature representation of the target sentence; and a summary of the target text is generated by using an extractive summary generation method based on the importance value.

2. The electronic book text summarization generation method of claim 1, wherein, The method for generating the summary of the target text based on the importance value includes: TF-IDF values of all key topic elements corresponding to each target sentence in the target text are calculated; A sentence score corresponding to each target sentence is determined based on the TF-IDF values of all key topic elements corresponding to the target sentence and the importance value; Several target sentences with the highest sentence scores are selected to generate a summary of the target text.

3. The electronic book text summarization method of claim 2, wherein, The method for determining the sentence score corresponding to each target sentence based on the TF-IDF values of all key topic elements corresponding to the target sentence and the importance value includes: A first normalized score is obtained by normalizing the TF-IDF values of all key topic elements corresponding to each target sentence; A second normalized score is obtained by normalizing the importance value corresponding to each target sentence; The first normalized score and the second normalized score are weighted and summed to obtain the sentence score corresponding to each target sentence.

4. The method of claim 1, wherein, The method for generating the importance value of the target sentence based on the third aggregated feature representation of the target sentence includes: The importance value of the target sentence is generated based on the following formula: α 1i = v tan h(WF i +b); where F i is the third aggregated feature representation of the i-th target sentence in the target text, v and W are weight parameters, b is a bias, and 1i is the importance value of the i-th target sentence, and tanh is a mapping function of the hyperbolic tangent function.

5. An electronic book text summarization apparatus, characterized by comprising: The apparatus includes: A data acquisition module is configured to determine M review texts of a target sentence and a plurality of follow-up review texts corresponding to each review text to form M review text pairs, wherein each review text pair includes one review text and a plurality of follow-up review texts corresponding to the review text; wherein the review text includes at least a key topic element in a target text; the target sentence is any sentence in the target text; and M is an integer greater than 1. The feature extraction module is configured to perform feature coding on all the comment texts and all the follow-up texts in the M comment text pairs to obtain a first feature representation of each comment text and a second feature representation of each follow-up text; and the feature coding on all the comment texts and all the follow-up texts in the M comment text pairs to obtain the first feature representation of each comment text and the second feature representation of each follow-up text comprises: generating the first feature representation of the comment text based on a first Transformer network and taking a word set corresponding to the comment text as Q values, K values and V values of multi-head attention mechanisms in the first Transformer network, respectively; and generating the second feature representation of the follow-up text based on a second Transformer network and taking a word set corresponding to the follow-up text as Q values, K values and V values of multi-head attention mechanisms in the second Transformer network, respectively. The feature aggregation module is configured to aggregate the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain first aggregated feature representations corresponding to all the follow-up texts, and interactively aggregate the first feature representation corresponding to the comment text and the first aggregated feature representations corresponding to all the follow-up texts based on an attention mechanism to obtain a second aggregated feature representation of each of the comment text pairs; and concatenate the second aggregated feature representations of the M comment text pairs to obtain a third aggregated feature representation of the target sentence; and the aggregation of the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain the first aggregated feature representations corresponding to all the follow-up texts comprises: concatenating the second feature representations corresponding to all the follow-up texts in each of the comment text pairs to obtain a first concatenated feature representation; and generating the first aggregated feature representations corresponding to all the follow-up texts based on a third Transformer network and taking the first concatenated feature representation as Q values, K values and V values of multi-head attention mechanisms in the third Transformer network, respectively. The interactive aggregation of the first feature representation corresponding to the comment text and the first aggregated feature representations corresponding to all the follow-up texts based on the attention mechanism to obtain the second aggregated feature representation of each of the comment text pairs comprises: Based on the fourth Transformer network, the first feature representation corresponding to the review text is respectively taken as the K value and the V value of the multi-head attention mechanism in the fourth Transformer network, and all the first aggregated feature representations corresponding to the follow-up review texts are taken as the Q value of the multi-head attention mechanism in the fourth Transformer network, to generate a first interaction aggregated feature representation; based on the fifth Transformer network, the first feature representation corresponding to the review text is taken as the Q value of the multi-head attention mechanism in the fifth Transformer network, and all the first aggregated feature representations corresponding to the follow-up review texts are taken as the K value and the V value of the multi-head attention mechanism in the fifth Transformer network, to generate a second interaction aggregated feature representation; the first interaction aggregated feature representation and the second interaction aggregated feature representation are spliced to obtain a second aggregated feature representation of each review text pair. The abstract generation module is configured to generate an importance value of the target sentence based on the third aggregated feature representation of the target sentence, and generate an abstract of the target text by using an extractive abstract generation method based on the importance value.

6. An electronic device, comprising: The computer readable storage medium stores computer executable instructions for causing a computer to perform the electronic book text abstract generation method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer readable storage medium stores computer executable instructions for causing a computer to perform the electronic book text abstract generation method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Information flow interaction processing method and device and electronic equipment

    CN113761194A

  • Text generation method and device based on table and application of text generation method and device

    CN116452707A