A method and related apparatus for generating questions based on social text

By extracting topic vectors from social text using a neural topic model, question and answer texts related to the social text are generated, which solves the problem of poor generation effect in existing technologies and improves user engagement and attention.

CN115700513BActive Publication Date: 2025-12-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110866393.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-29
Publication Date
2025-12-02
Estimated Expiration
2041-07-29

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively generate relevant social text, resulting in poor generation quality and low user engagement.

Method used

A neural topic model is used to extract topic vectors from social texts. A sequence-to-sequence network model is used to generate question texts related to the content of the social texts. Finally, a decoder is used to generate answer texts to enrich user interaction.

Benefits of technology

It improved the relevance of the question text to the social text, thereby enhancing the quality of the generated text and increasing user attention and engagement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700513B_ABST
    Figure CN115700513B_ABST
Patent Text Reader

Abstract

This application discloses a method and related apparatus for generating questions based on social text, involving at least artificial intelligence technologies such as natural language processing and machine learning. When acquiring the social text from which question text needs to be generated, a first input text is determined based on the social text. A hidden layer output with lower dimensionality than the first input text and focused on its main theme is obtained through the hidden layer of a sequence-to-sequence neural topic model, and this output is used as the topic vector corresponding to the first input text. When generating question text from the text vector corresponding to the social text, the topic vector can focus on the originally sparse features in the social text, achieving question text generation from the social text. It also ensures that the question text is more relevant to the topic of the social text, thus guaranteeing the quality of question generation, improving the generation effect, further enhancing the attention given to the social text, and increasing user engagement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a question generation method and related apparatus based on social text. Background Technology

[0002] Natural language processing technology is currently widely used in generating questions from written texts, such as generating exam questions for exam papers.

[0003] Unlike written text, social text refers to text generated by users through internet social applications and other social means, such as blogs and social media posts. Compared to written text, social text is generally characterized by its brevity, colloquial style, and sparse features.

[0004] The technologies that cause these problems are difficult to apply to social text. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides a question generation method and related apparatus based on social text. This method enables the generation of question text from social text, ensuring that the question text is more relevant to the topic of the social text. This approach guarantees the quality of question generation, improves the generation effect, further enhances the level of attention received by the social text, and increases user engagement.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a question generation method based on social text, the method comprising:

[0008] Retrieve social text to be processed;

[0009] The first input text of the neural topic model is determined based on the social text, and the topic vector corresponding to the first input text is obtained through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model.

[0010] Using the text vector corresponding to the social text and the topic vector, question text related to the content of the social text is generated, and the question text is used to be displayed together with the social text.

[0011] On the other hand, embodiments of this application provide a question generation device based on social text, the device comprising an acquisition unit, a determination unit, and a generation unit:

[0012] The acquisition unit is used to acquire the social text to be processed;

[0013] The determining unit is configured to determine the first input text of the neural topic model based on the social text, and obtain the topic vector corresponding to the first input text through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model.

[0014] The generation unit is used to generate question text related to the content of the social text using the text vector corresponding to the social text and the topic vector. The question text is used to be displayed together with the social text.

[0015] On the other hand, embodiments of this application disclose a computer device, the device including a processor and a memory:

[0016] The memory is used to store program code and transmit the program code to the processor;

[0017] The processor is configured to execute the social text-based question generation method described above, according to instructions in the program code.

[0018] On the other hand, embodiments of this application disclose a computer-readable storage medium for storing a computer program for executing the social text-based question generation method described above.

[0019] As can be seen from the above technical solution, when acquiring social text for generating question text, given the generally sparse feature characteristics of social text, the first input text can be determined based on the social text. Since the neural topic model is a sequence-to-sequence model, it can determine the topic vector from the input text at the semantic level, and then reconstruct the topic vector to restore the complete text. Therefore, the hidden layer of the neural topic model can obtain a hidden layer output with a lower dimension than the first input text and focused on the main idea of ​​the first input text. Thus, the topic vector corresponding to the first input text can be obtained through the hidden layer output of the neural topic model. When generating question text related to the content of the social text from the text vector corresponding to the social text, the topic vector can focus on the originally sparse features in the social text. This not only realizes the generation of question text from the social text, but also makes the question text more relevant to the topic of the social text, ensuring the quality of question generation and improving the generation effect. Moreover, since the question text is used to be displayed together with the social text, the general question text can attract user attention and participation, further increasing the attention given to the social text and improving user engagement. Attached Figure Description

[0020] 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This application provides an illustration of a question generation scenario based on social text.

[0022] Figure 2 A flowchart illustrating a question generation method based on social text provided in this application embodiment;

[0023] Figure 3 A schematic diagram illustrating the generation of topic vectors based on a neural topic model, as provided in an embodiment of this application;

[0024] Figure 4 This application provides a schematic diagram of a voting process for a specific issue.

[0025] Figure 5 This is a schematic diagram of a dual-decoder network architecture provided in an embodiment of this application;

[0026] Figure 6 A device structure diagram of a question generation apparatus based on social text provided in this application embodiment;

[0027] Figure 7 A structural diagram of a computer device provided in an embodiment of this application;

[0028] Figure 8 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation

[0029] The embodiments of this application will now be described with reference to the accompanying drawings.

[0030] Since related technologies struggle to automatically generate relevant question texts from social texts, this application provides a method and apparatus for generating questions based on social texts. This not only enables the generation of question texts from social texts but also ensures that the question texts are more relevant to the topic of the social texts, thereby guaranteeing generation accuracy, improving generation effectiveness, and further enhancing the level of attention paid to social texts and increasing user engagement.

