Question recommendation method and device, electronic device and storage medium

By training text classification models to screen questions that meet user dialogue habits, the problem of inaccurate recommendation of human-computer dialogue systems in the existing technology is solved and the user experience is improved.

CN113254611BActive Publication Date: 2025-08-08BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110542088.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-18
Publication Date
2025-08-08
Estimated Expiration
2041-05-18

AI Technical Summary

Technical Problem

The existing human-computer dialogue system is difficult to recommend questions that meet user needs based on user conversation habits, resulting in poor user experience.

Method used

By training the text classification model, using the user's historical dialogue information and preset dialogue data sets, we can filter out the questions to be recommended that meet the user's dialogue habits, and fine-tune them using the Bert model to improve the accuracy of question recommendations.

Benefits of technology

It improves the accuracy of question recommendations, improves the user experience, and meets the user's dialogue needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113254611B_ABST
    Figure CN113254611B_ABST
Patent Text Reader

Abstract

The present disclosure provides a question recommendation method and apparatus, electronic device, and storage medium. Before a round of human-computer interaction dialogue begins, at least one candidate question is selected and recommended to the user based on at least one previous round of historical dialogue and multiple candidate questions. Because the previous round of dialogue can reflect the user's conversational habits, the questions recommended to the user by the human-computer interaction system are more consistent with the user's conversational habits and can effectively meet the user's conversational needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of information technology, and in particular to a question recommendation method and device, an electronic device, and a storage medium. Background Art

[0002] With the development of natural language processing technology, human-computer interaction technology can realize human-computer dialogue, allowing people to quickly get answers to questions. After receiving the dialogue content input by the user, the electronic device performs semantic analysis on the dialogue content, determines and outputs the reply statement.

[0003] However, it is currently difficult to form a continuous human-computer dialogue during human-computer interaction to well meet the user's dialogue needs. Summary of the Invention

[0004] To overcome the problems existing in the related art, the present disclosure provides a question recommendation method and device, an electronic device and a storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a question recommendation method is provided, the method comprising:

[0006] For each round of human-computer interaction dialogue, determining multiple candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers;

[0007] Determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information;

[0008] The at least one question to be recommended is recommended to the user.

[0009] In some embodiments, determining multiple candidate questions for this round of dialogue includes:

[0010] Obtain the question from the previous round of dialogue and determine multiple similar questions with similar meanings to the question;

[0011] For each similar question, determine a question pair with the similar question as the previous question from a preset conversation dataset;

[0012] determining the subsequent question in the question pair as one of the alternative questions;

[0013] The preset dialogue data set includes a plurality of question pairs consisting of a preceding question and a subsequent question.

[0014] In some embodiments, the historical conversation information includes at least one set of historical questions and historical answers that are immediately and continuously preceding the current round of conversation.

[0015] In some embodiments, determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information includes:

[0016] For each candidate question, the candidate question and the historical conversation information are arranged in order of occurrence from earliest to latest into a sentence sequence as the text to be classified corresponding to the candidate question;

[0017] Input the text to be classified corresponding to the alternative question into the trained text classification model;

[0018] Obtain the probability that the text to be classified corresponding to the alternative question belongs to the first category of text;

[0019] Alternative questions whose corresponding probabilities are greater than the specified probability are determined as questions to be recommended.

[0020] In some embodiments, inputting the to-be-classified text corresponding to the candidate question into the user-specific text classification model includes:

[0021] The user portrait vector representing the specific user and the text to be classified corresponding to the alternative question are input into the text classification model.

[0022] In some embodiments, the text classification model is trained based on the following steps:

[0023] Obtaining a dataset of the first type of text and a dataset of the second type of text;

[0024] Using the dataset of the first type of text as positive samples and the dataset of the second type of text as negative samples, fine-tune the pre-trained BERT model;

[0025] The fine-tuned BERT model is determined as the text classification model.

[0026] In some embodiments, each of the first-type texts is used to represent a sentence sequence corresponding to a historical human-computer dialogue data, and each of the second-type texts is used to represent a sentence sequence corresponding to a simulated human-computer dialogue data;

[0027] The sentence sequence is formed by arranging the question sentence of the current dialogue and the historical dialogue information of at least one dialogue round before the current dialogue round in the order of occurrence from first to last.

[0028] In some embodiments, the designated position of the statement sequence also includes a user portrait vector representing a specific user; the designated position includes: the beginning or the end of the sequence.

[0029] According to a second aspect of an embodiment of the present disclosure, a question recommendation device is provided, the device comprising:

[0030] An acquisition module, for each round of human-computer interaction dialogue, determines a plurality of candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers;

[0031] a determination module, which determines at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information;

