An abstract generation method and device, electronic equipment and storage medium
By generating fusion summaries through aspect-level sentiment analysis and a sequence-to-sequence framework model, the problem of lack of focus in existing technologies is solved, and user-friendly sentiment summary generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
- Filing Date
- 2022-12-08
- Publication Date
- 2026-07-24
AI Technical Summary
The sentiment summaries generated by existing technologies lack focus, making it difficult for users to accurately understand other users' evaluations of the target, and may even mislead users.
By generating binary groups through aspect-level sentiment analysis, summarizing sentiment polarity values, and selecting important aspects, a fusion summary is generated using a sequence-to-sequence framework model. The text length is controlled to ensure that the summary highlights the key points.
The generated fusion summary clearly highlights user emotions, making it easy for users to quickly understand the overall evaluation of the target object.
Smart Images

Figure CN116167345B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sentiment summarization, and in particular to a summarization method, apparatus, electronic device, and storage medium. Background Technology
[0002] Sentiment summarization is a summary that simultaneously records the important content and emotional tone of a text. It is typically used to extract evaluations of the same object (such as items or news) from multiple users. Clearly, a suitable sentiment summary can help users quickly understand other users' evaluations of a target object. However, sentiment summaries generated by related technologies often lack focus, which can easily affect users' understanding of the evaluations and even mislead them.
[0003] Therefore, how to improve the text quality of sentiment summaries is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this application is to provide a summary generation method, apparatus, electronic device, and storage medium that can generate a comprehensive summary of a target object from different perspectives, thereby ensuring that the focus of the fused summary is clearer and that it is easier for users to quickly understand others' comments.
[0005] To address the aforementioned technical problems, this application provides an abstract generation method, comprising:
[0006] Generate a tuple for each comment text of the target object; the tuple contains a preset aspect and a sentiment polarity value corresponding to the comment text, the preset aspect being an attribute of the target object;
[0007] By summarizing the comment texts that share the same preset aspect, a comment text set corresponding to each preset aspect is obtained;
[0008] Using the sentiment polarity values of all comment texts in the comment text set, calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set;
[0009] For each target aspect in the set of important aspects, a summary text corresponding to the target aspect is generated using the target aspect, its corresponding sentiment polarity composite value, and the comment text.
[0010] Using all the target aspects and their corresponding sentiment polarity composite values and summary texts, a fused summary text corresponding to the target object is generated.
[0011] Optionally, generating a tuple for each comment text of the target object includes:
[0012] An aspect-level sentiment classifier is used to determine the preset aspect and sentiment polarity value corresponding to each comment text within a preset aspect range; the preset aspect range includes multiple preset aspects;
[0013] The binary tuple is generated using the preset aspects and sentiment polarity values of the comment text.
[0014] Optionally, the step of calculating the comprehensive sentiment polarity value of a preset aspect corresponding to the comment text set using the sentiment polarity values of all comment texts within the comment text set includes:
[0015] The mean of the sentiment polarity values of all comment texts in the comment text set is calculated to obtain the comprehensive sentiment polarity value of the preset aspect corresponding to the comment text set.
[0016] Optionally, adding the preset aspects whose emotional polarity composite values meet preset requirements to the important aspect set includes:
[0017] When the absolute value of the emotional polarity composite value is determined to be greater than a preset threshold, the preset aspect corresponding to the emotional polarity composite value is added to the set of important aspects.
[0018] Optionally, generating a summary text corresponding to the target aspect using the target aspect, its corresponding sentiment polarity composite value, and the comment text includes:
[0019] The target aspect and its corresponding sentiment polarity composite value are concatenated with the comment text using a preset concatenation character to obtain the first model input value;
[0020] The first model input value is input into a text generation model based on a sequence-to-sequence framework, so that the text generation model performs sequence-to-sequence processing on the first model input value to generate summary text corresponding to the target aspect.
[0021] Optionally, generating the fused summary text corresponding to the target object using all the target aspects and their corresponding sentiment polarity composite values and summary texts includes:
[0022] The second model input value is obtained by concatenating all the target aspects and their corresponding sentiment polarity comprehensive values and summary text using a preset concatenation character.
[0023] The second model input value is input into an encoder based on a sequence-to-sequence framework for encoding processing to obtain the representation vector corresponding to the second model input value;
[0024] The length control code sequence and the representation vector are input into the fusion decoder for k rounds of decoding to obtain the fusion summary text corresponding to the target object with a text length less than or equal to k; the length control code sequence is the reciprocal sequence from k-1 to 0, and k is a preset value.
[0025] Optionally, the step of inputting the length control code sequence and the representation vector into the fusion decoder for k rounds of decoding to obtain the fused summary text corresponding to the target object, with a text length less than or equal to k, includes:
[0026] During the t-th round of decoding, the fusion decoder uses a first mapping function to convert the t-th value in the length control code sequence into a first vector; the initial value of t is 1.
[0027] The characters generated in round t-1 are converted into a second vector using the second mapping function; the characters in round 0 are the preset start characters.
[0028] The first vector and the second vector are fused to obtain a third vector, and the third vector is processed by a self-attention module to generate a self-attention vector.
[0029] The self-attention vector and the representation vector are subjected to mutual attention processing using a mutual attention module to generate a fused representation vector.
[0030] The fused representation vector is input to the decoding module for decoding to obtain the character at the t-th position of the fused summary text, and then proceeds to the next round of decoding;
[0031] At the end of the k-round decoding, the fused summary text is output.
[0032] This application also provides an abstract generation apparatus, comprising:
[0033] An aspect-level sentiment processing module is used to generate a tuple for each comment text of the target object; the tuple contains a preset aspect and sentiment polarity value corresponding to the comment text, and the preset aspect is an attribute of the target object;
[0034] The classification module is used to summarize comment texts that have the same preset aspect to obtain comment text sets corresponding to each preset aspect;
[0035] The important aspect set construction module is used to calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set using the sentiment polarity values of all comment texts in the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set;
[0036] The summary text generation module is used to generate a summary text for each target aspect in the set of important aspects, using the target aspect and its corresponding sentiment polarity comprehensive value and comment text.
[0037] The fusion summary text generation module is used to generate a fusion summary text corresponding to the target object by utilizing all the target aspects and their corresponding sentiment polarity comprehensive values and summary texts.
[0038] This application also provides an electronic device, including:
[0039] Memory, used to store computer programs;
[0040] A processor for implementing the summary generation method as described above when executing the computer program.
[0041] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the digest generation method described above.
[0042] This application provides a summary generation method, comprising: generating a tuple for each comment text of a target object; the tuple containing a preset aspect and a sentiment polarity value corresponding to the comment text, wherein the preset aspect is an attribute of the target object; summarizing comment texts having the same preset aspect to obtain a comment text set corresponding to each preset aspect; calculating a comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set using the sentiment polarity values of all comment texts in the comment text set, and adding preset aspects whose comprehensive sentiment polarity values meet preset requirements to an important aspect set; for each target aspect in the important aspect set, generating a summary text corresponding to the target aspect using the target aspect, its corresponding comprehensive sentiment polarity value, and the comment text; and generating a fused summary text corresponding to the target object using all the target aspects, their corresponding comprehensive sentiment polarity values, and the summary text.
[0043] As can be seen, this application first generates a pair of tuples for each comment text corresponding to the target object. Each tuple contains a preset aspect and a sentiment polarity value corresponding to the comment text. The preset aspect is an attribute of the target object. In other words, this application can use aspect-level sentiment analysis to determine the preset aspects and corresponding sentiment polarities emphasized by each comment text when evaluating the target object. Subsequently, this application can also aggregate comment texts with the same preset aspects to obtain a set of comment texts corresponding to each preset aspect. Using the sentiment polarity values of all comment texts in the set, the application calculates the comprehensive sentiment polarity value of the preset aspects corresponding to the set. Then, the preset aspects whose comprehensive sentiment polarity values meet the preset requirements are added to the important aspects. The process involves selecting target aspects from numerous aspects of a target object that are imbued with user emotions. Subsequently, this application further utilizes each target aspect in the important aspect set, along with its corresponding sentiment polarity composite value and comment text, to generate a corresponding summary text for the target aspect. Furthermore, it fuses all target aspects, their sentiment polarity composite values, and summary texts to obtain a fused summary text corresponding to the target object. This allows for the fusion of the target aspects of the target object that are imbued with user emotions, along with their corresponding sentiment polarity composite values and comment texts, to generate a comprehensive summary of the target object from different perspectives. This ensures that the fused summary text has a clearer focus and is easier for users to quickly understand others' comments. This application also provides a summary generation device, electronic device, and computer-readable storage medium, which have the aforementioned beneficial effects. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0045] Figure 1 A flowchart illustrating an abstract generation method provided in an embodiment of this application;
[0046] Figure 2 A schematic diagram of a summary fusion model provided in an embodiment of this application;
[0047] Figure 3 A flowchart illustrating another abstract generation method provided in this application embodiment;
[0048] Figure 4 This is a structural block diagram of an abstract generation apparatus provided in an embodiment of this application;
[0049] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] In related technologies, the sentiment summaries generated by various methods often lack focus, which can easily affect users' accurate understanding of other users' evaluations of the target object and may even mislead them. Therefore, this application provides a summary generation method that can generate a comprehensive summary of the target object from different perspectives, thereby ensuring that the fused summary has a clearer focus and is easier for users to quickly understand others' comments. Please refer to... Figure 1 , Figure 1 A flowchart illustrating a summary generation method provided in this application embodiment, the method may include:
[0052] S101. Generate a tuple for each comment text of the target object; the tuple contains the preset aspect and sentiment polarity value corresponding to the comment text, and the preset aspect is the attribute of the target object.
[0053] This application embodiment first uses aspect-based sentiment analysis (ABSA) to process each comment text of the target object. ABSA is a sentiment analysis task for a single text, primarily used to determine the preset aspects and sentiment polarity values corresponding to the input text within a preset aspect range. The preset aspects are one aspect or attribute of the target object, and the preset aspect range encompasses all preset aspects possessed by the target object. The sentiment polarity value is a quantitative representation of sentiment, which can be represented by multiple discrete numerical values, such as -1 representing negative, 0 representing neutral, and 1 representing positive. In short, the purpose of the above processing is to determine the aspects emphasized by the comment text when evaluating the target object and the corresponding sentiment of the text. It is understood that the aspect-based sentiment analysis method is specifically implemented by an aspect-based sentiment classifier. The embodiments of this application do not limit the specific aspect-level sentiment classifier, which can be a machine learning model that can be used for aspect-level sentiment analysis, such as BERT (Bidirectional Encoder Representation from Transformers), CNN (Convolutional Neural Networks), SVM (Support Vector Machine).
[0054] In one possible scenario, generating a tuple for each comment text of the target object could include:
[0055] Step 11: Using an aspect-level sentiment classifier, determine the preset aspect and sentiment polarity value corresponding to each comment text within a preset aspect range; the preset aspect range includes multiple preset aspects;
[0056] Step 12: Generate tuples using the preset aspects and sentiment polarity values of the comment text.
[0057] Specifically, the process of generating binary tuples for comment text using an aspect set sentiment classifier can be represented as:
[0058] (A,P)=f(X);
[0059] Where A represents aspect, P represents sentiment polarity, and (A,P) forms the aforementioned binary tuple; f(·) represents the aspect-level sentiment classifier; X represents the comment text, X=[x1,…,x N ], x i(i∈[1,N]) represents the i-th character in the comment text, and N represents the total length of the comment text. N is not a fixed value, meaning the length of the text input to the aspect-level sentiment classifier is not fixed. It should be noted that the embodiments of this application do not limit the specific target object and the preset aspect range. It can be understood that the target object can be arbitrarily set, and different target objects can preset different aspects. For example, when evaluating a musical work, the target object can be a musical work or a musician; when the target object is a musical work, the preset aspect range can be ["melody", "lyrics", "arrangement", "promotion", "subjectivity"], and other preset aspects can also be added. The generation process of the above binary tuple is introduced with a specific example. For the given text X1 = "The melody of the song 'Melody' is really quite bland and boring", the aspect-level sentiment classifier can be used to generate the binary tuple: ("melody", -1) = f(X1).
[0060] Furthermore, for ease of management, after obtaining the tuples of each comment text, these tuples can be stored using a list of tuples. For the C comment texts corresponding to the target object M... The list of binary tuples can be specifically represented as:
[0061]
[0062] Among them, L M This represents a list of binary tuples containing binary tuples of all comment texts for the target object M. (i∈[1,C]) represents the tuple corresponding to the i-th comment text of the target object M.
[0063] S102. Summarize the comment texts with the same preset aspect to obtain the comment text set corresponding to each preset aspect.
[0064] After determining the preset aspect corresponding to each comment text, the embodiments of this application can summarize the comment texts with the same preset aspect to obtain the comment text set corresponding to each preset aspect, which can be specifically represented as follows:
[0065]
[0066] Where X a Used for comment text containing the default aspect 'a'.
[0067] S103. Using the sentiment polarity values of all comment texts in the comment text set, calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set.
[0068] After the aggregation is completed, this embodiment of the application will calculate the comprehensive emotional polarity value corresponding to each preset aspect, and select the target aspect full of user emotion from these preset aspects based on whether the comprehensive emotional polarity value meets the preset requirements. The comprehensive emotional polarity value can be calculated from the emotional polarity values of all comment texts in the comment text set, that is, by combining these emotional polarity values. This embodiment of the application does not limit the specific calculation method of the comprehensive emotional polarity value. For ease of calculation, in this embodiment of the application, the comprehensive emotional polarity value can be the average of the emotional polarity values of all comment texts in the comment text set.
[0069] In one possible scenario, the sentiment polarity value of all comment texts within the comment text set is used to calculate the comprehensive sentiment polarity value for a preset aspect corresponding to the comment text set. This could include:
[0070] Step 21: Calculate the mean of the sentiment polarity values of all comment texts in the comment text set to obtain the comprehensive sentiment polarity value of the preset aspect corresponding to the comment text set.
[0071] Specifically, the comprehensive value of emotional polarity can be expressed as:
[0072]
[0073] Where, q a This represents the comprehensive value of emotional polarity corresponding to the preset aspect a.
[0074] Furthermore, this application does not limit specific preset requirements. It is understood that when the comprehensive value of emotional polarity approaches the boundary value of positive emotional polarity or the boundary value of negative emotional polarity, it can be determined that when evaluating the corresponding preset aspect of the target object, the overall comment text corresponding to this comprehensive value tends to be more positive or negative in emotion, that is, the emotion conveyed by this comment text is more concentrated and intense. Therefore, the above-mentioned preset requirements can be set based on the relationship between the comprehensive value of emotional polarity and the boundary value of emotional polarity. Specifically, a preset threshold can be set. When it is determined that the absolute value of the comprehensive value of emotional polarity is greater than this threshold, it can be determined that the comprehensive value of emotional polarity is closer to the boundary value of emotional polarity, and thus it can be determined that the preset aspect corresponding to the comprehensive value of emotional polarity is a target aspect full of user emotion, and can be added to the set of key aspects; conversely, when the absolute value of the comprehensive value of emotional polarity is less than or equal to this threshold, it can be determined that the user emotion contained in the preset aspect corresponding to the comprehensive value of emotional polarity is not concentrated or intense, and thus this preset aspect will not be added to the set of key aspects.
[0075] In one possible scenario, adding preset aspects whose emotional polarity composite values meet preset requirements to the set of important aspects may include:
[0076] Step 31: When the absolute value of the emotional polarity composite value is greater than the preset threshold, add the preset aspect corresponding to the emotional polarity composite value to the important aspect set.
[0077] Specifically, the set of important aspects can be represented as:
[0078] β={a||q a |>λ,a∈A};
[0079] Here, β represents the set of important aspects.
[0080] S104. For each target aspect in the important aspect set, generate a summary text corresponding to the target aspect using the target aspect, its corresponding sentiment polarity composite value, and comment text.
[0081] After identifying key target aspects, this embodiment utilizes the target aspect itself, its corresponding sentiment polarity composite value, and comment text to generate a corresponding summary text for that target aspect. This summary text is a comprehensive extraction result of the target aspect, its corresponding sentiment polarity composite value, and comment text. Specifically, this embodiment employs a sequence-to-sequence (seq2seq)-based text generation model to achieve the above effect. The specific process of generating summary text for the target aspect using this text generation model will be described below.
[0082] In one possible scenario, using the target aspect and its corresponding sentiment polarity composite value and comment text, a summary text corresponding to the target aspect is generated, including:
[0083] Step 41: Use preset splicing characters to splice the target aspect and its corresponding sentiment polarity composite value with the comment text to obtain the first model input value.
[0084] To facilitate text generation model parsing, this embodiment first uses a preset concatenation character to concatenate the target aspect, its corresponding sentiment polarity composite value, and the comment text to obtain the first model input value. Specifically, for the preset aspect a and its corresponding sentiment polarity composite value q... a and comment text collection The input value of the first model can be represented as:
[0085]
[0086] Among them, E a This represents the first model input value, and [sep] represents the preset concatenation character.
[0087] Step 42: Input the first model input value into the text generation model based on the sequence-to-sequence framework, so that the text generation model performs sequence-to-sequence processing on the first model input value and generates the summary text corresponding to the target aspect.
[0088] This application specifically uses a sequence-to-sequence text generation model based on Transformer, and its workflow is roughly as follows:
[0089] 1. Place E a The input is fed into the encoder Enc of the text generation model to obtain the representation vector h. a :
[0090] h a =Enc(E a );
[0091] 2. Represent the vector h a The input is fed into the decoder Dec of the text generation model to obtain the summary text s. a :
[0092] s a =Dec(h a );
[0093] It should be noted that the embodiments of this application do not limit the working process of the encoder and decoder described above, and can be referred to Transformer and sequence-to-sequence related technologies.
[0094] S105. Using all target aspects and their corresponding sentiment polarity composite values and summary texts, generate a fused summary text corresponding to the target object.
[0095] After generating the summary text, this embodiment of the application will fuse all target aspects and their corresponding sentiment polarity composite values and summary texts to obtain a fused summary text corresponding to the target object. It is evident that because the fused summary text generated by this application incorporates all target aspects of the target object that are imbued with user emotions, and also utilizes the sentiment polarity composite values and summary texts corresponding to each target aspect during the fusion process, this application can generate a fused summary text of the target object as a whole from multiple key aspects. This ensures that the fused summary text is clear and concise, thereby facilitating users to quickly grasp other users' overall evaluation of the target object.
[0096] It should be noted that the embodiments of this application do not limit how all target aspects and their corresponding sentiment polarity composite values and summary texts are converted into fused summary texts of the target objects. For example, the above-mentioned sequence-to-sequence text generation model can also be used. However, the problem with this model is that the length of the text sequence it outputs is usually not fixed, and it is easy to produce excessively long text sequences. It is understood that suitable summary information usually has a relatively short length. Therefore, the embodiments of this application need to control the length of the text sequence output by the above-mentioned text generation model to ensure that the model can generate the above-mentioned fused summary text within a limited number of words. The embodiments of this application do not limit the specific way of controlling the text generation model to output a limited-length text sequence. For example, the text sequence output by the text generation model can be hard truncated, retaining only the text content within the limited length; or the probability of the text generation model outputting a limited-length text sequence can be increased to make the most of the limited-length text sequence output by the model. However, the above methods either destroy the text content of the fused summary text or require setting up a large number of mechanisms in the text generation model, which is technically complex and still has a chance of outputting an excessively long text sequence. Therefore, this application embodiment also provides a method for controlling the output of a finite-length text sequence by a text generation model. A length control code sequence can be used to control the length of the fused summary text. Specifically, the length control code sequence is a set of inverse sequences from k-1 to 0, where k is a preset value representing the maximum length of the fused summary text. Each value in this sequence corresponds sequentially to each character in the fused summary text. This value is incorporated into the decoding process of the corresponding character, indicating how many characters remain to be generated between the current character's position and the position where the fused summary text reaches its maximum length. In other words, this application embodiment uses a length control code sequence to tell the text generation model how many characters can be generated after decoding the current character. This controls the text generation model to complete the output of the text sequence before the maximum length of the fused summary text is exhausted. This allows for a more intuitive and efficient control of the fused summary text length, effectively preventing text content loss.
[0097] The following details the process of generating a fused summary text for the target object using all target aspects, their corresponding sentiment polarity composite values, and the summary text. In one possible scenario, generating the fused summary text for the target object using all target aspects, their corresponding sentiment polarity composite values, and the summary text may include:
[0098] Step 51: Use the preset splicing character to splice all target aspects and their corresponding sentiment polarity composite values and summary text to obtain the input values of the second model.
[0099] Specifically, the [sep] concatenation operator can first be used to concatenate the target aspect, its corresponding sentiment polarity composite value, and the summary text to obtain the first concatenation result. Then, the [asp] concatenation operator can be used to concatenate all the first concatenation results to obtain the second model input value. The second model input value can be specifically represented as:
[0100] R = a1[sep]q a1 [sep]s a1 [asp]…ai[sep]q ai [sep]s ai ;
[0101] Where R represents the second model input value, and ai represents the i-th objective aspect in the important aspect set.
[0102] Step 52: Input the second model input value into the encoder based on the sequence-to-sequence framework for encoding processing to obtain the representation vector corresponding to the second model input value.
[0103] In this embodiment, an encoder based on a sequence-to-sequence text generation model is used to encode the input value of the second model. The encoding process can be specifically represented as follows:
[0104] h R =Fus-Enc(R);
[0105] Among them, h R This represents the representation vector of the second model input value. Fus-Enc represents the encoder mentioned above, which is the same as Enc mentioned above.
[0106] Step 53: Input the length control code sequence and representation vector into the fusion decoder for k rounds of decoding to obtain the fusion summary text corresponding to the target object with a text length less than or equal to k; the length control code sequence is the reciprocal sequence from k-1 to 0, where k is a preset value.
[0107] Specifically, the length control code sequence can be represented as:
[0108] LC(k) = {k-1,k-2,…,0};
[0109] Where LC(k) represents a k-bit length control code sequence. The process of inputting the length control code sequence and its representation vector into the fusion decoder for decoding can be represented as:
[0110] s M =Fus-Dec(h R ,LC(k));
[0111] Where s MLet represent the fused digest text, and Fus-Dec represent the fused decoder. As mentioned above, the fused decoder performs k rounds of decoding using a length control code sequence and a representation vector. The t-th round (t∈[1,k]) of decoding generates the character at position t in the fused digest text. It should be noted that since the fused decoder may generate a marker character to indicate the end, and this marker character is not part of the valid content of the fused digest text, the actual valid content length of the fused digest text will be less than or equal to k. The decoding process of the fused decoder will be described in detail below.
[0112] In one possible scenario, the length control code sequence and representation vector are input into the fusion decoder for k rounds of decoding to obtain the fusion summary text corresponding to the target object, with a text length less than or equal to k. This summary text may include:
[0113] Step 61: During the t-th round of decoding, the fusion decoder uses the first mapping function to convert the t-th value in the length control code sequence into the first vector; the initial value of t is 1.
[0114] The first mapping function belongs to the Embedding function, and the transformation process of the first vector can be specifically represented as follows:
[0115]
[0116] in Let Emb represent the first vector. L Let kt represent the first mapping function, where kt is the t-th bit in the length control code sequence. It should be noted that the transformation method of the first mapping function on the first vector can be found in the relevant techniques for embedding functions.
[0117] Step 62: Use the second mapping function to convert the characters generated in round t-1 into the second vector; the characters in round 0 are the preset start characters;
[0118] The second mapping function also belongs to the Embedding function, and the transformation process of the second vector can be specifically represented as follows:
[0119]
[0120] in Represents the second vector, Emb T This represents the second mapping function. This represents the character generated in round t-1. It should be noted that the character in round 0 is a preset start character, such as BOS. It should be explained that the method of transformation of the second vector by the second mapping function can be found in the relevant techniques of embedding functions. Steps 61 and 62 are both used to convert the length control code and characters into a vector pattern that can be processed by the neural network model.
[0121] Step 63: Merge the first vector and the second vector to obtain the third vector, and use the self-attention module to perform self-attention processing on the third vector to generate a self-attention vector.
[0122] Step 63 specifically involves fusing the first and second vectors, and then applying self-attention processing to the third vector using a self-attention module to obtain a self-attention vector, thus incorporating the length control code into the generation process of the t-th character. The process of applying self-attention processing to the third vector can be represented as follows:
[0123]
[0124] Where S t The vector represents the self-attention vector, and Self-Att represents the self-attention module. It should be noted that the embodiments of this application do not limit the specific form of the self-attention module or its workflow; relevant technologies of self-attention mechanisms can be referred to.
[0125] Step 64: Use the mutual attention module to perform mutual attention processing on the self-attention vector and the representation vector to generate a fused representation vector.
[0126] Step 64 specifically utilizes a mutual attention mechanism to perform mutual attention processing on the representation vector and the self-attention vector fused with the characters generated in round (t-1) (i.e., historically generated characters) and the length control code, thereby inferring the vector representation of the t-th character. The generation process of the fused representation vector can be represented as follows:
[0127] H t =Cross-Att(S t ,h R );
[0128] Where H t The vector represents the fused representation, and Cross-Att represents the mutual attention module. It should be noted that the embodiments of this application do not limit the specific form and workflow of the mutual attention module, and can refer to relevant technologies of mutual attention mechanism (Cross-attention).
[0129] Step 65: Input the fused representation vector into the decoding module for decoding processing to obtain the character at the t-th position of the fused summary text, and proceed to the next round of decoding;
[0130] After obtaining the fused representation vector, only decoding is needed to obtain the character at position t. The decoding process of the fused representation vector can be represented as:
[0131]
[0132] in This represents the character at position t of the fused summary text, and MLP (Multilayer Perceptron) represents the decoding module.
[0133] Step 66: At the end of the k-round decoding, output the fused summary text.
[0134] For easier understanding, please refer to Figure 2 , Figure 2 This is a schematic diagram of a summary fusion model provided in an embodiment of this application. The model comprises a fusion encoder (i.e., the sequence-to-sequence frame-based encoder mentioned above) and a fusion decoder. The fusion encoder encodes all target aspects of the importance aspect set, along with the sentiment polarity composite value corresponding to each target aspect and the summary text, to obtain a representation vector h. R Subsequently, the fusion decoder performs k rounds of decoding based on this representation vector and the length control code sequence LC(k), and outputs the fusion digest.
[0135] Based on the above embodiments, this application first generates a tuple for each comment text corresponding to the target object. The tuple contains a preset aspect and a sentiment polarity value corresponding to the comment text. The preset aspect is an attribute of the target object. In other words, this application can use aspect-level sentiment analysis to determine the preset aspect and corresponding sentiment polarity value emphasized by each comment text when evaluating the target object. Subsequently, this application can also aggregate comment texts with the same preset aspect to obtain a comment text set corresponding to each preset aspect. Using the sentiment polarity values of all comment texts in the comment text set, a comprehensive sentiment polarity value for the preset aspects corresponding to the comment text set is calculated. Then, preset aspects whose comprehensive sentiment polarity values meet preset requirements are added to the [presumably a list of preset aspects]. The important aspect set involves selecting target aspects that are rich in user emotions from among the many aspects of the target object. Subsequently, this application further utilizes each target aspect in the important aspect set, along with its corresponding sentiment polarity composite value and comment text, to generate corresponding summary texts for the target aspects. Furthermore, it merges all target aspects, their sentiment polarity composite values, and summary texts to obtain a fused summary text corresponding to the target object. This allows for the fusion of the target aspects that are rich in user emotions, along with their corresponding sentiment polarity composite values and comment texts, to generate a comprehensive summary of the target object from different perspectives. This ensures that the fused summary text has a clearer focus and is easier for users to quickly understand others' comments.
[0136] The above summary generation method is described below based on a specific flowchart. Please refer to it. Figure 3 , Figure 3 A flowchart illustrating another abstract generation method provided in this application embodiment, the process including:
[0137] 1. Perform aspect-level sentiment analysis on each comment text of the target object to obtain a binary tuple for each comment text. The binary tuple contains the preset aspect and sentiment polarity value corresponding to the comment text, where the preset aspect is an attribute of the target object. In other words, determine the aspects and sentiments that each comment text emphasizes when evaluating the target object.
[0138] 2. Summarize the comment texts with the same preset aspect to obtain the comment text set corresponding to each preset aspect. Then, use the sentiment polarity value of all comment texts in the comment text set to calculate the comprehensive sentiment polarity value of the preset aspect corresponding to the comment text set. Finally, add the preset aspects whose comprehensive sentiment polarity value meets the preset requirements to the important aspect set.
[0139] 4. For each target aspect in the important aspect set, the comment aspect is divided into two parts: that is, the target aspect and its corresponding sentiment polarity composite value and comment text are used to generate the summary text corresponding to the target aspect.
[0140] 5. Using all target aspects and their corresponding sentiment polarity composite values and summary text, generate a comprehensive summary corresponding to the target object.
[0141] The following describes the abstract generation apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. The abstract generation apparatus, electronic device, and computer-readable storage medium described below can be referred to in correspondence with the abstract generation method described above.
[0142] Please refer to Figure 4 , Figure 4 This is a structural block diagram of an abstract generation apparatus provided in an embodiment of this application. The apparatus may include:
[0143] The aspect-level sentiment processing module 401 is used to generate a tuple for each comment text of the target object; the tuple contains the preset aspect and sentiment polarity value corresponding to the comment text, and the preset aspect is the attribute of the target object;
[0144] The classification module 402 is used to summarize comment texts with the same preset aspects to obtain a set of comment texts corresponding to each preset aspect;
[0145] The important aspect set construction module 403 is used to calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set by using the sentiment polarity values of all comment texts in the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set;
[0146] The summary text generation module 404 is used to generate a summary text for each target aspect in the important aspect set, using the target aspect and its corresponding sentiment polarity comprehensive value and comment text.
[0147] The fusion summary text generation module 405 is used to generate a fusion summary text corresponding to the target object by utilizing all target aspects and their corresponding sentiment polarity comprehensive values and summary texts.
[0148] Optionally, the aspect-level emotion processing module 401 may include:
[0149] The aspect-level sentiment classifier submodule is used to determine the preset aspect and sentiment polarity value corresponding to each comment text within a preset aspect range using the aspect-level sentiment classifier; the preset aspect range includes multiple preset aspects;
[0150] The integration submodule is used to generate tuples using preset aspects and sentiment polarity values of the comment text.
[0151] Optionally, the important aspect set construction module 403 may include:
[0152] The mean calculation submodule is used to calculate the mean of the sentiment polarity values of all comment texts in the comment text set, so as to obtain the comprehensive sentiment polarity value of the preset aspect corresponding to the comment text set.
[0153] Optionally, the important aspect set construction module 403 may include:
[0154] The determination submodule is used to add the preset aspect corresponding to the emotional polarity composite value to the important aspect set when the absolute value of the emotional polarity composite value is greater than a preset threshold.
[0155] Optionally, the summary text generation module 404 may include:
[0156] The first splicing submodule is used to splice the target aspect and its corresponding sentiment polarity composite value and the comment text using preset splicing characters to obtain the first model input value;
[0157] The abstract text generation submodule is used to input the first model input value into the text generation model based on the sequence-to-sequence framework, so that the text generation model performs sequence-to-sequence processing on the first model input value and generates the abstract text corresponding to the target aspect.
[0158] Optionally, the fusion summary text generation module 405 may include:
[0159] The second splicing submodule is used to splice all target aspects and their corresponding sentiment polarity comprehensive values and summary texts using preset splicing characters to obtain the input values of the second model.
[0160] The encoding submodule is used to input the second model input value into the encoder based on the sequence-to-sequence framework for encoding processing, and obtain the representation vector corresponding to the second model input value;
[0161] The fusion decoding submodule is used to input the length control code sequence and representation vector into the fusion decoder for k rounds of decoding processing to obtain the fusion summary text corresponding to the target object with a text length less than or equal to k; the length control code sequence is the reciprocal sequence from k-1 to 0, where k is a preset value.
[0162] Optionally, the fusion decoding submodule may include:
[0163] The first vector conversion unit is used to convert the t-th value in the length control code sequence into a first vector using the first mapping function during the t-th round of decoding; the initial value of t is 1.
[0164] The second vector conversion unit is used to convert the characters generated in the (t-1)th round into a second vector using the second mapping function; the characters in the 0th round are the preset start characters;
[0165] The self-attention processing unit is used to fuse the first vector and the second vector to obtain the third vector, and to use the self-attention module to perform self-attention processing on the third vector to generate a self-attention vector.
[0166] The mutual attention processing unit is used to perform mutual attention processing on the self-attention vector and the representation vector using the mutual attention module to generate a fused representation vector.
[0167] The decoding unit is used to input the fused representation vector into the decoding module for decoding processing, obtain the character at the t-th position of the fused summary text, and proceed to the next round of decoding;
[0168] The output unit is used to output the fused summary text at the end of k rounds of decoding.
[0169] This application also provides an electronic device that may include a processor and a memory. The relationship between the processor and the memory in this electronic device can be referenced. Figure 5 .
[0170] The processor 11 of the electronic device 10 is used to execute the program stored in the memory 12;
[0171] The memory 12 of the electronic device 10 is used to store a program, which is used for at least:
[0172] Generate a tuple for each comment text of the target object; the tuple contains the preset aspect and sentiment polarity value corresponding to the comment text, and the preset aspect is the attribute of the target object;
[0173] By summarizing the comment texts that share the same preset aspect, we can obtain a set of comment texts corresponding to each preset aspect.
[0174] Using the sentiment polarity values of all comment texts in the comment text set, calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set;
[0175] For each target aspect in the important aspect set, a summary text corresponding to the target aspect is generated by using the target aspect, its corresponding sentiment polarity composite value, and the comment text;
[0176] By utilizing all target aspects and their corresponding sentiment polarity composite values and summary texts, a fused summary text corresponding to the target object is generated.
[0177] Of course, the electronic device may also include a communication bus 16, a communication interface 13, a display 15, and an input unit 14, etc., without limitation.
[0178] On the other hand, this application also provides a storage medium storing a computer program that, when loaded and executed by a processor, is used to implement the summary generation method described in any of the above embodiments.
[0179] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0180] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0181] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0182] The abstract generation method, apparatus, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for generating abstracts, characterized in that, include: Generate a tuple for each comment text of the target object; the tuple contains a preset aspect corresponding to the comment text and a sentiment polarity value corresponding to the preset aspect, the preset aspect being an attribute of the target object; By summarizing the comment texts that share the same preset aspect, a comment text set corresponding to each preset aspect is obtained; Using the sentiment polarity values of all comment texts in the comment text set, calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set; For each target aspect in the set of important aspects, a summary text corresponding to the target aspect is generated using the target aspect, its corresponding sentiment polarity composite value, and the comment text. Using all the target aspects and their corresponding sentiment polarity composite values and summary texts, a fused summary text corresponding to the target object is generated; The step of adding the preset aspects that meet the preset requirements for the comprehensive value of emotional polarity to the set of important aspects includes: When the absolute value of the emotional polarity composite value is determined to be greater than a preset threshold, the preset aspect corresponding to the emotional polarity composite value is added to the set of important aspects.
2. The abstract generation method according to claim 1, characterized in that, The process of generating a tuple for each comment text of the target object includes: An aspect-level sentiment classifier is used to determine the preset aspect and sentiment polarity value corresponding to each comment text within a preset aspect range; the preset aspect range includes multiple preset aspects; The binary tuple is generated using the preset aspects and sentiment polarity values of the comment text.
3. The abstract generation method according to claim 1, characterized in that, The step of calculating a comprehensive sentiment polarity value for a preset aspect corresponding to the comment text set by utilizing the sentiment polarity values of all comment texts within the comment text set includes: The mean of the sentiment polarity values of all comment texts in the comment text set is calculated to obtain the comprehensive sentiment polarity value of the preset aspect corresponding to the comment text set.
4. The abstract generation method according to claim 1, characterized in that, The step of generating summary text corresponding to the target aspect using the target aspect, its corresponding sentiment polarity composite value, and comment text includes: The target aspect and its corresponding sentiment polarity composite value are concatenated with the comment text using a preset concatenation character to obtain the first model input value; The first model input value is input into a text generation model based on a sequence-to-sequence framework, so that the text generation model performs sequence-to-sequence processing on the first model input value to generate summary text corresponding to the target aspect.
5. The abstract generation method according to any one of claims 1 to 4, characterized in that, The step of generating a fused summary text corresponding to the target object by utilizing all the target aspects and their corresponding sentiment polarity comprehensive values and summary texts includes: The second model input value is obtained by concatenating all the target aspects and their corresponding sentiment polarity comprehensive values and summary text using a preset concatenation character. The second model input value is input into an encoder based on a sequence-to-sequence framework for encoding processing to obtain the representation vector corresponding to the second model input value; The length control code sequence and the representation vector are input into the fusion decoder for k rounds of decoding to obtain the fusion summary text corresponding to the target object with a text length less than or equal to k; the length control code sequence is the reciprocal sequence from k-1 to 0, and k is a preset value.
6. The abstract generation method according to claim 5, characterized in that, The step of inputting the length control code sequence and the representation vector into the fusion decoder for k rounds of decoding processing to obtain the fusion summary text corresponding to the target object with a text length less than or equal to k includes: During the t-th round of decoding, the fusion decoder uses a first mapping function to convert the t-th value in the length control code sequence into a first vector; the initial value of t is 1. The characters generated in round t-1 are converted into a second vector using the second mapping function; the characters in round 0 are the preset start characters. The first vector and the second vector are fused to obtain a third vector, and the third vector is processed by a self-attention module to generate a self-attention vector. The self-attention vector and the representation vector are subjected to mutual attention processing using a mutual attention module to generate a fused representation vector. The fused representation vector is input to the decoding module for decoding to obtain the character at the t-th position of the fused summary text, and then proceeds to the next round of decoding; At the end of the k-round decoding, the fused summary text is output.
7. A summary generation apparatus, characterized in that, include: An aspect-level sentiment processing module is used to generate a tuple for each comment text of the target object; the tuple contains a preset aspect corresponding to the comment text and a sentiment polarity value corresponding to the preset aspect, wherein the preset aspect is an attribute of the target object; The classification module is used to summarize comment texts that have the same preset aspect to obtain comment text sets corresponding to each preset aspect; The important aspect set construction module is used to calculate the comprehensive sentiment polarity value of the preset aspects corresponding to the comment text set using the sentiment polarity values of all comment texts in the comment text set, and add the preset aspects whose comprehensive sentiment polarity values meet the preset requirements to the important aspect set; The summary text generation module is used to generate a summary text for each target aspect in the set of important aspects, using the target aspect and its corresponding sentiment polarity comprehensive value and comment text. The fusion summary text generation module is used to generate the fusion summary text corresponding to the target object by utilizing all the target aspects and their corresponding sentiment polarity comprehensive values and summary texts; The important aspect set construction module includes: The determination submodule is used to add the preset aspect corresponding to the emotional polarity composite value to the important aspect set when it is determined that the absolute value of the emotional polarity composite value is greater than a preset threshold.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the digest generation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the digest generation method as described in any one of claims 1 to 6.