[0031] The question generation method based on social text provided in this application can be applied to computer devices with natural language processing capabilities, such as terminal devices and servers. Specifically, terminal devices can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, in-vehicle terminals, smart TVs, etc., but are not limited to these. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing cloud computing services. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this connection.

[0032] This application also relates to Artificial Intelligence (AI), which is the theory, method, technology, and application system for simulating, extending, and expanding human intelligence using digital computers or machines controlled by digital computers, perceiving the environment, acquiring knowledge, and using that knowledge to obtain optimal results. In other words, artificial intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. Artificial intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0033] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. This application primarily focuses on several key areas, including speech processing, natural language processing, and machine learning / deep learning.

[0034] Key technologies in speech technology include automatic speech recognition, speech synthesis, and voiceprint recognition. Enabling computers to hear, see, speak, and feel is the future direction of human-computer interaction, with speech being one of the most promising methods.

[0035] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0036] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0037] In the embodiments of this application, social text can be determined using speech technology in some application scenarios. Natural language processing technology can also be used to determine various vectors and features corresponding to the social text. Correspondingly, machine learning can be used to train the Neural Topic Model (NTM), each decoder, and the encoder, and to learn the knowledge of question generation.

[0038] like Figure 1 In the application scenario shown, server 100 is used as the aforementioned computer device to illustrate the embodiments of this application.

[0039] Server 100 can obtain the social text from which the question text needs to be generated, such as a user's WeChat Moments post: "I still have a whole basket of pineapples left, and I bought apples yesterday. What to eat tonight? It's so hard to decide! Waaah~~". Since social text generally has sparse features and is conversational, the first input text can be determined based on the social text. In this application scenario, since the social text only has the main body and no other users have commented on it, the first input text can be the social text itself.

[0040] Neural topic models are sequence-to-sequence (S2S) models that can semantically identify topic vectors from input text and then reconstruct the complete text from these vectors. Therefore, the hidden layers of a neural topic model can produce outputs with lower dimensionality than the initial input text, focusing on its main theme. This output allows the generation of topic vectors corresponding to the initial input text. For example, in the context of social text in this application, the identified topic vectors can identify information related to topics such as "pineapple," "apple," and "flavor," thus focusing on the initial input text, i.e., the social text.

[0041] When generating question text related to the content of social text using text vectors corresponding to social text, topic vectors can focus on the originally sparse features in the social text. This not only enables the generation of question text from social text but also ensures that the question text is more relevant to the topic of the social text, thus guaranteeing generation accuracy and improving generation results. For example, in this application scenario, the generated question text could be "Which tastes better, pineapple or apple?".

[0042] Therefore, in some scenarios, when users view the aforementioned social text through terminal device 200, they can see question text displayed along with the social text. Question text that highlights the theme of the social text can quickly capture the user's interest and attract the user to participate in the interaction of the question text based on the social text, such as replying with their favorite fruit type, thereby further increasing the attention paid to the social text and improving user participation.

[0043] Figure 2 A flowchart of a question generation method based on social text provided in this application embodiment, the method comprising:

[0044] S201: Obtain the social text to be processed.

[0045] The social text involved in this application can include text sent by users through various social applications. Social text can be text posted in one's own social space, such as Moments or blogs, or text sent to a specific user or user group.

[0046] It is important to note that the social text can be entered by the user or obtained based on the user's voice recognition.

[0047] Given the social aspect, the social text obtained in this step is not limited to text or text sets sent by a single user; it can also include text replies from other users. For example, social text can include only a single piece of text sent by a user, or it can include information from other users' replies based on that text, such as comments on Moments, related replies in social conversations, etc.

[0048] In other words, in one possible implementation, the social text includes body text and comment text, whereby the comment text identifies user comments made to the body text. For example, the body text could be a post published by a user through a social networking application, and the comment text could be other users' replies or also include the user's replies based on the post.

[0049] Optionally, the comment text corresponding to the main text can be determined based on its relevance to the main text. This relevance can be manifested as a semantic relationship or a textual structural relationship. Through semantic relationships, text that has a temporal semantic relationship with the main text can be identified as comment text. For example, in a social conversation between users, when a user initiates a topic and other users discuss it, the initiated topic can be considered the main text, and content related to that topic can be identified as comment text. Through textual structural relationships, text within the related area of ​​the main text can be identified as comment text. For example, if a user posts a thread, the post can be considered the main text, and user comments in the post's comment section can be considered comment text.

[0050] Furthermore, the social text retrieved may differ depending on the context of a user's text sent through a social application.

[0051] For example, when a user has just sent the text or is about to send the text, since no other user has replied to the text at this time, the social text obtained at this time may only be the text sent by that user.

[0052] For example, when retrieving social text after a user has sent the text for a period of time, since other users may have already replied to the text (e.g., commented), the social text retrieved at this time may include the text sent by the user and the content of other users' replies to the text. It should be noted that this application does not limit the social text retrieved at this time to include the content of other users' replies. In some application scenarios, the social text retrieved at this time may only include the text sent by the user.

[0053] S202: Determine the first input text of the neural topic model based on the social text, and obtain the topic vector corresponding to the first input text through the neural topic model.

[0054] In this step, the topic vector corresponding to the first input text can be determined using a neural topic model.

[0055] The first input text is determined based on the social text obtained in S201. The first input text can be part or all of the social text. The first input text can be a part of the social text with relatively sparse features. It is the text that needs to be determined by the neural topic model to reflect the main idea of ​​the content.