[0032] The recommendation module recommends the at least one question to be recommended to the user.

[0033] In some embodiments, the acquisition module obtains questions from the previous round of dialogue before the current round of dialogue, and determines multiple approximate questions with similar meanings to the current question; for each approximate question, determines a question pair with the approximate question as the previous question from a preset dialogue data set; and determines the subsequent question in the question pair as one of the alternative questions; wherein the preset dialogue data set includes multiple question pairs consisting of a previous question and a subsequent question.

[0034] In some embodiments, the historical conversation information includes at least one set of historical questions and historical answers that are immediately and continuously preceding the current round of conversation.

[0035] In some embodiments, the determination module arranges, for each of the alternative questions, the alternative questions and the historical conversation information into a sentence sequence in order of occurrence, as the text to be classified corresponding to the alternative question; inputs the text to be classified corresponding to the alternative question into a trained text classification model; obtains the probability that the text to be classified corresponding to the alternative question belongs to the first category of text; and determines the alternative question whose corresponding probability is greater than the specified probability as the question to be recommended.

[0036] In some embodiments, the determination module inputs a user portrait vector representing a specific user and the text to be classified corresponding to the alternative question into the text classification model.

[0037] In some embodiments, the text classification model is trained based on the following steps:

[0038] Obtaining a dataset of the first type of text and a dataset of the second type of text;

[0039] Using the dataset of the first type of text as positive samples and the dataset of the second type of text as negative samples, fine-tune the pre-trained BERT model;

[0040] The fine-tuned BERT model is determined as the text classification model.

[0041] In some embodiments, each of the first-type texts is used to represent a sentence sequence corresponding to a historical human-computer dialogue data, and each of the second-type texts is used to represent a sentence sequence corresponding to a simulated human-computer dialogue data;

[0042] The sentence sequence is formed by arranging the question sentence of the current dialogue and the historical dialogue information of at least one dialogue round before the current dialogue round in the order of occurrence from first to last.

[0043] In some embodiments, the designated position of the statement sequence also includes a user portrait vector representing a specific user; the designated position includes: the beginning or the end of the sequence.

[0044] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method described in the first aspect.

[0045] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0046] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:

[0047] In the disclosed embodiment, for each round of human-computer interaction, at least one recommended question can be determined and recommended to the user based on historical conversation information from at least one previous round and multiple candidate questions. Because the historical conversation information prior to the current round can reflect the user's conversational habits, the determined recommended question can better align with the user's conversational habits, thereby improving the accuracy of the recommended questions for each user, enhancing the user experience, and better meeting the user's conversational needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0049] Figure 1 The figure is a flowchart of a question recommendation method provided according to an exemplary embodiment of the present disclosure.

[0050] Figure 2 It is a flowchart of a model training method provided according to an exemplary embodiment of the present disclosure.

[0051] Figure 3 3 is a schematic diagram of comparing sentence sequences of positive and negative samples provided according to an exemplary embodiment of the present disclosure.

[0052] Figure 4 It is a flowchart of another question recommendation method provided according to an exemplary embodiment of the present disclosure.

[0053] Figure 5 It is a structural diagram of a question recommendation device provided according to an exemplary embodiment of the present disclosure.

[0054] Figure 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.

[0055] Figure 7 is a block diagram of another electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

[0057] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0058] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."

[0059] Chatty human-computer dialogue systems are non-task-oriented chatbot products. Their primary function is to engage in casual conversations with users, typically in a series of rounds of dialogue, one question (initiated by the user) and one answer (answered by the system). In practice, to enhance the user experience, human-computer dialogue systems often present one or more recommended questions to the user after each round of dialogue ends and before the next. The user can then select a question to initiate the next round of dialogue, or ignore the system's recommended questions and instead enter their own questions.

[0060] The inventors discovered in their research that the questions recommended by various current human-computer dialogue systems often fail to meet the user's conversation needs, resulting in a poor user experience. This is because these systems typically do not consider the conversation habits of individual users. Instead, they either recommend questions based on a general corpus, ignoring the user's personality; or they recommend similar questions based solely on a single user's past questions, ignoring the fact that users generally do not ask similar questions repeatedly; or they recommend questions related to entity names (such as "what clothes do you like") based on entity names that appeared in the user's previous questions (such as "clothes"), ignoring the fact that in many cases, the user's previous questions did not include entity names.

[0061] To address the above issues, the embodiments of the present disclosure aim to provide a method that considers the conversational habits of different users, constructs different question recommendation strategies for different users, and achieves "one size fits all" approach. In the embodiments of the present disclosure, for each round of human-computer interaction dialogue, at least one question to be recommended can be determined and recommended to the user based on at least one previous round of historical dialogue information and multiple alternative questions. Because the historical dialogue information before the current round of dialogue can reflect the user's conversational habits, the determined question to be recommended can be more consistent with the user's conversational habits, thereby improving the accuracy of the recommended questions for each user, enhancing the user experience, and better meeting the user's conversational needs.

