A question-driven social network answer summary automatic generation method and device
Through the hierarchical sliding fusion reasoning module and the dual-driven selection generator, the efficiency and fluency problems of summarization of non-factual question-answer answers in social networks are solved, and concise and explainable summaries are generated.
Patent Information
- Application Number
- CN202111365252.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-11-17
AI Technical Summary
Existing answer summary generation models for non-factual questions and answers in social networks find it difficult to effectively capture the differences in sentence contribution values, resulting in the generated summaries being lengthy, meaningless, and computationally inefficient, lacking a deep understanding of the question semantics and fluency.
It adopts a hierarchical sliding fusion reasoning module and a dual-driven selection generator, combines the semantic information of questions and answers through a Bi-LSTM encoder and a cross-attention mechanism, and generates concise and interpretable summaries.
The efficiency and fluency of summary generation are improved. The generated summary is closer to human natural language, answers questions concisely and accurately, and reduces the complexity of the algorithm.
Smart Images

Figure CN114048309B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and device for automatically generating a question-driven social network answer summary, belonging to the technical fields of the Internet and artificial intelligence. Background Art
[0002] With the rapid development of internet technology, social media has become a vital platform for people to quickly publish and access information, leading to an explosive growth in the amount of information on various online knowledge query platforms. These open-ended questions, which require complex answers such as descriptions, opinions, or explanations, are defined as non-factual questions. The answers to these questions often contain multiple sentences or paragraphs, including extensive analysis and explanations. This results in lengthy answers and a large amount of meaningless information, which can lead to reading difficulties and misunderstandings. Therefore, for non-factual questions and answers, the answers are comprehensively analyzed, extracted, and refined to reveal important information based on the question. This generates a brief and clear summary of the answer and presents it to the user. This effectively helps users quickly and conveniently obtain what they need, improving the user experience on social platforms.
[0003] Summarization is primarily categorized into extractive and generative summarization models. Extractive summarization models extract keywords or target sentences from source documents and construct a summary through appropriate splicing. This approach is more suitable for summarizing factual content such as news or articles, but it cannot guarantee the consistency of the summarized information. However, unlike factual question answering, non-factual text contains informal writing styles, noisy information, and the process of answer reasoning, making it difficult to effectively model the answer using extractive summarization. Furthermore, since different sentences in the answer have different contributions, the model must possess good generalization and reasoning performance.
[0004] The most typical generative summary model is the sequence-to-sequence (seq2seq) model. This model consists of an encoder and a decoder. The encoder first converts the input text into a text encoding vector that can represent semantic information. The decoder then decodes the state vector and generates a summary. However, most researchers have focused on how to use attention mechanisms to obtain important information or add questions to the attention mechanism. This approach only focuses on the answer to the question as a whole and lacks analysis and reasoning of the semantic representation of the question, resulting in weak abstract interpretability. In addition, if the semantic dependencies between adjacent sentences are not considered and random multi-hop reasoning is performed, it often leads to excessive information span, greatly reducing the computational efficiency of the model.
[0005] To this end, based on the seq2seq model, the present invention attempts to introduce the semantic inheritance structure of adjacent sentences in natural language into the attention mechanism of text information reasoning. A hierarchical sliding fusion reasoning module is proposed. This module breaks the traditional multi-hop mechanism and adopts a sequential sliding fusion mechanism. While ensuring the reduction of algorithm complexity, it provides a multi-layer deep representation of reasonability for the representation between sentences. In addition, breaking the convention of traditional methods that only focus on the source text, a question representation related to the source text is introduced into the pointer generation network to expand the source text pool. This effectively improves the performance and fluency of the summary, making the generated summary closer to the fluent expression of human natural language and able to answer the corresponding questions concisely and accurately. Summary of the Invention
[0006] In order to address the problems and shortcomings of the existing technology, the present invention proposes a question-driven method for automatically generating answer summaries on social networks. A hierarchical sliding reasoning module is used to select sentences in the answers that are most relevant to the question and contain important key information, providing explainability for the generation of answer summaries. The answer summary is generated through a dual-driven selection generator.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows: a question-driven method for automatically generating answer summaries on social networks, comprising the following steps:
[0008] Step 1: Collect social network texts. Collect multiple social network texts from the Internet to accumulate a sample dataset. A sample in the dataset includes questions and answers in social network texts, as well as the corresponding standard answer summary;
[0009] Step 2: Data preprocessing: preprocess each sample in the dataset and construct triple data. A triple data includes the question, the original answer, and a summary of the answer standard.
[0010] Step 3: Model training, first the question and answer are processed into sentences, and encoded using Glove to generate an embedded vector, and then encoded using the Bi-LSTM encoder in the encoding layer to obtain contextual semantic information. Then, in the inference layer, the sliding fusion mechanism is used to fuse the adjacent sentences in the question and answer with multi-level information representation, and the fused semantics are encoded again using the Bi-LSTM encoder. The cross-attention mechanism is then used to assign different weights to the key information in the fused encoded question and answer, so as to facilitate secondary weighting in the decoding stage. Finally, in the generation layer, a dual-driven selection generator is designed, and both the question and answer are added to the copy pool, so that the generated summary can find suitable words from both the question and the answer. Finally, the model is trained using the joint training loss function;
[0011] Step 4: Model Testing and Text Generation: Based on the best model obtained from training, a summary is generated for the text to be summarized. First, the test text is preprocessed. Then, the model input form is constructed according to Step 2. Finally, a summary of the test text is generated using the summary generation model trained in Step 3. The generated summary is compared with the reference answer summary and evaluated using the ROUGE evaluation criteria to verify the performance of the generated summary.
[0012] A question-driven device for automatically generating social network answer summaries, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the device implements the aforementioned question-driven hierarchical sliding reasoning generator for generating answer summaries.
[0013] Compared with the prior art, the advantages of the present invention are as follows:
[0014] (1) The present invention adopts a question-driven automatic answer summary generation technology to construct a hierarchical sliding reasoning generator, which introduces the semantic inheritance structure of sentences in natural language into the attention mechanism of text information reasoning, so that adjacent sentences can be closely aligned in semantics, thereby ensuring the interpretability of the generated summary in the decoding stage; in addition, it breaks the traditional multi-hop mechanism and adopts a sequential sliding fusion mechanism, which reduces the complexity of the algorithm while providing a deeper understanding of the semantic representation between sentences;
[0015] (2) This paper breaks with the previous practice of focusing solely on source text and introduces source text-related question representations into the pointer generation network to expand the source text pool. This effectively improves the performance and fluency of summaries, making the generated summaries closer to the fluent expression of human natural language and concisely and accurately answering the corresponding questions. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Flowchart of a method according to an embodiment of the present invention.
[0017] Figure 2 This is an overall model diagram of an embodiment of the present invention.
[0018] Figure 3 This is a diagram of a dual-driven selection generator model for questions and answers involved in an embodiment of the present invention.
[0019] Figure 4 This is an example diagram of key word information in the answer summary involved in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to deepen the knowledge and understanding of the present invention, the present invention is further illustrated below with reference to specific embodiments.
[0021] Example 1: A question-driven method for automatically generating social network answer summaries. This method first collects and preprocesses social network text from the Internet. Then, a hierarchical sliding fusion reasoning method is used to represent the sentence information in the answer with the highest relevance to the question, providing a deeper interpretability basis for sentence selection in the decoding stage of summary generation and ensuring improved computational performance while adhering to the semantic inheritance structure. Finally, to improve the fluency and readability of the generated summary, a dual-driven selection generator is constructed to generate the summary. This selection generator integrates the question into the source text to improve the fluency of the generated summary, and uses a dual-driven question and answer coverage mechanism to track the generated content, prevent duplication, and improve readability. For the specific model, see [1]. Figure 2 、 Figure 3 , the detailed implementation steps are as follows:
[0022] Step 1: Collect social network text. To ensure data diversity and universality, this implementation first crawls a large amount of question and answer text from social networking platforms and generates standardized summaries of the answers based on manual rules. The questions, answers, and standard answer summaries together constitute the sample dataset D. The standard answer summary generation rule primarily utilizes "crowdsourcing" technology to summarize the answers and form a standard answer summary. Finally, all the obtained data is split into a training set, a validation set, and a test set in an 8:1:1 ratio.
[0023] Step 2: Data preprocessing. To ensure the data is more suitable for training the designed model, we first clean the data, retaining only the questions, correct answers, and summaries of the correct answers. We then use the NLTK library to break the questions and correct answers into sentences and remove data sets containing two or fewer sentences to facilitate subsequent ablation experiments. Finally, we process the dataset into triples for ease of application in subsequent steps.
[0024] Step 3: Model training. Use the dataset processed in step 2 to train the problem-driven hierarchical sliding inference generator. This step can be divided into the following sub-steps:
[0025] Sub-step 3-1: Construct the data layer. Use the pre-trained GloVe to convert the triples into word vector representations for each word sequence in the question and answer, build a 50k vocabulary, and obtain the mapped question word vector sequence E q , answer word vector sequence E a , where the sentence-level word vector sequence in the answer is
[0026] Sub-step 3-2, construct the text encoding layer. This implementation uses a two-layer Bi-LSTM recurrent neural network encoder to encode the question word vector sequence Eq and the answer word vector sequence E a Perform semantic encoding extraction to obtain the learned contextual semantic representation:
[0027] H q =Bi-LSTM(E q )
[0028]
[0029] At the same time get is the overall semantic representation of the entire answer, where [,] represents a connection operation.
[0030] Sub-step 3-3: Build the inference layer. The inference layer consists of two major steps: the layered sliding fusion mechanism and the cross-attention mechanism. First, the layered sliding fusion mechanism is used to fuse each sentence in the answer into sections. The specific steps are as follows:
[0031]
[0032] The k adjacent sentences in the answer are fused and the context information of the subsection is represented again through the Bi-LSTM encoder to obtain the semantic representation of the k adjacent sentences. The semantic representation of the entire answer is now
[0033] In order to find the location of the core information contained in the sentences in the answers at different sentence levels, the cross-attention mechanism is used for the above fused subsection semantic information:
[0034]
[0035] head i =Attention(Q,K,V)W i V
[0036] MultiHead(Q,K,V)=[head1,…,head h ]W O
[0037] Where W i Q 、W i k 、W i V 、W Ois a learnable parameter. The multi-head attention mechanism is then used to calculate the weights of the question and answer separately: for the information in the question, the weights of each sentence in the question and answer are calculated, and the contextual semantic representation of the question with weights assigned to it under the influence of a single sentence in the answer is obtained through the pooling layer:
[0038]
[0039]
[0040] For sentence information in the answer, in order to learn the dependencies between words in the sentence and capture the internal structure of the sentence, we first use the self-attention mechanism to find the location of key information within the sentence in the semantic representation of the section after fusing k sentences.
[0041]
[0042] On the basis of highlighting the semantic representation of word level, the multi-head attention mechanism is used to calculate the relationship between the k-level fused sentence and the question, and the contextual semantic representation of the k-level fused answer sentence with weights assigned under the influence of the question is obtained.
[0043]
[0044]
[0045] Finally, we perform an average pooling layer on the k-level fused sentence representation to obtain the final sentence-level answer representation under the influence of the question, which can be used in the decoding stage to evaluate the importance of each sentence in the answer.
[0046]
[0047]
[0048] Substeps 3-4 build the generation layer. This is achieved by designing a dual-driven selection generator that adds both the question and the answer to the replication pool, which then generates and replicates the words in the summary. The specific implementation is as follows:
[0049] First, the encoded answer semantic context representation is decoded using word LSTM. It should be noted that at the original and final timestamps of decoding, the input vectors are the word embedded representations of SOS and EOS, respectively. At the decoding time t, the training is performed using the Curriculum learning method, that is, using random probability p to select the input of the current decoding timestamp as the true output y tOr the decoded output w for the previous timestamp t Decode the output s of the hidden layer at the current moment t :
[0050] s t =LSTM(s t-1 ,y t-1 )
[0051] Attention distribution of each word in the question and answer and The calculation of is as follows, which is mainly the probability distribution of key information of the question and answer, that is, telling the decoder where to look for the next generated word:
[0052]
[0053]
[0054]
[0055] Among them, W q 、 W a 、 b q 、b a are learnable parameters.
[0056] Then, we combine the semantic representation of the question and answer at the word level obtained at the inference layer with the hidden layer semantic representation s obtained at the current decoding moment t Calculating sentence-level attention weights and And by quadratically weighting the word probability distribution at the word level, we can obtain the weighted word probability distribution of the source text:
[0057]
[0058] Among them, W F 、 W D 、 b q 、b s are learnable parameters. i|u and j|u represent the corresponding words i and j contained in the entire sentence u. k is the total number of steps for the entire decoding. σ is the sigmoid activation function.
[0059] The final context vector is calculated by the attention distribution obtained after the above quadratic weighting, and the probability distribution P of the entire vocabulary is generated vocab :
[0060]
[0061]
[0062] The last predicted word ω at the current decoding time t t The probability distribution P(ω) in the vocabulary t )=P vocab (ω t Since the generated words may not only appear in the vocabulary, they may also be copied directly from the question or answer. This ensures both the fluency of the generated words and the readability of the generated sentences. Therefore, a dual-driven pointer generation network is designed. The question is added to the copy pool to increase the capacity of the original words in the copy pool:
[0063]
[0064]
[0065] Among them, W c and b c It is a learnable parameter. gen To choose whether the last generated word is found from the vocabulary or copied from the question or answer. Similar to the gating mechanism, it controls the flow of the last generated word.
[0066] Substeps 3-5: Joint training loss. This example uses random initialization to initialize all parameters. The AdaGrad optimizer is used for gradient backpropagation to update model parameters. The initial learning rate is set to 0.15, the initial accumulator value is set to 0.1, and gradient clipping is performed with a maximum gradient norm of 1. The generated summary is limited to 100 words. Model training ends when the training loss stops decreasing or the number of training epochs exceeds 32, and the best performing model on the validation set is saved.
[0067] Step 4: Model testing and text generation. Based on the best validation model obtained in step 3, generate answer summaries for the question-answering dataset to be summarized. First, perform the data processing in step 2 and construct the model input format. This is input into the trained model to generate a summary of the test text. ROUGE calculations are then performed on the generated summary and the reference summary to verify the performance of the generated summary. The specific calculation method is:
[0068]
[0069] Where n=1,2, g represents n_gram, S and R represent the summary generated by the model and the reference summary of the answer, and A∩B is defined as the intersection of two multi-datasets A and B. LCS(S,R) represents the length of the longest common subsequence of the generated summary S and the answer summary R, and m and n represent the number of words in the reference summary and the generated summary, respectively. lcs and P lcs They represent recall and precision respectively, and β represents a larger constant.
[0070] Based on the same inventive concept, the present invention describes a question-driven method and device for automatically generating answer summaries on social networks, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, it implements the above-mentioned question-driven hierarchical sliding reasoning generator for generating answer summaries.
[0071] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention. It should be understood that the embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. After reading the present invention, modifications to various equivalent forms of the present invention made by those skilled in the art fall within the scope defined by the claims of this application.
Claims
1. A question-driven method for automatically generating social network answer summaries, characterized in that: The method comprises the following steps: Step 1: Social network text collection; Step 2: Data preprocessing; Step 3: Model training; Step 4: Model testing and text generation; Among them, step 3: model training, using the data set processed in step 2 to train the problem-driven hierarchical sliding inference generator, the implementation of this step is divided into the following sub-steps: Sub-step 3-1, build the data layer, convert the triples into word vector representations for each word sequence in the question and answer using the pre-trained GloVe, build a 50k vocabulary, and obtain the mapped question word vector sequence E q , answer word vector sequence E a , where the sentence-level word vector sequence in the answer is Sub-step 3-2, construct the text encoding layer, and use a two-layer Bi-LSTM recurrent neural network encoder to encode the question word vector sequence E q and the answer word vector sequence E a Perform semantic encoding extraction to obtain the learned contextual semantic representation: H q =Bi-LSTM(E q ) At the same time get is the overall semantic representation of the entire answer, where [,] represents the connection operation; Sub-step 3-3: Build the inference layer. The inference layer consists of two major steps: the layered sliding fusion mechanism and the cross-attention mechanism. First, the layered sliding fusion mechanism is used to fuse each sentence in the answer into sections. The specific steps are as follows: The k adjacent sentences in the answer are fused and the context information of the subsection is represented again through the Bi-LSTM encoder to obtain the semantic representation of the k adjacent sentences. At this time, the semantic representation of the entire answer is Then the cross-attention mechanism is used to represent the semantics after the fusion: head i =Attention(Q,K,V)W i V MultiHead(Q,K,V)=[head1,…,head h ]W O Where W i O 、W i k 、W i V 、W O is a learnable parameter, and then the multi-head attention mechanism is used to calculate the weights of the question and answer respectively: for the information in the question, the weights of each sentence in the question and answer are calculated, and the contextual semantic representation of the question with weights assigned under the influence of a single sentence in the answer is obtained through the pooling layer: For sentence information in the answer, in order to learn the dependencies between words in the sentence and capture the internal structure of the sentence, we first use the self-attention mechanism to find the location of key information within the sentence in the semantic representation of the section after fusing k sentences. On the basis of highlighting the semantic representation of word level, the multi-head attention mechanism is used to calculate the relationship between the k-level fused sentence and the question, and the contextual semantic representation of the k-level fused answer sentence with weights assigned under the influence of the question is obtained. Finally, the k-level fused sentence representation is averaged and pooled to obtain the final sentence-level answer representation under the influence of the question. This can be used in the decoding stage to evaluate the importance of each sentence in the answer. Substeps 3-4, building the generation layer, mainly involve designing a dual-driven selection generator that adds both the question and the answer to the replication pool, and then performs the subsequent generation and replication of words in the summary. The specific implementation is as follows: First, the encoded answer semantic context representation is decoded using word LSTM. At the original and final timestamps of decoding, the input vectors are the word embedded representations of SOS and EOS respectively. At the time of decoding t, the training is performed using the Curriculum learning method, that is, using random probability p to select the input of the current decoding timestamp as the true output y t Or the decoded output w for the previous timestamp t , decode the output s of the hidden layer at the current moment t : s t =LSTM(s t-1 ,y t-1 ) Attention distribution of each word in the question and answer and The calculation of is as follows, which is mainly the probability distribution of key information of the question and answer, that is, telling the decoder where to look for the next generated word: Among them, W q 、 W a 、 b q 、b a is a learnable parameter; Then, the semantic representation of the question and answer at the word level obtained at the inference layer is combined with the hidden layer semantic representation s obtained at the current decoding moment t Calculating sentence-level attention weights and And by quadratically weighting the word probability distribution at the word level, we can obtain the weighted word probability distribution of the source text: Among them, W F 、 W D 、 b q 、b s are learnable parameters, i|u and j|u represent the corresponding words i, j, d contained in the entire sentence u k is the total number of steps for the entire decoding, σ is the sigmoid activation function, The final context vector is calculated by the attention distribution obtained after the above quadratic weighting, and the probability distribution P of the entire vocabulary is generated vocab : The last predicted word ω at the current decoding time t t The probability distribution P(ω) in the vocabulary t )=P vocab (ω t ), a pointer generation network under dual drive is designed, the problem is added to the copy pool, and the capacity of the original word of the copy pool is increased: Among them, W c and b c Belong to the learnable parameters, through the probability p gen To choose whether the last generated word is to be found in the vocabulary or copied from the question or answer, similar to the gating mechanism, to control the flow of the last generated word. In substeps 3-5, the joint training loss is used. All parameters are initialized using random initialization. The AdaGrad optimizer is used to update the model parameters through gradient backpropagation. The initial learning rate is set to 0.15, the initial accumulator value is 0.1, and the gradient is clipped with a maximum gradient norm of 1. The generated summary is kept within 100 words. When the training loss stops decreasing or the number of training epochs exceeds 32, the model training ends and the best performing model on the validation set is saved.
2. The method for automatically generating a question-driven social network answer summary according to claim 1, characterized in that: Step 1: Social network text collection. First, a large amount of question and answer text is captured from the social network platform, and a standard summary of the answer is generated according to manual rules. The questions, answers, and standard answer summaries together constitute the sample dataset D. The generation rule of the standard answer summary is mainly to use "crowdsourcing" technology to summarize the answers to form a standard answer summary. Finally, all the obtained data are split into a training set, a validation set, and a test set according to an 8:1:1 ratio.
3. The method for automatically generating a question-driven social network answer summary according to claim 1, characterized in that: Step 2: Data preprocessing: First, clean the data and retain the data containing only questions, correct answers, and summaries of correct answers. Use the nltk library to split the questions and correct answers into sentences and remove data groups containing less than two sentences. Finally, process the data sets into triples to facilitate the application of subsequent steps.
4. The method for automatically generating a question-driven social network answer summary according to claim 1, characterized in that: Step 4: Model testing and text generation. Based on the best validation model obtained in step 3, generate answer summaries for the question-answering dataset to be summarized. First, perform data processing in step 2 on the data and construct the model input form. This is input into the trained model to generate a summary of the test text. ROUGE calculations are performed on the generated summary and the reference summary to test the performance of the generated summary. The specific calculation method is as follows: Where n=1,2, g represents n_gram, S and R represent the summary generated by the model and the reference summary of the answer, A∩B is defined as the intersection of two multi-datasets A and B, LCS(S,R) represents the length of the longest common subsequence of the generated summary S and the answer summary R, m and n represent the number of words in the reference summary and the generated summary respectively, R lcs and P lcs They represent recall and precision respectively, and β represents a larger constant.
5. An automatic generation device using the automatic generation method according to any one of claims 1 to 4, characterized in that: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the problem-driven hierarchical sliding reasoning generator is implemented.