[0056] Depending on different computing needs or application scenarios, the first input text can be determined in different ways.

[0057] Optionally, the first input text can be determined based on the composition of the social text. For example, when the social text includes body text and comment text, the first input text can be comment text; when the social text only includes body text, the first input text can be body text.

[0058] Optionally, the first input text can be determined from social text based on factors such as the number of text characters.

[0059] In one possible implementation, when the social text includes body text and comment text, the comment text can be determined as the first input text, and the topic vector corresponding to the comment text can be determined by the neural topic model.

[0060] The neural topic model used to determine topic vectors is a sequence-to-sequence network model. It can determine topic vectors from the input text at the semantic level, and then reconstruct the topic vectors to restore the complete text. Therefore, the hidden layer of the neural topic model can obtain a hidden layer output that is lower in dimension than the first input text and focuses on the main idea of ​​the first input text. Thus, the topic vector corresponding to the first input text can be obtained through the hidden layer output of the neural topic model.

[0061] In one possible implementation, the input to the neural topic network can be determined using bag-of-words vectors. For example, vector representation based on word frequency statistics can cluster frequently occurring text units, such as words, and treat the text units distributed in a bag-of-words space as a topic. The bag-of-words vector corresponding to this bag-of-words space is the vector representing this topic.

[0062] Accordingly, this step may include:

[0063] S2021: Determine k bag-of-words vectors corresponding to the first input text, wherein the k bag-of-words vectors respectively identify the k topics involved in the input text.

[0064] S2022: Based on the k bag-of-words vectors, determine the topic vector corresponding to the input text using the neural topic model.

[0065] like Figure 3 As shown, assuming the first input text is a comment text from a social media platform (denoted as C), neural topic features are extracted using bag-of-words (BOW) representation as input. Accordingly, C... bow It represents the size of the entire bag-of-words space. After determining the bag-of-words vectors for the corresponding k topics, the input bag-of-words vector C is processed by the neural network layer of the neural topic model. bowThe parameters are encoded into prior parameters μ and σ, then transformed into latent variables z = N(μ, σ²) using a Gaussian transformation. Next, the mixed topics θ of the comments are generated (i.e., topic vectors representing the k topics corresponding to the k bag-of-words vectors). Finally, the bag-of-words vectors are reconstructed, as shown in the diagram C'. bow When C bow and C' bow The closer they are, the better the topic vector reflects the main idea of ​​the first input text.

[0066] S203: Generate question text related to the content of the social text using the text vector corresponding to the social text and the topic vector.

[0067] When generating question texts related to the content of social texts using text vectors corresponding to social texts, topic vectors can be used to focus on the originally sparse features in the social texts. This not only enables the generation of question texts from social texts, but also makes the question texts more relevant to the topics of the social texts, thus ensuring the quality of question generation and improving the generation effect.

[0068] Since the generated question text is related to the content of the social text, when the question text is displayed together with the social text, the general question text can attract users' attention and participation, further enhancing the attention given to the social text and increasing user engagement.

[0069] In one possible implementation, when the social text includes body text and comment text, the text vector of the body text can be determined; and question text related to the content of the social text can be generated using the text vector and the topic vector.

[0070] In this implementation, since the main text is less sparse in features than the comment text, or has relatively less noise, the text vectors determined based on the main text can reflect the main content of the main text to a certain extent, without the need to extract topic vectors from the main text through a neural topic model, which can save some computing resources.

[0071] To further enhance user engagement, one possible implementation could be to generate corresponding answer text based on the question text, thereby enriching the participation modes and simplifying the user's participation process. This method also includes:

[0072] S301: Generate answer text related to the question text using the text vector corresponding to the social text and the topic vector.

[0073] S302: Generate a question poll related to the content of the social text based on the question text and the answer text.

[0074] The topic of the question poll is determined based on the question text, and the voting options for the question poll are determined based on the answer text.

[0075] Since the answer text is related to the question text, when generating a question poll based on the question and answer texts, the voting options in the question poll can attract users to choose according to their own preferences, eliminating the input cost of manual editing and making it easier for users to choose.

[0076] by Figure 1 Taking the application scenario shown as an example, the question voting generated by S302 can be as follows: Figure 4 As shown, "°Pineapple" and "°Apple" are voting options generated based on the answer text. Figure 4 In the poll based on this question, 43 people participated, with 33 thinking pineapples were delicious and 21 thinking apples were delicious. This not only facilitates convenient interaction but also allows users who post text to intuitively understand the opinions of their social circles regarding the question.

[0077] Regarding the display method on the terminal side, the question poll can be displayed together with social text or displayed independently. When the question poll is displayed together with social text, it can be displayed as follows: Figure 1 The area displayed in the text concerning the Central Plains issue.

[0078] Within the same user group, posts with polls had an average of 1.65 times more comments, 22.2 times more likes, and 1.8 times more replies than regular posts without polls. Therefore, generating poll questions and answers can be used to increase user engagement and improve the interactive experience.

[0079] Therefore, considering the concise, conversational, and sparse characteristics of social text, this application proposes using a neural topic model to mine latent inherent topics (topic vectors) from comments (comment text). These topic vectors are then injected into an S2S model architecture, using the post (body text) as input to generate questions. Furthermore, the model architecture is extended to additionally output voting options (answer text), thus generating a question vote based on the question and voting options. By generating question votes displayed alongside the social text, user engagement with both the social text and the question votes can be significantly increased, thereby enhancing the visibility of the social text.