[0062] Figure 1 FIG. 1 is a flowchart of a question recommendation method provided by an exemplary embodiment of the present disclosure, the method comprising:

[0063] S100: For each round of human-computer interaction dialogue, determine a plurality of candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue.

[0064] Figure 1The method shown can be applied to electronic devices, which can be understood as electronic devices equipped with a human-computer dialogue system, and the human-computer dialogue system can be understood as a system that supports human-computer dialogue functions, such as a voice control system equipped with an intelligent voice assistant that can support human-computer dialogue; the electronic device can be a mobile device such as a smart phone, tablet computer, smart watch, smart bracelet, smart speaker, PDA (English: Personal Digital Assistant, Chinese: Personal Digital Assistant), or a fixed device such as a desktop computer.

[0065] The database corresponding to the human-computer dialogue system can store many alternative questions, which can generally cover various topics of daily chat. In some embodiments, before a round of dialogue begins, multiple alternative questions can be randomly selected as multiple alternative questions for the current round of dialogue.

[0066] In other embodiments, before a round of dialogue begins, multiple candidate questions that match the context can be retrieved from a database based on historical dialogues before the current round of dialogue, and used as the multiple candidate questions for the current round of dialogue.

[0067] In step S100, the historical conversation information prior to the current conversation round includes at least one set of historical questions and answers. In some embodiments, the at least one set of historical questions and answers may be at least one set of historical questions and answers immediately preceding and following the current conversation round. Such historical conversation information is more contextually connected to the current conversation round.

[0068] S102: Determine at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information.

[0069] In some embodiments of the present disclosure, a human can manually analyze several rounds of historical conversations between a user and a human-computer dialogue system to summarize the user's conversational habits, and then determine a mapping relationship between different features corresponding to the user's historical conversations and different candidate questions. When question recommendations are needed, multiple candidate questions and historical conversation information prior to the current round of conversation are determined. Based on the determined historical conversation information and the mapping relationship between the different features and different candidate questions, one or more candidate questions are screened from the multiple candidate questions. The screened candidate questions are the questions to be recommended to the user.

[0070] In other embodiments of the present disclosure, artificial intelligence technology can be used to learn the user's conversation habits from historical conversations. The conversation between the user and the human-computer dialogue system can be used as a text sample to train a text classification model. In this way, in step S102, for each of the alternative questions, the alternative questions and the historical dialogue information can be arranged into a sentence sequence in the order of occurrence from first to last, as the text to be classified corresponding to the alternative question. The text to be classified corresponding to the alternative question is input into the trained text classification model to obtain the probability that the text to be classified corresponding to the alternative question belongs to the first category of text, and then the alternative questions whose corresponding probabilities are greater than the specified probability are determined as questions to be recommended.

[0071] Among them, the first type of text refers to the dialogue text that can reflect the user's conversation habits. Usually, during the model training phase, the dialogue text that actually occurred between the user and the human-computer dialogue system can be used as the first type of text. Correspondingly, the dialogue text that does not conform to the user's conversation habits can be the second type of text. During the model training phase, some dialogue texts that do not conform to the user's conversation habits can be collected (such as dialogue texts of other users), or the second type of text can be obtained by making certain modifications based on the first type of text. For example, the last question in the first type of text can be modified to a question that does not conform to the user's habits.

[0072] Furthermore, a user profile vector representing a specific user and the text to be classified corresponding to the candidate question can be input into the text classification model. The user referred to herein refers to the user of the human-computer dialogue system. The user profile vector of a user is a representation of the user's profile from the perspective of the human-computer dialogue system, which is actually a representation of the user's conversational habits.

[0073] In some possible implementations, the text classification model is trained based on the following steps: obtaining a dataset of the first category of text and a dataset of the second category of text; using the dataset of the first category of text as a positive sample and the dataset of the second category of text as a negative sample; fine-tuning the pre-trained BERT model; and determining the fine-tuned BERT model as the text classification model.

[0074] Each first-category text represents a sentence sequence corresponding to a historical human-computer dialogue, and each second-category text represents a sentence sequence corresponding to a simulated human-computer dialogue. The sentence sequence is formed by arranging the question sentence from the current dialogue round and the historical dialogue information from at least one previous dialogue round in the order in which it occurred.

[0075] In addition, the specified position of the sentence sequence may also include a user profile vector representing a specific user. The specified position includes: the beginning or the end of the sequence.

[0076] S104: Recommend the at least one question to be recommended to the user. In some embodiments, the method for determining multiple alternative questions for a round of dialogue can also be: before the start of the round of dialogue, the questions of the previous round of dialogue of the round of dialogue can be obtained, and multiple approximate questions with similar meanings to the question can be determined. Then, for each approximate question, a question pair with the approximate question as the previous question is determined from the preset dialogue data set. Then, the subsequent question in the question pair is determined as one of the alternative questions. The preset dialogue set includes multiple question pairs consisting of a previous question and a subsequent question, and the preset dialogue set can be a dialogue set determined based on a general corpus.

[0077] For example, the format of the default conversation dataset can be<q1,r1,q2,r2,...> , where q represents the question and r represents the answer. Extract two adjacent q as a question pair, such as<q1,q2> 、<q2,q3> 、<q3、q4> Similarly, in each question pair, there are earlier questions and later questions. These question pairs are sorted by the time corresponding to the earlier question, from first to last, to create an inverted index, and the inverted index is stored in the corresponding data of the human-computer dialogue system for easy retrieval. In some possible implementations, the application scenario corresponding to this method can be that when a user asks a round of questions, the human-computer dialogue system determines the questions to be recommended based on the round of questions, outputs the corresponding answers for the round of questions, and recommends the determined questions to be recommended to the user. The human-computer dialogue system determines whether the question to be recommended is the next round of questions based on the user's corresponding instructions, and repeats the above process to have a long-term dialogue with the user. Among them, the user's corresponding instruction can be an instruction for indicating that the question to be recommended is the next round of questions. The human-computer dialogue system can determine that the question to be recommended is the next round of questions based on the instruction, and further determine the next question to be recommended based on the next round of questions.

[0078] In addition, embodiments of the present disclosure also provide a method for training a text classification model based on the Bert algorithm. This method can fine-tune a text classification model using a pre-trained Bert model, constructing a dedicated text classification model for each user. This text classification model is applied to a question recommendation method, which includes the following steps: before a round of human-computer interaction begins, based on at least one round of interaction prior to the current round, determining at least one candidate question to recommend to the user from multiple candidate questions corresponding to the current round of interaction.

[0079] The process of determining the text classification model involves using questions from an actual conversation between the user and the human-computer dialogue system, as well as text from at least one previous conversation, as positive samples. Questions from a hypothetical conversation between the user and the human-computer dialogue system, as well as text from at least one previous conversation, are used as negative samples. Using these positive and negative samples, the pre-trained BERT model is fine-tuned for the text classification task. The fine-tuned BERT model can then be used to implement text classification tasks.

[0080] In the question recommendation method, before a round of human-computer dialogue begins, for each alternative question corresponding to the round of dialogue, the alternative question and the text to be classified obtained in each round of dialogue in at least one round of dialogue before the round of dialogue are input into the text classification model, and the output is the probability that the text to be classified belongs to the first category of text. Then, the alternative questions corresponding to the text to be classified that has a higher probability of belonging to the first category of text are recommended to the user. Figure 2 : is a flowchart of a model training method provided by an exemplary embodiment of the present disclosure, including:

[0081] S200: Acquire a first-category text set and a second-category text set.

[0082] S202: Using the first type of text set as positive samples and the second type of text set as negative samples, fine-tune the pre-trained BERT model.

[0083] S204: Determine the fine-tuned BERT model as the user-specific text classification model.

[0084] In the embodiments of the present disclosure, the first type of text refers to the text of the actual conversation between the user and the human-computer dialogue system, which serves as the positive sample for model training; the second type of text refers to the text that contains at least part of the conversation that has not occurred between the user and the human-computer dialogue system, which serves as the negative sample for model training.

[0085] Each first-category text may be a sequence of sentences corresponding to a round of dialogue that actually occurred between the user and the human-computer dialogue system. The sequence of sentences is: the question sentences of the current round of dialogue, the question sentences and the answer sentences of each round of dialogue in at least one round of dialogue before the current round of dialogue, arranged in order of occurrence.

[0086] Each second-category text may be a sequence of sentences corresponding to a hypothetical round of dialogue between a user and a human-computer dialogue system, wherein the sequence of sentences is: a sequence of sentences formed by arranging the question sentences of the current round of dialogue, the question sentences of each round of dialogue in at least one round of dialogue before the current round of dialogue, and the answer sentences in the order of occurrence from first to last.

[0087] It should be noted that in the sentence sequence of the second type of text, which serves as negative samples, the last question (the question the user is assumed to ask in the upcoming conversation) is hypothetical and does not actually occur. Any other sentence in the sentence sequence of the second type of text can be either actual or hypothetical.