[0080] In addition to proposing a method for generating question texts corresponding to social texts using neural topic models in the social domain, this application also purposefully adjusts the model architecture for the generation of question texts and answer texts.

[0081] The following section mainly explains how the first decoder, second decoder, and encoder proposed in this application are used in conjunction with the neural topic model for social text, as well as the corresponding joint training method.

[0082] Regarding S203, one possible implementation includes:

[0083] S2031: Based on the text vector and the topic vector, obtain the corresponding first decoding result through the first decoder.

[0084] S2032: Determine the question text related to the content of the social text based on the first decoding result.

[0085] This application provides a first decoder for generating question vectors and determining corresponding question text. Specifically, this application proposes a single-decoder network architecture comprising a first decoder, an encoder, and a neural topic model. Figure 2 The corresponding embodiment, the network architecture of this single decoder can be referred to Figure 5 The portion marked by the solid line.

[0086] Figure 5 In the scenario shown, the social text includes body text and comment text. The body text is determined as the second input text and is used to input the encoder to generate text vectors. The comment text is determined as the first input text and is used to input the neural topic model to generate topic vectors.

[0087] The first decoder can determine the first decoding result for the generated question text based on the text vector provided by the encoder and the topic vector provided by the neural topic model, and determine the question text based on the first decoding result.

[0088] To improve the quality of the generated question text, more information related to the social text can be provided to the first decoder. In one possible implementation, the method further includes:

[0089] Based on the social text, a second input text comprising P words is determined, and the word segmentation vector sequence corresponding to the second input text is obtained through an encoder.

[0090] The second input text, which includes P segments, is used by the encoder to obtain the text vector corresponding to the social text mentioned in S203. In the process of determining the text vector from the social text, the corresponding segmentation vectors can be determined for each segment included in the second input text. The sequence of segmentation vectors corresponding to all segments in the second input text, combined based on their positional order, is the segmentation vector sequence corresponding to the second input text.

[0091] Wherein, for the i-th word among the P word segments, the i-th word segment vector in the word segment vector sequence includes the forward latent variable and the backward latent variable of the i-th word segment, P≥1, i∈P;

[0092] Taking the second input text as the main body text of a social media post as an example, through word segmentation, the main body text can be... To represent, where This is the number of words included in the main text. For the i-th word, First, convert the word segmentation into word vectors. Then, it is processed by a bidirectional gated recurrent unit (GRU) into latent variables and final variables. The latent variables include forward latent variables. and backward hidden variables The forward and backward latent variables are concatenated to form the segmentation vector of the i-th word. The h of the entire main text i This constitutes a word segmentation vector sequence .

[0093] The final variable obtained by encoding the second input text through the encoder can serve as the text vector corresponding to the social text. The segmentation vectors corresponding to each word segmentation during the encoding process constitute a segmentation vector sequence. Since a segmentation vector contains forward latent variables representing the preceding context and backward latent variables representing the following context, the segmentation vector not only represents the word itself but also carries its contextual information. Based on the segmentation vector sequence, a richer and more effective information can be provided to the first decoder to generate the question text.

[0094] Accordingly, S2032 can be specifically defined as follows:

[0095] Based on the first decoding result, the word segmentation vector sequence, and the first attention weights corresponding to the P words, the question text related to the content of the social text is determined.

[0096] The first attention weight can be determined by the first decoder and encoder working together, and the first attention weight is positively correlated with the importance of the corresponding word segment to the generated question text.

[0097] The first attention weight can be, for example, Figure 5 α shown in i , where i∈P. The first decoder can determine the words included in the problem text based on the first decoding result and the vector determined by the word segmentation vector sequence based on the first attention weight.

[0098] In addition to determining the question text via a first decoder, in one possible implementation, the answer text can also be determined via a second decoder. Regarding S301, one possible implementation includes:

[0099] S3011: Based on the text vector and the topic vector, obtain the corresponding second decoding result through the second decoder.

[0100] S3012: Based on the second decoding result, the word segmentation vector sequence, and the second attention weights corresponding to the P words, determine the answer text related to the question text. The second attention weights are positively correlated with the importance of the corresponding words to the generated answer text.

[0101] The second decoder can determine the second decoding result for the generated answer text based on the text vector provided by the encoder and the topic vector provided by the neural topic model, and determine the answer text based on the second decoding result.

[0102] To improve the quality of generated problem text, more information related to social text can be provided to the second decoder, namely the word segmentation vector sequence described in the aforementioned embodiments, which will not be elaborated here.

[0103] The second attention weight can be learned and determined by the second decoder and encoder together. The second attention weight is positively correlated with the importance of the corresponding word segment to the generated answer text.

[0104] The second attention weight can be, for example, a... Figure 5 β shown in i , where i∈P. The second decoder can determine the words included in the answer text based on the second decoding result and the vector determined by the word segmentation vector sequence based on the second attention weight.

[0105] In other words, based on the aforementioned single-decoder network structure, the addition of a second decoder constitutes the dual-decoder network structure provided in this application embodiment. This dual-decoder network structure can be, for example, as shown in the following example... Figure 5 As shown, the second decoder passes through Figure 5 The dashed line shown establishes a data connection with the original single-decoder network structure, forming a dual-decoder network structure.

[0106] The first decoder and the second decoder each employ a set of attention mechanisms. Furthermore, these two decoders can output results (question text and answer text) simultaneously in parallel.

[0107] Optionally, the first decoder and the second decoder mentioned above may employ a unidirectional GRU processing mechanism.

[0108] Since the processes of generating the question text by the first decoder and generating the answer text by the second decoder are relatively similar, the following takes the first decoder as an example to illustrate the specific decoding process of the decoder.

[0109] The first decoder uses the last state vector (text vector) generated by the encoder as the initial state, then reads in the sequence of token vectors (memory warehouse M) and the topic vector (topic distribution θ), and then generates the tokens of the question text one by one according to the following formula.

[0110]

[0111] Among them, Pr() is the probability calculation, is the j-th word in the question text Q, and when q < j, it refers to Q from the 1st to the (j - 1)-th moment.

[0112] In addition, the first attention weight can be determined according to the following formula:

[0113]

[0114] Among them, α ij is used to represent α <​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​The range [0, 1] determines whether to copy or generate, as shown in the following formula:

[0122]

[0123] u j It is the input of the decoder at the current moment, t j W is obtained by weighted summation of context vectors in the attention mechanism. λ and b λ All of them are learnable variables.

[0124] The following describes a model training method provided in an embodiment of this application, which is for the aforementioned dual-decoder network structure.

[0125] The neural topic model, the initial first decoder, and the initial second decoder are jointly trained using training samples to obtain the first loss function corresponding to the initial neural topic model, the second loss function corresponding to the initial first decoder, and the third loss function corresponding to the initial second decoder.

[0126] The parameters of the initial first decoder and the initial second decoder are adjusted according to the first loss function, the second loss function and the third loss function to obtain the first decoder and the second decoder.

[0127] By jointly training the first decoder and the second decoder with the neural topic model, the parameters of the first decoder can be trained based on the loss function of the answer decoder and the loss function of the neural topic model, thereby further optimizing the first decoder.

[0128] It should be noted that the neural topic model can be pre-trained before joint training to allow the parameters of the neural topic model to reach initial convergence, thereby improving the efficiency of subsequent joint training.

[0129] By employing a joint training approach, both a neural topic model and an S2S model with dual decoders are trained simultaneously, where the dual decoders represent a multi-task setup.

[0130] The loss function LNTM for neural topic models is defined as follows:

[0131]

[0132] Where C refers to C bow The first term in the formula is the KL divergence loss, and the second term is the reconstruction loss of the variational encoder-decoder.

[0133] For the loss function L of the first decoder that generates the question text QG as follows:

[0134]

[0135] Where N is the number of training samples, Q n P n and θ n It is the target problem of the nth sample out of N training samples, the original post, topic distribution.

[0136] For the loss function L of the second decoder that generates the answer text AG With L QG similar.

[0137] Therefore, the loss of the entire network structure is ultimately defined as:

[0138]

[0139] Among them, γQ and γA are used to balance the weights of the first decoder and the second decoder.

[0140] It should be noted that the encoder, dual decoder, and neural topic model involved in the embodiments of this application are not limited to specific model versions or specific model types, and can be replaced by other versions of encoders, decoders, and neural topic models.

[0141] 20,000 sample data points were collected from blog platforms and divided into training, validation, and test sets in an 8:1:1 ratio. Experiments show that the solution provided in this application is superior to models in related technologies, as detailed in Tables 1 and 2 below.

[0142]

[0143] Table 1

[0144]

[0145] Table 2

[0146] In Tables 1 and 2, Base represents the most basic S2S model. +Ernie, +Bert, and +RoBerta refer to models that incorporate pre-trained models on top of S2S. There are also three extensions to S2S: +Copy adds a copy mechanism; +topic extracts topic information from the post (body text) itself to assist in question generation; and +Cmt (BiAtt) uses a bidirectional attention mechanism to model the post's comment data (comment text). The model architecture provided in this application includes a single-decoder network structure and a dual-decoder network structure, as detailed in the last two rows of Tables 1 and 2. Cmt (NTM) is a single-decoder network structure that uses a Neural Topic Model (NTM) to model the comment data, outputting question text. Dual Dec is a dual-decoder network structure that outputs both question text and answer text.

[0147] The generated question and answer texts are evaluated using an automated assessment method (including Rouge and Bleu metrics). Higher scores indicate better performance. See Table 1 for the specific evaluation results.

[0148] The manual evaluation was scored as follows: Relevance, Fluency, and Engagingness, with scores of 0, 1, 2, and 3 respectively, representing very poor, poor, good, and very good. See Table 2 for the specific evaluation results.

[0149] Experimental results show that although pre-training methods can improve performance, the improvement is limited. For example, the best pre-trained model, Roberta, achieves a Rouge 1 score of 34.08, far lower than the 37.95 score achieved by the single decoder in this embodiment. The replication mechanism does improve the model, but adding a neural topic model provides further improvement. Furthermore, for the neural topic model, extracting topic vectors from comment text is superior to extracting them from the main text.

[0150] Finally, the dual-decoder version performed better than the single-decoder version. The multi-task training mutually reinforced each other, further improving the quality of problem generation. The analysis of the human scoring results yielded conclusions consistent with those of the automatic evaluation.

[0151] In Table 1, the first column on the left is the model name, and the columns on the right are the performance scores under the automatic evaluation metrics. The number before the plus or minus sign is the average performance of the five experimental results, and the number after the sign is the variance of the multiple experimental results. In Table 2, the first column on the left is the model name, and the columns on the right are the scores given by humans for relevance, fluency, and engagingness.

[0152] Figure 6 This application provides a structural diagram of a question generation device based on social text, wherein the question generation device 600 includes an acquisition unit 601, a determination unit 602, and a generation unit 603.

[0153] The acquisition unit 601 is used to acquire social text to be processed;