[0088] In some embodiments, questions and answers from multiple rounds of actual conversations between a user and a human-computer dialogue system can be arranged in order of occurrence to form a basic sentence sequence. This basic sentence sequence is then supplemented with questions actually posed to the human-computer dialogue system by the user in a subsequent round of conversation, yielding a sentence sequence representing the first category of text. For example, these could be questions the user actually selected from the questions recommended by the human-computer dialogue system before the start of that round of conversation, or questions the user actually entered. This basic sentence sequence is supplemented with questions the user did not actually posed to the human-computer dialogue system afterward, yielding a sentence sequence representing the second category of text. For example, these could be questions recommended to the user by the human-computer dialogue system before the start of that round of conversation but not selected.

[0089] Figure 3 is a schematic diagram of a comparison of sentence sequences of positive and negative samples provided according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the basic sentence sequence "Have you eaten (user question), Yes (system answer), What did you eat (user question), Beef ramen (user answer)" actually occurred, while "How much is a bowl?" is an actual user question, and "Which ramen?" is a hypothetical user question that did not actually occur. In other words, the difference between positive and negative samples lies primarily in the questions asked in the current round of conversation. Regardless of the sentence sequence in the positive or negative samples, all sentences except the last question (corresponding to questions and answers from one or more previous rounds of conversation) actually occurred. This allows the model training process to more specifically learn: given several previous rounds of conversation, what are the user's habits for asking questions in the next round of conversation?

[0090] In some embodiments of the present disclosure, as previously described, the sentence sequence corresponding to a conversation round is the question sentence from the conversation round, the question sentence from each conversation round in at least one previous conversation round, and the answer sentence from each conversation round, arranged in descending order. The specific number of "at least one conversation round" before the conversation round can be specified as needed and is not limited by the present disclosure. For example, if analysis finds that the conversation round is closely related to the three previous conversation rounds, this number can be three.

[0091] In addition, the "at least one round" of dialogue before the current round of dialogue can be at least one round of dialogue immediately preceding the current round of dialogue. The at least one round of dialogue immediately preceding the current round of dialogue and continuing therewith can further reflect the context before the current round of dialogue begins.

[0092] In practical applications, usually in the early stages of a conversation between a user and a human-computer dialogue system, questions can be recommended to the user based on methods in related technologies to collect sufficient samples.

[0093] The BERT model, short for Bidirectional Encoder Representation from Transformers, is a natural language processing model proposed by Google. It is pre-trained on general text and has learned a vector representation of each Chinese character (or foreign word) based on general text. The pre-trained BERT model can be further fine-tuned using samples from specific downstream tasks (text in the context of the downstream task) to complete the task.

[0094] The input of the BERT model is text (i.e., a sequence of sentences), and when the BERT model needs to be applied to a text classification task, the text classification can be annotated in front of the input text to indicate that it complies with the CLS, so as to prompt the BERT model to learn the classification of the input text. In one or more embodiments of the present specification, the first type of text set is annotated as a positive sample (e.g., represented by 1), and the second type of text set is annotated as a negative sample (e.g., represented by 0), and the sample annotation is written into the CLS before the text corresponding to each sample, and input into the pre-trained BERT model for continued training (also known as fine-tuning).

[0095] The fine-tuned BERT model can then be used as a text classification model for text classification tasks in human-computer dialogue scenarios. Specifically, the input of a text classification model is the text to be classified (a sequence of sentences), and the output includes a vector corresponding to the CLS of the text to be classified. This vector can be mapped to the classification probability of the text (i.e., the probability of the text belonging to the first category or the probability of the text belonging to the second category).

[0096] In some embodiments, after applying the text classification model to the question recommendation method, several newly generated first-category texts can be obtained as positive samples to further fine-tune the text classification model. For example, assuming the human-computer dialogue system's service hours are from 12:00 AM to 11:50 PM daily, the text classification model can be fine-tuned based on the positive samples (and negative samples) collected that day between 11:50 PM and 12:00 AM daily to complete the optimization. The optimized text classification model for that day can be put online at 12:00 AM the next day, and this cycle can be repeated.

[0097] Furthermore, in some embodiments, a user's profile representation can be included at a specific location in the sentence sequence, whether for positive or negative samples. This specific location can include the beginning or end of the sequence. This means that user profile information can be incorporated into both positive and negative samples, allowing the samples to better reflect the user's personality and further enhancing the learning of user personality during model training.

[0098] It should be noted here that the user mentioned in this article refers to the user of the human-computer dialogue system; and the user portrait representation refers to the user portrait representation from the perspective of the human-computer dialogue system, which is actually a portrait representation related to the user's dialogue habits.