[0154] The determining unit 602 is used to determine the first input text of the neural topic model based on the social text, and obtain the topic vector corresponding to the first input text through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model.

[0155] The generation unit 603 is used to generate question text related to the content of the social text using the text vector corresponding to the social text and the topic vector. The question text is used to be displayed together with the social text.

[0156] In one possible implementation, the generating unit is further configured to:

[0157] Using the text vector corresponding to the social text and the topic vector, generate answer text related to the question text;

[0158] A poll is generated based on the question text and the answer text, and the topic of the poll is determined based on the question text. The voting options for the poll are determined based on the answer text.

[0159] In one possible implementation, the question vote is displayed together with the social text.

[0160] In one possible implementation, the social text includes body text and comment text, wherein the comment text is used to identify user comments made to the body text;

[0161] The determining unit is further configured to:

[0162] The comment text is determined as the first input text, and the topic vector corresponding to the comment text is determined by the neural topic model;

[0163] The generation unit is also used for:

[0164] Determine the text vector of the main text;

[0165] Using the text vector and the topic vector, question text related to the content of the social text is generated.

[0166] In one possible implementation, the determining unit is further configured to:

[0167] Determine k bag-of-words vectors corresponding to the first input text, wherein the k bag-of-words vectors respectively identify k topics involved in the input text, k≥1;

[0168] Based on the k bag-of-words vectors, the topic vector corresponding to the input text is determined by the neural topic model.

[0169] In one possible implementation, the generating unit is further configured to:

[0170] Based on the text vector and the topic vector, the corresponding first decoding result is obtained through the first decoder;

[0171] Based on the first decoding result, determine the question text related to the content of the social text.

[0172] In one possible implementation, the device further includes an encoding unit:

[0173] The encoding unit is used to determine a second input text including P words based on the social text, and to obtain a word vector sequence corresponding to the second input text through an encoder. Specifically, for the i-th word among the P words, the i-th word vector in the word vector sequence includes the forward latent variable and the backward latent variable of the i-th word, where P≥1, i∈P.

[0174] The generation unit is further configured to determine the question text related to the content of the social text based on the first decoding result, the word segmentation vector sequence, and the first attention weights corresponding to the P words respectively, wherein the first attention weights are positively correlated with the importance of the corresponding words to the generated question text.

[0175] In one possible implementation, the device further includes an encoding unit:

[0176] The encoding unit is used to determine a second input text including P words based on the social text, and to obtain a word vector sequence corresponding to the second input text through an encoder. Specifically, for the i-th word among the P words, the i-th word vector in the word vector sequence includes the forward latent variable and the backward latent variable of the i-th word, where P≥1, i∈P.

[0177] The generation unit is also used for:

[0178] Based on the text vector and the topic vector, the corresponding second decoding result is obtained through the second decoder;

[0179] Based on the second decoding result, the word segmentation vector sequence, and the second attention weights corresponding to the P words, the answer text related to the question text is determined. The second attention weight is positively correlated with the importance of the corresponding word to the generated answer text.

[0180] In one possible implementation, the device further includes a training unit:

[0181] The training unit is used to jointly train the neural topic model, the initial first decoder, and the initial second decoder using training samples to obtain a first loss function corresponding to the initial neural topic model, a second loss function corresponding to the initial first decoder, and a third loss function corresponding to the initial second decoder.

[0182] The training unit is further configured to adjust the parameters of the initial first decoder and the initial second decoder according to the first loss function, the second loss function and the third loss function to obtain the first decoder and the second decoder.

[0183] In one possible implementation, the acquisition unit is further configured to determine the comment text corresponding to the main text based on its relevance to the main text.

[0184] Therefore, when acquiring social media text for generating question text, given the generally sparse feature characteristics of social media text, the first input text can be determined based on the social media text. Since the neural topic model is a sequence-to-sequence model, it can determine the topic vector from the input text at the semantic level, and then reconstruct the complete text from the topic vector. Thus, the hidden layer of the neural topic model can obtain a hidden layer output with a lower dimension than the first input text and focused on the main idea of ​​the first input text. The topic vector corresponding to the first input text can then be obtained through the hidden layer output of the neural topic model. When generating question text related to the content of the social media text from the text vector corresponding to the social media text, the topic vector can focus on the originally sparse features in the social media text. This not only achieves the generation of question text from the social media text but also makes the question text more relevant to the topic of the social media text, ensuring the quality of question generation and improving the generation effect. Moreover, since the question text is used to be displayed together with the social media text, a concise question text can attract user attention and participation, further increasing the attention given to the social media text and improving user engagement.

[0185] This application also provides a computer device, which will be described below with reference to the accompanying drawings. Please refer to... Figure 7As shown in the figure, this application provides a device, which can also be a terminal device. The terminal device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:

[0186] Figure 7 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 7 The mobile phone includes components such as: a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless Fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490. Those skilled in the art will understand that... Figure 7 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0187] The following is combined with Figure 7 A detailed introduction to each component of a mobile phone:

[0188] RF circuit 1410 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 1480; additionally, it transmits uplink data to the base station. Typically, RF circuit 1410 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), and a duplexer. Furthermore, RF circuit 1410 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).

[0189] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0190] The input unit 1430 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432. The touch panel 1431, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1431), and drive the corresponding connected devices according to a pre-set program. Optionally, the touch panel 1431 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1480, and can also receive and execute commands sent by the processor 1480. In addition, the touch panel 1431 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1431, the input unit 1430 may also include other input devices 1432. Specifically, other input devices 1432 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0191] The display unit 1440 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1440 may include a display panel 1441, which may optionally be configured as a Liquid Crystal Display (LCD), Organic Light-Emitting Diode (OLED), or similar display panel. Further, a touch panel 1431 may cover the display panel 1441. When the touch panel 1431 detects a touch operation on or near it, it transmits the information to the processor 1480 to determine the type of touch event. Subsequently, the processor 1480 provides corresponding visual output on the display panel 1441 based on the type of touch event. Although in Figure 7 In this embodiment, the touch panel 1431 and the display panel 1441 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1431 and the display panel 1441 can be integrated to realize the input and output functions of the mobile phone.

[0192] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1441 according to the ambient light level, and the proximity sensor can turn off the display panel 1441 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0193] Audio circuit 1460, speaker 1461, and microphone 1462 provide an audio interface between the user and the mobile phone. Audio circuit 1460 converts received audio data into electrical signals and transmits them to speaker 1461, where speaker 1461 converts them into sound signals for output. On the other hand, microphone 1462 converts collected sound signals into electrical signals, which are received by audio circuit 1460, converted into audio data, and then processed by processor 1480 before being transmitted via RF circuit 1410 to, for example, another mobile phone, or the audio data can be output to memory 1420 for further processing.

[0194] WiFi is a short-range wireless transmission technology. Mobile phones, through the WiFi module 1470, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 7 WiFi module 1470 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.

[0195] The processor 1480 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 1420, and by calling data stored in the memory 1420. Optionally, the processor 1480 may include one or more processing units; preferably, the processor 1480 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 1480.

[0196] The mobile phone also includes a power supply 1490 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1480 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0197] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0198] In this embodiment, the processor 1480 included in the terminal device also has the following functions:

[0199] Retrieve social text to be processed;

[0200] The first input text of the neural topic model is determined based on the social text, and the topic vector corresponding to the first input text is obtained through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model.

[0201] Using the text vector corresponding to the social text and the topic vector, question text related to the content of the social text is generated, and the question text is used to be displayed together with the social text.

[0202] This application also provides a server; please refer to [link / reference]. Figure 8 As shown, Figure 8 This is a structural diagram of a server 1500 provided in an embodiment of this application. The server 1500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1522 (e.g., one or more processors) and memory 1532, and one or more storage media 1530 (e.g., one or more mass storage devices) for storing application programs 1542 or data 1544. The memory 1532 and storage media 1530 can be temporary or persistent storage. The program stored in the storage media 1530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1522 may be configured to communicate with the storage media 1530 and execute the series of instruction operations in the storage media 1530 on the server 1500.

[0203] Server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server. TM Mac OS XTM Unix TM Linux TM FreeBSD TM etc.

[0204] The steps performed by the server in the above embodiments can be based on Figure 8 The server structure shown.

[0205] In addition, this application embodiment also provides a storage medium for storing a computer program for executing the method provided in the above embodiment.

[0206] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to perform the methods provided in the above embodiments.

[0207] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk or optical disk, and other media that can store program code.

[0208] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0209] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A question generation method based on social text, characterized in that, The method includes: Retrieve social text to be processed; The first input text of the neural topic model is determined based on the social text, and the topic vector corresponding to the first input text is obtained through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model. Using the text vector corresponding to the social text and the topic vector, question text related to the content of the social text is generated, and the question text is used to be displayed together with the social text. The social text includes body text and comment text, wherein the comment text is used to identify user comments on the body text; The step of determining the first input text for the neural topic model based on the social text, and obtaining the topic vector corresponding to the first input text through the neural topic model, includes: The comment text is determined as the first input text, and the topic vector corresponding to the comment text is determined by the neural topic model; The step of generating question text related to the content of the social text using the text vector corresponding to the social text and the topic vector includes: Determine the text vector of the main text; Using the text vector and the topic vector, question text related to the content of the social text is generated.

2. The method according to claim 1, characterized in that, The method further includes: Using the text vector corresponding to the social text and the topic vector, generate answer text related to the question text; A poll is generated based on the question text and the answer text, and the topic of the poll is determined based on the question text. The voting options for the poll are determined based on the answer text.

3. The method according to claim 2, characterized in that, The question poll is displayed in conjunction with the social text.

4. The method according to claim 1, characterized in that, The step of determining the first input text for the neural topic model based on the social text, and obtaining the topic vector corresponding to the first input text through the neural topic model, includes: Determine k bag-of-words vectors corresponding to the first input text, wherein the k bag-of-words vectors respectively identify k topics involved in the input text, k≥1; Based on the k bag-of-words vectors, the topic vector corresponding to the input text is determined by the neural topic model.

5. The method according to any one of claims 1-4, characterized in that, The step of generating question text related to the content of the social text using the text vector corresponding to the social text and the topic vector includes: Based on the text vector and the topic vector, the corresponding first decoding result is obtained through the first decoder; Based on the first decoding result, determine the question text related to the content of the social text.

6. The method according to claim 5, characterized in that, The method further includes: Based on the social text, a second input text comprising P words is determined, and a word segmentation vector sequence corresponding to the second input text is obtained through an encoder. Here, for the i-th word among the P words, the i-th word segmentation vector in the word segmentation vector sequence includes the forward latent variable and the backward latent variable of the i-th word, P≥1, i∈P; The step of determining the question text related to the content of the social text based on the first decoding result includes: Based on the first decoding result, the word segmentation vector sequence, and the first attention weights corresponding to the P words, the question text related to the content of the social text is determined. The first attention weight is positively correlated with the importance of the corresponding word in generating the question text.