[0099] In actual applications, when a user first uses the human-computer dialogue system, a user profile can be assigned to the user. During the initial user interaction with the human-computer dialogue system, the pre-trained BERT model can be fine-tuned based on collected samples. The input of the fine-tuned BERT model includes a user profile representation, which has also been fine-tuned. In fact, the user profile representation optimized based on several conversations between the user and the human-computer dialogue system is an updated user profile representation. In some embodiments, an updated user profile representation is obtained after each optimization of the text classification model. When the text classification model needs to be optimized the next day, the user profile representation in the samples is also the latest.

[0100] It should also be noted that when a user uses the human-computer dialogue system for the first time, the user profile assigned to the user can be blank or randomly assigned.

[0101] Furthermore, user profiles of other users who used the human-computer dialogue system for the first time within a short time before the user can be assigned to the user as their user profile. Since new users of the human-computer dialogue system are often in the initial stages of exploring how to conduct conversations and have similar conversational habits, directly assigning the user profile of the new user, which was optimized through several early rounds of conversation with other users who recently used the human-computer dialogue system for the first time, can reduce the number of optimization iterations required for the user profile.

[0102] Figure 4 is a flowchart of another question recommendation method provided by an exemplary embodiment of the present disclosure. Figure 4 The steps shown in are steps performed before a round of dialogue between a user and the human-computer dialogue system begins.

[0103] S400: Acquire multiple candidate questions corresponding to the current round of dialogue, and acquire questions and answers from each round of dialogue in at least one round of dialogue before the current round of dialogue.

[0104] Figure 4 The execution subject of the method shown is the human-computer dialogue system. The human-computer dialogue system can call Figure 2 The text classification model determined by the method shown is used for question recommendation.

[0105] In some embodiments, multiple candidate questions can be randomly obtained from the question library.

[0106] In some embodiments, a question group consisting of a preceding question and a subsequent question can be determined in advance based on a common conversation dataset. Thus, when obtaining multiple candidate questions corresponding to a given conversation round, questions from the previous conversation round can be obtained and multiple similar questions with similar meanings can be determined. For each similar question, a question group is determined with the similar question as the preceding question, and the subsequent question in the question group is then determined as a candidate question.

[0107] S402: For each candidate question corresponding to the current round of dialogue, the candidate question, questions and answers from each round of dialogue in at least one previous round of dialogue are arranged in descending order of occurrence into a sentence sequence as the text to be classified corresponding to the candidate question.

[0108] In some embodiments, the designated position of the statement sequence corresponding to each alternative question further includes: a user portrait representation of the user; the designated position includes: the beginning or the end of the sequence.

[0109] S404: Inputting the text to be classified corresponding to the candidate question into the user-specific text classification model, and outputting the probability that the text to be classified corresponding to the candidate question belongs to the first category of text.

[0110] S406: Recommending alternative questions whose corresponding probabilities are greater than the specified probability to the user.

[0111] The greater the probability that the text to be classified for a candidate question belongs to the first category, the more likely the candidate question is to align with the user's conversational habits. In practice, the candidate questions can be sorted by probability, from highest to lowest, and the top N candidate questions can be recommended to the user.

[0112] It is understood that in step S404, the probability that the text to be classified corresponding to the candidate question belongs to the second type of text may also be output. In this way, the lower the probability that the text to be classified corresponding to a candidate question belongs to the second type of text, the more the candidate question conforms to the user's conversational habits. In this way, in step S406, the candidate questions with corresponding probabilities less than a certain probability may be recommended to the user.

[0113] For the sake of simplicity, the aforementioned method embodiments are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited to the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.

[0114] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0115] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.

[0116] Figure 5 1 is a schematic diagram of a structure of a question recommendation device provided according to an exemplary embodiment of the present disclosure, comprising:

[0117] Acquisition module 501, for each round of human-computer interaction dialogue, determines multiple candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers;

[0118] A determination module 502 determines at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information;

[0119] The recommendation module 503 recommends the at least one question to be recommended to the user.

[0120] In some embodiments, the acquisition module 501 is specifically configured to:

[0121] Obtain questions from the previous round of dialogue before the current round of dialogue, and determine multiple approximate questions with similar meanings to the current question; for each approximate question, determine a question pair with the approximate question as the previous question from a preset dialogue dataset; determine the subsequent question in the question pair as one of the alternative questions; wherein the preset dialogue dataset includes multiple question pairs consisting of a previous question and a subsequent question.

[0122] In some embodiments, the historical conversation information includes at least one set of historical questions and historical answers that are immediately and continuously preceding the current round of conversation.

[0123] In some embodiments, the determining module 502 is specifically configured to:

[0124] For each of the alternative questions, the alternative questions and the historical conversation information are arranged into a sentence sequence in order of occurrence, as the text to be classified corresponding to the alternative question; the text to be classified corresponding to the alternative question is input into a trained text classification model; the probability that the text to be classified corresponding to the alternative question belongs to the first category of text is obtained; and the alternative question whose corresponding probability is greater than the specified probability is determined as the question to be recommended.

[0125] In some embodiments, the determining module 502 is specifically configured to:

[0126] The user portrait vector representing the specific user and the text to be classified corresponding to the alternative question are input into the text classification model.

[0127] In some embodiments, the text classification model is trained based on the following steps:

[0128] Obtaining a dataset of the first type of text and a dataset of the second type of text;

[0129] Using the dataset of the first type of text as positive samples and the dataset of the second type of text as negative samples, fine-tune the pre-trained BERT model;

[0130] The fine-tuned BERT model is determined as the text classification model.

[0131] In some embodiments, each of the first-type texts is used to represent a sentence sequence corresponding to a historical human-computer dialogue data, and each of the second-type texts is used to represent a sentence sequence corresponding to a simulated human-computer dialogue data;

[0132] The sentence sequence is formed by arranging the question sentence of the current dialogue and the historical dialogue information of at least one dialogue round before the current dialogue round in the order of occurrence from first to last.

[0133] In some embodiments, the designated position of the statement sequence also includes a user portrait vector representing a specific user; the designated position includes: the beginning or the end of the sequence.

[0134] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0135] Figure 6 FIG1 is a schematic diagram illustrating the structure of an electronic device 1500 according to an exemplary embodiment. For example, device 1500 may be a user device, specifically a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or a wearable device such as a smart watch, smart glasses, a smart bracelet, or a smart running shoe.

[0136] Reference Figure 6 , device 1500 may include one or more of the following components: a processing component 1502 , a memory 1504 , a power component 1506 , a multimedia component 1508 , an audio component 1510 , an input / output (I / O) interface 1512 , a sensor component 1514 , and a communication component 1516 .

[0137] Processing component 1502 generally controls the overall operation of device 1500, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. Processing component 1502 may include one or more processors 1520 to execute instructions to perform all or part of the steps of the above-described method. In addition, processing component 1502 may include one or more modules to facilitate interaction between processing component 1502 and other components. For example, processing component 1502 may include a multimedia module to facilitate interaction between multimedia component 1508 and processing component 1502.

[0138] The memory 1504 is configured to store various types of data to support the operations of the device 1500. Examples of such data include instructions for any application or method operating on the device 1500, contact data, phone book data, messages, pictures, videos, etc. The memory 1504 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0139] The power supply component 1506 provides power to the various components of the device 1500. The power supply component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1500.

[0140] The multimedia component 1508 includes a screen that provides an output interface between the device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 1508 includes a front camera and / or a rear camera. When the device 1500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0141] The audio component 1510 is configured to output and / or input audio signals. For example, the audio component 1510 includes a microphone (MIC) that is configured to receive external audio signals when the device 1500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1504 or transmitted via the communication component 1516. In some embodiments, the audio component 1510 also includes a speaker for outputting audio signals.

[0142] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to, a home button, volume buttons, a start button, and a lock button.

[0143] Sensor assembly 1514 includes one or more sensors for providing various aspects of device 1500 status assessment. For example, sensor assembly 1514 can detect the open / closed state of device 1500, the relative positioning of components, such as the display and keypad of device 1500. Sensor assembly 1514 can also detect changes in the position of device 1500 or a component of device 1500, the presence or absence of user contact with device 1500, the orientation or acceleration / deceleration of device 1500, and changes in the temperature of device 1500. Sensor assembly 1514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1514 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1514 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0144] The communication component 1516 is configured to facilitate wired or wireless communication between the device 1500 and other devices. The device 1500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR or a combination thereof. In an exemplary embodiment, the communication component 1516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0145] In an exemplary embodiment, the device 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0146] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as memory 1504, including instructions that, when executed by processor 1520 of device 1500, enable device 1500 to perform the following method:

[0147] For each round of human-computer interaction dialogue, determining multiple candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers;

[0148] Determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information;

[0149] The at least one question to be recommended is recommended to the user.

[0150] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0151] like Figure 7 As shown, Figure 7 FIG1 is a schematic diagram of another electronic device 1600 according to an exemplary embodiment. For example, the device 1600 can be provided as an application server. Figure 7The device 1600 includes a processing component 1622, which further includes one or more processors, and a memory resource represented by a memory 1616 for storing instructions, such as applications, that can be executed by the processing component 1622. The application stored in the memory 1616 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1622 is configured to execute the instructions to perform the above-described method.

[0152] The device 1600 may also include a power supply component 1626 configured to perform power management of the device 1600, a wired or wireless network interface 1650 configured to connect the device 1600 to a network, and an input / output (I / O) interface 1658. The device 1600 may operate based on an operating system stored in the memory 1616, such as Android, iOS, Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0153] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as the memory 1616 including instructions, which can be executed by the processing component 1622 of the device 1600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0154] When the instructions in the memory 1616 are executed by the processing component 1622, the device 1600 is enabled to perform the following method:

[0155] For each round of human-computer interaction dialogue, determining multiple candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers;

[0156] Determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information;

[0157] The at least one question to be recommended is recommended to the user.

[0158] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0159] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A question recommendation method, characterized in that: include: For each round of human-computer interaction dialogue, determining multiple candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers; Determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information; recommending the at least one question to be recommended to the user; The multiple alternative questions determined for this round of dialogue include: Obtain the question from the previous round of dialogue and determine multiple similar questions with similar meanings to the question; For each similar question, determine a question pair with the similar question as the previous question from a preset conversation dataset; determining the subsequent question in the question pair as one of the alternative questions; The preset dialogue data set includes a plurality of question pairs consisting of a preceding question and a subsequent question; Determining at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information includes: For each candidate question, the candidate question and the historical conversation information are arranged in order of occurrence from earliest to latest into a sentence sequence as the text to be classified corresponding to the candidate question; Inputting the text to be classified corresponding to the candidate question into a trained text classification model; during the model training process, the text classification model learns the user's habit of asking questions in the next round of conversation given several previous rounds of conversation; Obtaining a probability that the text to be classified corresponding to the candidate question belongs to the first category of text; the first category of text is a conversation text reflecting the user's conversation habits; Alternative questions whose corresponding probabilities are greater than the specified probability are determined as questions to be recommended.

2. The method according to claim 1, wherein: The historical conversation information includes at least one set of historical questions and historical answers that are immediately and continuously preceding the current round of conversation.

3. The method according to claim 1, wherein: The step of inputting the text to be classified corresponding to the candidate question into the user-specific text classification model includes: The user portrait vector representing the specific user and the text to be classified corresponding to the alternative question are input into the text classification model.

4. The method according to claim 1, wherein: The text classification model is trained based on the following steps: Obtaining a dataset of the first type of text and a dataset of the second type of text; Using the dataset of the first type of text as positive samples and the dataset of the second type of text as negative samples, fine-tune the pre-trained BERT model; The fine-tuned BERT model is determined as the text classification model.

5. The method according to claim 4, wherein: Each of the first-category texts is used to represent a sentence sequence corresponding to a historical human-computer dialogue data, and each of the second-category texts is used to represent a sentence sequence corresponding to a simulated human-computer dialogue data; The sentence sequence is formed by arranging the question sentence of the current dialogue and the historical dialogue information of at least one dialogue round before the current dialogue round in the order of occurrence from first to last.

6. The method according to claim 4, wherein: The designated position of the statement sequence also includes a user portrait vector representing a specific user; the designated position includes: the beginning or the end of the sequence.

7. A question-asking recommendation device, characterized in that: include: An acquisition module, for each round of human-computer interaction dialogue, determines a plurality of candidate questions for the current round of dialogue and historical dialogue information before the current round of dialogue, wherein the historical dialogue information includes at least one set of historical questions and historical answers; a determination module, which determines at least one question to be recommended from the multiple candidate questions based on the multiple candidate questions and the historical conversation information; A recommendation module, recommending the at least one question to be recommended to the user; The acquisition module is specifically used to: Obtaining a question from a previous round of dialogue before the current round of dialogue, and determining multiple similar questions with similar meanings to the current question; for each similar question, determining a question pair with the similar question as the preceding question from a preset dialogue dataset; determining the following question in the question pair as one of the candidate questions; wherein the preset dialogue dataset includes multiple question pairs consisting of a preceding question and a following question; The determining module is specifically configured to: For each candidate question, the candidate question and the historical conversation information are arranged in order of occurrence from earliest to latest into a sentence sequence as the text to be classified corresponding to the candidate question; Inputting the text to be classified corresponding to the candidate question into a trained text classification model; during the model training process, the text classification model learns the user's habit of asking questions in the next round of conversation given several previous rounds of conversation; Obtaining a probability that the text to be classified corresponding to the candidate question belongs to the first category of text; the first category of text is a conversation text reflecting the user's conversation habits; Alternative questions whose corresponding probabilities are greater than the specified probability are determined as questions to be recommended.

8. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Question recommendation method and device for text robot

    CN112148860A

  • Speech skill recommendation method and device based on semantic recognition, equipment and storage medium

    CN112732911A