7. The method according to claim 5, characterized in that, The method further includes: Based on the social text, a second input text comprising P words is determined, and a word segmentation vector sequence corresponding to the second input text is obtained through an encoder. Here, for the i-th word among the P words, the i-th word segmentation vector in the word segmentation vector sequence includes the forward latent variable and the backward latent variable of the i-th word, P≥1, i∈P; If an answer text related to the question text is generated using the text vector corresponding to the social text and the topic vector, then generating the answer text related to the question text using the text vector corresponding to the social text and the topic vector includes: Based on the text vector and the topic vector, the corresponding second decoding result is obtained through the second decoder; Based on the second decoding result, the word segmentation vector sequence, and the second attention weights corresponding to the P words, the answer text related to the question text is determined. The second attention weight is positively correlated with the importance of the corresponding word to the generated answer text.

8. The method according to claim 7, characterized in that, The method further includes: The neural topic model, the initial first decoder, and the initial second decoder are jointly trained using training samples to obtain a first loss function corresponding to the initial neural topic model, a second loss function corresponding to the initial first decoder, and a third loss function corresponding to the initial second decoder. The parameters of the initial first decoder and the initial second decoder are adjusted according to the first loss function, the second loss function and the third loss function to obtain the first decoder and the second decoder.

9. The method according to claim 1, characterized in that, The method further includes: Based on its relevance to the main text, the comment text corresponding to the main text is determined.

10. A question generation device based on social text, characterized in that, The device includes an acquisition unit, a determination unit, and a generation unit: The acquisition unit is used to acquire the social text to be processed; The determining unit is configured to determine the first input text of the neural topic model based on the social text, and obtain the topic vector corresponding to the first input text through the neural topic model. The neural topic model is a sequence-to-sequence network model, and the topic vector is determined based on the hidden layer output of the neural topic model. The generation unit is used to generate question text related to the content of the social text using the text vector corresponding to the social text and the topic vector. The question text is used to be displayed together with the social text. The social text includes body text and comment text, wherein the comment text is used to identify user comments on the body text; The determining unit is further configured to: The comment text is determined as the first input text, and the topic vector corresponding to the comment text is determined by the neural topic model; The generation unit is also used for: Determine the text vector of the main text; Using the text vector and the topic vector, question text related to the content of the social text is generated.

11. The apparatus according to claim 10, characterized in that, The generation unit is also used for: Using the text vector corresponding to the social text and the topic vector, generate answer text related to the question text; A poll is generated based on the question text and the answer text, and the topic of the poll is determined based on the question text. The voting options for the poll are determined based on the answer text.

12. The apparatus according to claim 11, characterized in that, The question poll is displayed in conjunction with the social text.

13. The apparatus according to claim 10, characterized in that, The determining unit is further configured to: Determine k bag-of-words vectors corresponding to the first input text, wherein the k bag-of-words vectors respectively identify k topics involved in the input text, k≥1; Based on the k bag-of-words vectors, the topic vector corresponding to the input text is determined by the neural topic model.

14. The apparatus according to any one of claims 10-13, characterized in that, The generation unit is also used for: Based on the text vector and the topic vector, the corresponding first decoding result is obtained through the first decoder; Based on the first decoding result, determine the question text related to the content of the social text.

15. The apparatus according to claim 14, characterized in that, The device also includes an encoding unit; The encoding unit is used to determine a second input text including P words based on the social text, and to obtain a word vector sequence corresponding to the second input text through an encoder. Specifically, for the i-th word among the P words, the i-th word vector in the word vector sequence includes the forward latent variable and the backward latent variable of the i-th word, where P≥1, i∈P. The generation unit is further configured to: Based on the first decoding result, the word segmentation vector sequence, and the first attention weights corresponding to the P words, the question text related to the content of the social text is determined. The first attention weight is positively correlated with the importance of the corresponding word in generating the question text.

16. The apparatus according to claim 14, characterized in that, The device also includes an encoding unit; The encoding unit is used to determine a second input text including P words based on the social text, and to obtain a word vector sequence corresponding to the second input text through an encoder. Specifically, for the i-th word among the P words, the i-th word vector in the word vector sequence includes the forward latent variable and the backward latent variable of the i-th word, where P≥1, i∈P. If an answer text related to the question text is generated using the text vector corresponding to the social text and the topic vector, then the generation unit is further configured to: Based on the text vector and the topic vector, the corresponding second decoding result is obtained through the second decoder; Based on the second decoding result, the word segmentation vector sequence, and the second attention weights corresponding to the P words, the answer text related to the question text is determined. The second attention weight is positively correlated with the importance of the corresponding word to the generated answer text.

17. The apparatus according to claim 16, characterized in that, The device also includes a training unit; The training unit is used to jointly train the neural topic model, the initial first decoder, and the initial second decoder using training samples to obtain a first loss function corresponding to the initial neural topic model, a second loss function corresponding to the initial first decoder, and a third loss function corresponding to the initial second decoder. The training unit is further configured to adjust the parameters of the initial first decoder and the initial second decoder according to the first loss function, the second loss function and the third loss function to obtain the first decoder and the second decoder.

18. The apparatus according to claim 10, characterized in that, The acquisition unit is also used for: Based on its relevance to the main text, the comment text corresponding to the main text is determined.

19. A computer device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the social text-based question generation method according to any one of the claims 1-9, based on instructions in the program code.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for executing the question generation method based on social text as described in any one of claims 1-9.

21. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer, cause the computer to perform the social text-based question generation method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Question generation

    US20200183963A1