A dialogue generation method and device

By recognizing user interaction conditions to generate explanatory content, the limitations of intelligent product dialogue modes are solved, improving the quality of human-computer interaction and reducing the cost of manual services.

CN114490973BActive Publication Date: 2026-01-16LENOVO (BEIJING) LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111673234.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2026-01-16
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

Existing intelligent products based on human-computer interaction technology are limited by the fixed dialogue patterns they are trained to, making them unable to adapt to different user needs. This results in a mechanical and tedious interaction process, often leading users to request to be transferred to human customer service, thus increasing the cost of human services.

Method used

By acquiring user interaction content, explanatory items are generated when specified conditions are met, explaining the feedback reasons for the questions in the interaction content, including when the user ends the conversation, the question meets the triggering conditions, or the number of repetitions reaches a threshold. Adaptive explanatory items are generated using topic models, entity link models, etc.

Benefits of technology

It improves the quality of human-computer interaction services, reduces the probability of users quickly leaving the chat or requesting to be transferred to human customer service, and lowers the cost of human services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490973B_ABST
    Figure CN114490973B_ABST
Patent Text Reader

Abstract

The application discloses a dialogue generation method and device, wherein the method comprises: obtaining interaction content of a dialogue with a user; determining, according to the interaction content, that the user meets a specified interaction condition in the dialogue, and generating, based on the interaction content, explanation item content for explaining reasons for feedback content provided in response to a question of the user in the interaction content; and presenting the explanation item content; wherein the specified interaction condition at least represents one of the following: the user will end the dialogue; question content of the user meets a trigger condition; and a question repetition number of the user meets a trigger condition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of artificial intelligence, and in particular, but not exclusively, to a dialogue generation method and device. BACKGROUND

[0002] With the development of human-computer interaction technology, more and more intelligent products based on human-computer interaction technology have emerged, such as chat robots (Chatbot) and the like. These intelligent products can communicate with users in dialogue and generate answer information according to the user's questions. However, the existing intelligent products based on human-computer interaction technology often dialogue with users according to a pre-trained fixed dialogue mode. Since the trained dialogue mode has limitations, the entire dialogue process is relatively mechanical and dull, and cannot well adapt to different needs of users, resulting in users requiring to transfer to human customer service, thereby increasing the cost of human service. SUMMARY

[0003] Therefore, embodiments of the present application provide a dialogue generation method and device.

[0004] In a first aspect, embodiments of the present application provide a dialogue generation method, which includes: obtaining interaction content of a dialogue with a user; determining, according to the interaction content, that the user meets a specified interaction condition in the dialogue, and generating, based on the interaction content, explanation item content for explaining reasons of feedback content provided in the interaction content for a question of the user; presenting the explanation item content; wherein the specified interaction condition at least represents one of the following: the user will end the dialogue; the question content of the user meets a trigger condition; and the number of repetitions of the question of the user meets a trigger condition.

[0005] In a second aspect, embodiments of the present application provide an electronic device, which includes a memory and a processor, the memory has computer executable instructions stored thereon, and the processor implements steps in the dialogue generation method provided by embodiments of the present application when executing the program.

[0006] The technical solutions provided by embodiments of the present application have at least the following beneficial effects:

[0007] In the embodiments of the present application, first, the interactive content of the conversation with the user is acquired; second, the explanation item content is generated based on the interactive content in the case that the user meets the specified interactive condition in the conversation, the explanation item content is used to explain the reason of the feedback content provided for the question of the user in the interactive content; finally, the explanation item content is presented. In this way, the chat robot can generate the explanation item content suitable for different needs of the user based on the interactive content, reducing the probability of the user quickly leaving the chat or requiring to transfer to the manual customer service, on the one hand, improving the quality of human-computer interaction service, on the other hand, reducing the cost of manual service. BRIEF DESCRIPTION OF DRAWINGS

[0008] The drawings incorporated in the specification and forming a part thereof illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0009] Figure 1A An implementation flowchart of a conversation generation method provided by the embodiments of the present application is shown in the figure;

[0010] Figure 1B An interactive process diagram of the user and the chat robot provided by the embodiments of the present application is shown in the figure;

[0011] Figure 2A An implementation flowchart of a conversation generation method provided by the embodiments of the present application is shown in the figure;

[0012] Figure 2B An implementation flowchart of a method for determining that the user meets the condition that the user will end the conversation according to the interactive content provided by the embodiments of the present application is shown in the figure;

[0013] Figure 2C An implementation flowchart of a method for determining the to-be-responded option provided by the embodiments of the present application is shown in the figure;

[0014] Figure 3 An implementation flowchart of a conversation generation method provided by the embodiments of the present application is shown in the figure;

[0015] Figure 4A An implementation flowchart of a conversation generation method provided by the embodiments of the present application is shown in the figure;

[0016] Figure 4B An implementation flowchart of a method for determining the first sentence set provided by the embodiments of the present application is shown in the figure;

[0017] Figure 4C An implementation flowchart of a method for generating the explanation item content provided by the embodiments of the present application is shown in the figure;

[0018] Figure 5AAn implementation flowchart of a dialogue generation method provided by an embodiment of the present application is shown in FIG. 1.

[0019] Figure 5B An implementation flowchart of a suggestion item content generation method provided by an embodiment of the present application is shown in FIG. 2.

[0020] Figure 5C An implementation flowchart of a suggestion item content generation method provided by an embodiment of the present application is shown in FIG. 2.

[0021] Figure 6A An implementation flowchart of a chat robot monitor provided by an embodiment of the present application is shown in FIG. 3.

[0022] Figure 6B An implementation flowchart of a chat robot monitor provided by an embodiment of the present application is shown in FIG. 3.

[0023] Figure 7 An implementation flowchart of a chat robot monitor provided by an embodiment of the present application is shown in FIG. 3.

[0024] Figure 8 An implementation flowchart of a chat robot monitor provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION

[0025] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.

[0026] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0027] It should be noted that the terms "first", "second", "third" involved in the embodiments of the present application are only to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first", "second", "third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0028] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which embodiments of the present application belong. It should also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.

[0029] Therefore, embodiments of the present application provide a dialogue generation method, as shown in the following Figure 1A The method comprises the following steps:

[0030] In step S101, interaction content of a dialogue with a user is obtained.

[0031] Here, the device for the dialogue with the user can be an intelligent electronic device based on human-computer interaction technology, such as a chat robot, an electronic device with human-computer interaction requirements of an application, an artificial intelligence voice interaction electronic device, a mobile phone or computer loaded with an intelligent voice assistant, etc., which is not limited by the present application.

[0032] Here, the interaction refers to the process in which the user asks questions and the intelligent electronic device replies to the questions of the user.

[0033] Here, the interaction and the interaction content are illustrated by taking the interaction between the user and the chat robot as an example. As shown in the following Figure 1B The interaction and the interaction content are as follows:

[0034] (a) The user opens an interaction window and asks a question: My xx model notebook computer cannot charge the battery. I need to replace the battery in Beijing.

[0035] (b) The chat robot replies for the first time: Please select one of the following four options; the four options include: (1) battery charging problem; (2) repair and spare parts problem; (3) spare parts purchase problem; (4) none of the above.

[0036] (c) The user selects option (3) battery charging problem according to the options provided by the chat robot.

[0037] (d) The chat robot makes a second reply according to the option selected by the user: Please select one of the following four options; the four options include: (1) please go to the Beijing Lenovo Company after-sales service point to purchase and replace the battery; (2) please select a battery of different price according to your use demand; (3) please select the nearest after-sales service point according to your residence; (4) none of the above.

[0038] (e) The user selects option (4) none of the above according to the options provided by the chat robot.

[0039] (f) The chatbot makes a third reply according to the option selected by the user: I'm sorry, I think you need to buy a new battery for your xx type laptop because the battery of your laptop is no longer charging.

[0040] (g) The user selects option (2) according to the options provided by the chatbot: repair parts problem.

[0041] Then, the chatbot continues to make a fourth reply according to the option selected by the user, and the user continues to select according to the options provided by the chatbot until the user gets a satisfactory reply.

[0042] Step S102, if the user meets the specified interaction condition in the conversation according to the interaction content, generate explanation item content based on the interaction content, which is used to explain the reason of the feedback content provided in the interaction content for the user's question;

[0043] In some embodiments, the specified interaction condition can at least represent, but is not limited to, one of the following:

[0044] (1) The user will end the conversation;

[0045] Here, the way the user will end the conversation can include but is not limited to the following: a. During the interaction, the user selects an option that is none of the above; b. The user inputs "please transfer to human service" or "I don't want to continue chatting" in the window, etc.

[0046] (2) The user's question content meets the trigger condition;

[0047] Here, the trigger condition can include but is not limited to the following: a. The user's question is too complicated; b. The user's question is not clearly described; c. The user's question description is too long, etc.

[0048] (3) The number of times the user's question is repeated meets the trigger condition;

[0049] Here, the trigger condition is when the user asks a question N times.

[0050] Here, the explanation item content is generated by using an explanation generation model, which includes but is not limited to a topic model, an entity linking model (EL), a binary classifier, an explanation model, an inference model, a semantic enrichment model, and a concatenation model. In implementation, the topic model extracts topics from the content in the user's question and the user's selected option in the interactive content; the extracted topics are then replaced by professional terms in Wikipedia by the entity linking model; the content in the user's question and the user's selected option in the interactive content is classified by the binary classifier, with the content representing the user's existing question being classified into one category and the content representing the user's demand being classified into another category; the content representing the user's existing question is input into the explanation model, while the content representing the user's demand is input into the inference model; then, the content representing the user's existing question and the content representing the user's demand are respectively processed by the explanation model and the inference model to obtain a summary of the content representing the user's existing question and a summary of the content representing the user's demand; finally, the summaries of the content representing the user's existing question and the content representing the user's demand are enriched in semantics and concatenated by the semantic enrichment model and the concatenation model to obtain the explanation item content.

[0051] Here, the feedback content refers to the options provided by the chat robot in the reply process, such as Figure 1B As shown in the figure, the feedback content can include: (1) battery charging problem; (2) repair and replacement of parts; (3) purchase of parts; (4) none of the above. Alternatively, the feedback content can also include: (1) please go to the after-sales service point of Beijing Lenovo Company to purchase and replace the battery; (2) please choose a battery of different price according to your needs; (3) please choose the nearest after-sales service point according to your residence; (4) none of the above.

[0052] For example, as shown in the interactive content Figure 1B When the user selects the option "none of the above", i.e. the user meets the specified interactive condition that the user will end the conversation in the conversation, the chat robot will generate the explanation item content "I'm sorry, I think you need to buy a new battery for your xx model notebook computer, because the battery of your notebook computer is no longer charging" based on the user's question "My xx model notebook computer's battery cannot be charged, I need to replace the battery in Beijing" in the interactive content, where the explanation item content is used to explain the reason why the chat robot provides the feedback content "(3) purchase of parts" for the user's question "My xx model notebook computer's battery cannot be charged" in the interactive content.

[0053] Step S103, presenting the explanation item content; wherein the specified interaction condition at least represents one of the following: the user will end the conversation; the user's question content meets a trigger condition; the user's question repetition number meets a trigger condition.

[0054] Here, as shown in Figure 1B The explanation item content can appear in the chat robot's reply dialogue box as the chat robot's reply.

[0055] In the embodiments of the present application, first, the interaction content of the conversation with the user is obtained; second, based on the interaction content, the explanation item content is generated in the case that the user meets the specified interaction condition in the conversation, the explanation item content is used to explain the reason of the feedback content provided for the user's question in the interaction content; finally, the explanation item content is presented. In this way, the chat robot can generate explanation item content that meets the different needs of the user based on the interaction content, reducing the probability that the user quickly leaves the chat or requires human customer service, on the one hand improving the quality of human-computer interaction service, on the other hand reducing the cost of human service.

[0056] The embodiments of the present application provide a conversation generation method, as shown in Figure 2A The method comprises the following steps:

[0057] Step S201, obtaining interaction content of a conversation with a user;

[0058] Here, step S201 can be understood with reference to step S101.

[0059] Step S202, based on the interaction content, generating an explanation item content in the case that the user meets the condition that the user will end the conversation in the conversation, the explanation item content is used to explain the reason of the feedback content provided for the user's question in the interaction content;

[0060] In some embodiments, as shown in Figure 2B The method for determining in step S202 that the user meets the condition that the user will end the conversation in the conversation based on the interaction content comprises the following steps:

[0061] Step S2021, presenting a current set of to-be-responded options representing the user's intention to the user, the current set of to-be-responded options is generated based on the user's question and / or the user's target response to the previous set of to-be-responded options;

[0062] Here, the current set of to-be-responded options can be generated based on the user's question, for example, as shown in Figure 1BAs shown, the current set of to-be-responded options can be the reply given by the chat robot, such as: Please select one of the following four options; the four options include: (1) battery charging problem; (2) repair parts problem; (3) parts purchase problem; (4) none of the above. This set of to-be-responded options is generated based on the user's question: My xx model notebook computer's battery cannot be charged, and I need to replace the battery in Beijing.

[0063] In addition, the current set of to-be-responded options can also be generated based on the target response made by the user to the previous set of to-be-responded options; for example, Figure 1B As shown, in Figure 1B , the previous set of to-be-responded options is the reply given by the chat robot, which is Please select one of the following four options; the four options include: (1) battery charging problem; (2) repair parts problem; (3) parts purchase problem; (4) none of the above. If the user selects (3) parts purchase problem, the target response is one of the options selected by the user based on the new set of options given by the chat robot based on (3) parts purchase problem, for example, the user selects (3) Please select the nearest after-sales service point according to your residence. At this time, the chat robot gives a new set of to-be-responded options based on the target response selected by the user, which is the current set of to-be-responded options (not shown in the figure).

[0064] Step S2022, in response to the response operation made by the user to the current set of to-be-responded options, obtaining a current set of target responses;

[0065] Here, as shown in Figure 1B , when the current set of to-be-responded options is the first reply given by the chat robot, which is Please select one of the following four options; the four options include: (1) battery charging problem; (2) repair parts problem; (3) parts purchase problem; (4) none of the above. The user selects (3) parts purchase problem, and then the second reply given by the chat robot is Please select one of the following four options; the four options include: (1) Please go to the Beijing Lenovo Company after-sales service point to purchase and replace the battery; (2) Please select a battery of different price according to your needs; (3) Please select the nearest after-sales service point according to your residence; (4) none of the above. The user selects (4) none of the above, and at this time, (4) none of the above is the current target response.

[0066] Step S2023, based on the current set of target responses, determining whether the user will end the conversation.

[0067] Here, if the user selects (4) none of the above, it means that the user wants to end the conversation; if the user selects other, it means that the user does not want to end the conversation.

[0068] In some embodiments, step S2023 can also be:

[0069] According to whether the current question content of the user contains a target keyword, it is determined whether the user will end the conversation.

[0070] Here, the target keyword can be an artificial customer service, exit chat, etc., which is not limited in the present application.

[0071] In some embodiments, after step S201 and before step S202, as shown in the following figure, the method further comprises: Figure 2C

[0072] Step S2011, determining a text feature vector set of a user question in the interaction content;

[0073] Here, first, the user's question is segmented and stop words are removed; second, the One-Hot method is used to obtain the word vector of a single word in the user's question, and then the text feature vector of the user's question is composed of the word vectors of the words. In the interaction process, the user may have asked several questions, so the text feature vectors of multiple user questions are collected into the text feature vector set of the user question.

[0074] Step S2012, sorting the importance of the words in the question based on the saliency map and the text feature vector set, to obtain a feature word set of the question; wherein the feature word set includes the top N feature words with the highest importance in the question.

[0075] Here, the saliency map in the image refers to an image that shows the unique feature of each pixel. For example, a pixel has a high gray level in a color image, so the pixel will be displayed in a more obvious way in the saliency map, so from the perspective of visual stimulation, the pixel can be particularly captured by attention. In the embodiments of the present application, the method of saliency map is used to obtain the feature words in the text feature vector set.

[0076] In implementation, the word vector of a word in the user's question and the text feature vector of the sentence where the word is located are obtained by word segmentation and One-Hot encoding, each word is assumed to be a feature word, and then the word frequency gradient of the assumed feature word with respect to the text feature vector of the sentence where the word is located is calculated. According to the word frequency gradient of each word, it is determined whether the word is a feature word, wherein the feature word is a word with a high ranking of word frequency gradient value, and the feature word set includes the top N feature words with the highest importance in the question.

[0077] Step S2013, determining the first set of response options based on the feature word set.

[0078] ​Here, the semantic enrichment model, semantic concatenation model, etc. can be used to enrich and concatenate the feature words to generate the first set of response options, which is not limited in the present application.

[0079] Step S203, presenting the explanation item content.

[0080] Here, step S203 can be understood with reference to step S103.

[0081] In the embodiments of the present application, first, the user is presented with a current set of response options representing the user's intention; second, in response to the user's response operation on the current set of response options, a current set of target responses is obtained; third, based on the current set of target responses, it is determined whether the user will end the conversation; finally, when the user wants to end the conversation, based on the interaction content, the explanation item content is generated and presented. In this way, when the user wants to end the conversation during the interaction with the chat robot, the chat robot can generate an explanation item content that can explain the reason why the chat robot made the previous reply, thereby reducing the probability of the user quickly leaving the chat or requiring human service, on the one hand improving the quality of human-computer interaction service, on the other hand reducing the cost of human service.

[0082] The embodiments of the present application provide a conversation generation method, as shown in Figure 3 The method comprises:

[0083] Step S301, obtaining interaction content of a conversation with a user;

[0084] Here, step S301 can be understood with reference to step S103.

[0085] Step S302, based on the interaction content, generating an explanation item content when the user's question content in the conversation meets the trigger condition, the explanation item content being used to explain the reason for the feedback content provided in the interaction content for the user's question;

[0086] In some embodiments, the method of determining whether the user's question content in the conversation meets the trigger condition in step S302 comprises:

[0087] Step S3021, determining one of the sentence structure, sentence length, and sentence keywords of the current question content based on the result of semantic analysis of the current question content of the user;

[0088] Here, the semantic analysis algorithm used by semantic analysis. Through the semantic analysis algorithm, one or more of the sentence structure, sentence length, and sentence keywords of the current question content can be determined.

[0089] Step S3022, determine whether the content of the question of the user meets the triggering condition according to at least one of the sentence structure, the length of the sentence, and the keywords of the content of the current question.

[0090] Here, when the sentence structure of the content of the current question is chaotic, for example, the question is too complicated, or the expression is not clear; or the sentence is too long; or the keywords of the sentence appear artificial customer service or exit chat, etc., it is determined whether the content of the question of the user meets the triggering condition.

[0091] Step S303, present the explanation item content.

[0092] Here, step S303 can be understood with reference to step S103.

[0093] In the embodiments of the present application, when the specified interaction condition represents that the content of the question of the user meets the triggering condition, first, based on the result of the semantic analysis on the content of the current question of the user, one of the sentence structure, the length of the sentence, and the keywords of the content of the current question is determined; second, whether the content of the question of the user meets the triggering condition is determined according to at least one of the sentence structure, the length of the sentence, and the keywords of the content of the current question; third, the explanation item content is generated based on the interaction content; and finally, the explanation item content is presented. In this way, when the question of the user is too complicated or unclear or the sentence is too long, etc., which affects the interaction process, the chat robot generates an explanation item content, improving the efficiency of human-computer interaction.

[0094] The embodiments of the present application provide a dialogue generation method, as shown in Figure 4A The method comprises the following steps:

[0095] Step S401, obtaining interaction content of a dialogue with a user;

[0096] Here, step S401 can be understood with reference to step S101.

[0097] In some embodiments, the interaction content comprises: a question of the user, at least one set of provided to-be-responded options, a target response of the user, and an extended intent of the target response.

[0098] Here, the extended intent of the target response refers to a complete solution to the question raised by the user. For example: as Figure 1BAs shown, when the user's question is that the battery of my xx model notebook computer cannot be charged, and I need to replace the battery in Beijing; the response options are the answers given by the chat robot, which are: please select one of the following four options; the four options include: (1) battery charging problem; (2) repair parts problem; (3) parts purchase problem; (4) none of the above; the user's target response is (3) parts purchase problem, when the user selects the target response (3) parts purchase problem, the robot gives a second reply: please select one of the following four options; the four options include: (1) please go to the Lenovo company's after-sales service point in Beijing to purchase and replace the battery; (2) please select a battery of different price according to your use demand; (3) please select the nearest after-sales service point according to your residence; (4) none of the above, which is the expansion intent of the target response, and the expansion intent is a complete description of solving the problem raised by the user.

[0099] In some embodiments, after step S401 and before step S402, the method further comprises:

[0100] Step S4011, preprocessing the question and the expansion intent to obtain a first sentence set;

[0101] Here, the preprocessing adopts a topic model and an entity linking model. The topic model refers to a statistical model that clusters the semantic structure of natural language text in a non-supervised learning manner. Entity linking refers to the task of linking entities appearing in natural language text to corresponding knowledge graph entities, such as corresponding entries in standard databases, knowledge bases, place name dictionaries, Wikipedia pages, etc.

[0102] Here, the first sentence set refers to a set of words obtained by extracting the topics of the user's question and the expansion intent through a topic model and then linking entities.

[0103] In some embodiments, as Figure 4B As shown, step S4011 includes:

[0104] Step S41, respectively determining the topic of the question and the topic of the expansion intent;

[0105] Here, the topic model is used to determine the topic of the question and the topic of the expansion intent.

[0106] Step S42, respectively linking the words in the topic of the question and the topic of the expansion intent to a knowledge graph;

[0107] Here, the extracted topic words are linked to the knowledge graph through an entity linking model.

[0108] Step S43, determining the first statement set based on the associated words of the knowledge graph.

[0109] Here, the subject words after association with the knowledge graph are replaced with professional words in the knowledge graph, such as Wikipedia, and the first statement set is the set of professional words after replacement, the user's question and the words not found in the knowledge graph in the extended intent of the target response.

[0110] Step S402, determining the explanation item content based on the user's question and the extended intent of the target response in the case where the user meets the specified interaction condition in the conversation according to the interaction content, the explanation item content being used to explain the reason for the feedback content provided in the interaction content for the user's question;

[0111] In some embodiments, as shown in Figure 4C The determination of the explanation item content based on the user's question and the extended intent of the target response in step S402 includes:

[0112] Step S4021, classifying the first statement set to obtain a second statement set and a third statement set; wherein the second statement set represents the user's question, and the third statement set represents the user's demand content.

[0113] Here, the classification uses a binary classifier. In the training phase, the binary classifier is trained using a dependency tree (Dependecy Tree).

[0114] Here, the binary classifier classifies the user's question and the utterance in the extended intent of the target response, the second statement set is the content representing the user's question, and the third statement set is the content representing the user's demand.

[0115] Step S4022, extracting the abstract of the second statement set and the abstract of the third statement set, respectively.

[0116] Here, the extraction of the abstract adopts an abstract extraction model, a baseline model of the abstract extraction model adopts a sequence-to-sequence + attention mechanism model, and then a pointer generator model and a coverage mechanism are added on the basis of the baseline model, wherein the sequence-to-sequence + attention mechanism model is an encoder (Encoder)-decoder (Decoder) model, the pointer generator is used to copy words from the source text through a pointer, accurately copy text information, and at the same time retain the ability to generate new words through the generator. The coverage mechanism is used to track the content that has been generated in the abstract, to prevent the repetition of the content before and after the abstract. In implementation, the weights of various words in the attention mechanism are changed, and the weights of the characteristic words in the second sentence set and the characteristic words in the third sentence set are respectively increased, so that the probability of selecting the characteristic words in the second sentence set and the characteristic words in the third sentence set in the generated abstract is increased. In addition, through the pointer generator, the words in the second sentence set and the third sentence set are used as much as possible in the abstract, but when the words in the second sentence set and the third sentence set cannot properly express the meaning of the words in the abstract, new words can also be generated, and through the coverage mechanism, the content that has been generated in the abstract can be tracked to prevent the repetition of the content before and after the abstract.

[0117] Step S4023, determining the explanation item content based on the abstract of the second sentence set and the abstract of the third sentence set.

[0118] Here, the abstract of the second sentence set and the abstract of the third sentence set are respectively enriched in semantics through a semantic enrichment model, and then the abstract of the second sentence set and the abstract of the third sentence set after semantic enrichment are concatenated to obtain the explanation item content.

[0119] Step S403, generating the suggestion item content based on the user's question, the user's target response, and the extended intention of the target response, the suggestion item content is used to indicate the operation mode associated with at least one of the to-be-responded options under the explanation item content.

[0120] Here, the suggestion item content is illustrated by way of example. For example, when the user's question is: my xx model notebook computer battery cannot be charged, I need to replace the battery in Beijing; the response options are the answers given by the chat robot, which are: please select one of the following four options; the four options include: (1) battery charging problem; (2) repair parts problem; (3) parts purchase problem; (4) none of the above; the target response of the user is (3) parts purchase problem, when the user selects the target response (3) parts purchase problem, the extended intent of the target response is that the robot gives a second reply: please select one of the following four options; the four options include: (1) please go to the Lenovo company's after-sales service point in Beijing to purchase and replace the battery; (2) please select a battery of different prices according to your needs; (3) please select the nearest after-sales service point according to your residence; (4) none of the above. When the user selects (4) none of the above, the explanation item content generated by the chat robot at this time is: I'm sorry, I think you need to buy a new battery for your x model notebook computer, because the battery of your notebook computer is no longer charging. Then generate a suggestion item content: but if you need to repair the charger, please click item (2) repair parts problem.

[0121] Step S404, presenting the explanation item content and the suggestion item content.

[0122] Here, step S404 can be understood with reference to step S103.

[0123] In the embodiments of the present application, first, the topic model and the entity linking model are used to preprocess the question and the extended intent to obtain a first sentence set; second, a binary classifier is used to classify the first sentence set to obtain a second sentence set and a third sentence set; then, an encoder-decoder algorithm model including a pointer generator, a coverage mechanism and an attention mechanism is used to extract summaries of the second sentence set and the third sentence set respectively; finally, based on the summaries of the second sentence set and the third sentence set, the explanation item content is determined. In this way, when the user wants to end the conversation during the interaction with the chat robot, the chat robot can generate an explanation for the previous answer given by the chat robot, thereby reducing the probability of the user quickly leaving the chat or requiring human service, on the one hand improving the quality of human-computer interaction service, and on the other hand reducing the cost of human service.

[0124] The embodiments of the present application provide a dialogue generation method, as shown in Figure 5A The method comprises:

[0125] Step S501, obtaining interactive content of a dialogue with a user;

[0126] Here, step S501 can be understood with reference to step S101.

[0127] Step S502, determining the explanation item content based on the user's question and the extended intent of the target response, in the case that the user meets the specified interaction condition in the conversation according to the interaction content, the explanation item content being used to explain the reason of the feedback content provided in the interaction content for the user's question;

[0128] Here, step S502 can be understood with reference to step S102.

[0129] Step S504, respectively acquiring the feature word set of the question and the topic of the extended intent;

[0130] Here, the feature word set acquisition method is understood with reference to steps S2011 and S2012.

[0131] Here, the topic of the extended intent is generated by using a document topic model (Latent Dirichlet Allocation, LDA). The LDA topic model is also called a latent Dirichlet allocation model, which can give the topic of each document in the document set in the form of a probability distribution. In implementation, each extended intent selected by the user is regarded as a document, and the LDA topic model is used to extract the topic words of each extended intent. Among the topic words of each extended intent, the topic word with the highest probability is selected to generate a topic word set as the topic of the extended intent.

[0132] Step S505, respectively determining the feature word set, the topic of the extended intent, the target response, and the semantic representation vector of the extended intent;

[0133] Here, the generation of the semantic representation vector uses a BERT language model (Bidirectional Encoder Representation From Transformers), and the BERT language model can generate a semantic representation vector that fuses context content.

[0134] Step S506, clustering the feature word set, the topic of the extended intent, the target response, and the semantic representation vector of the extended intent to obtain the suggestion item content;

[0135] Here, in implementation, as Figure 5BAs shown, first, the topic of the extended intent, the feature word set and the target response are respectively input into the first to third BERT language models to obtain semantic representation vectors of the topic of the extended intent, the feature word set and the target response, the extended intent is input into the fourth BERT language model to obtain a semantic representation vector of the extended intent; second, the semantic representation vectors of the topic of the extended intent, the feature word set and the target response are respectively subjected to first clustering to obtain a keyword set; the semantic representation vector of the extended intent is subjected to second clustering to obtain a suggestion sentence set, wherein, when the second clustering is performed, words related to the keyword set are selected for clustering as the suggestion sentence set; the first clustering and the second clustering adopt a K-Nearest Neighbor (KNN) algorithm; then, a suggestion content template is filled in, wherein the suggestion content template is: However, if you need xx, click on item xx, when the suggestion content template is filled in, contents needing xx are filled in by using the suggestion sentence set, contents clicking on item xx are filled in by using keywords, for example, you need xx, the suggestion sentence set: repair and charger is filled in, click on item xx, the keyword: repair and accessories is filled in; finally, a complete suggestion item is formed, for example, the suggestion item content can be: However, if you need to repair the charger, click on item (2) repair accessories problem.

[0136] Step S503, presenting the explanation item content and the suggestion item content.

[0137] Here, step S503 can be understood with reference to step S103.

[0138] In some embodiments, as Figure 5C As shown, step S506 includes step S5061 to step S5063, wherein:

[0139] Step S5061, clustering the semantic representation vectors of the feature word set, the topic of the extended intent and the target response to obtain a keyword set; wherein the keyword set includes K1 keywords;

[0140] Here, the steps of the KNN algorithm are as follows:

[0141] (1) Determine the distance from the test sample point (that is, the point to be classified) to each of the other sample points; (2) Sort each distance, and then select the K points with the smallest distance; (3) Compare the categories to which the K points belong, and according to the principle of minority serving majority, classify the test sample point into the category with the highest proportion among the K points.

[0142] In the embodiments of the present application, the K1 keywords are all words similar to the feature words in the feature word set.

[0143] Step S5062, clustering the semantic representation vector of the extended intent based on the keyword set to obtain a suggestion sentence set;

[0144] Here, when the second clustering is performed, words related to the keyword set are selected for clustering to obtain the suggestion sentence set. For example, the keyword set has the words repair and accessories, and when the second clustering is performed, the words repair, charger, and the like are selected for clustering.

[0145] Step S5063, concatenating the keyword set and the suggestion sentence set to obtain the suggestion item content.

[0146] Here, the concatenation uses a template filling method, which fills the keywords and the suggestion sentences into the template to generate the suggestion item content. For example, the suggestion item content can be: However, if you need to repair the charger, please click item (2) repair accessory problem.

[0147] In the embodiments of the present application, first, the feature word set of the question and the topic of the extended intent are obtained respectively; second, the feature word set, the topic of the extended intent, the target response, and the semantic representation vector of the extended intent are determined respectively; then, the feature word set, the topic of the extended intent, and the semantic representation vector of the target response are clustered to obtain a keyword set; next, the semantic representation vector of the extended intent is clustered based on the keyword set to obtain a suggestion sentence set; finally, the keyword set and the suggestion sentence set are concatenated to obtain the suggestion item content. In this way, when the user wants to end the conversation during the interaction with the chat robot, the chat robot can generate a suggestion item according to the interaction content, thereby reducing the probability that the user quickly leaves the chat or requires human service, on the one hand improving the quality of human-computer interaction service, and on the other hand reducing the cost of human service.

[0148] Chat robots used in industrial production have received widespread attention, especially recently by training chat robots using pre-trained models like BERT. However, one problem with these chat robots is that they are just a robot trained by machine learning, they are trained according to the training data, so when the chat robot is chatting with the user, the behavior of the chat robot is different from that of the human customer service. This means that the chat robot does not have a conversation with the user on the other end like a human. The chat robot replies to the user's question according to the stable knowledge and methods it has learned. But the user thinks that the user is talking to a smart or experienced person, not a robot, so the user's initial expectations of the other party to the conversation (i.e., the chat robot) can be very high.

[0149] This can raise some problems, for example, a user who has high expectations can start a chat with a long question, such as "Yesterday afternoon, I came home and wanted to use my laptop before the house lost power, I noticed that my laptop screen … and then I found that my laptop lost power". The user is tired and even angry after several rounds of question asking and reply, and then the user wants to leave the chat room or request human service to take over the remaining chat, and the user is no longer willing to do so if the chat robot requires the user to rephrase the question and retry.

[0150] The embodiments of the present application provide an interpretable chat robot which attempts to prevent the user from wanting to leave immediately or making a "please transfer to human customer service" request after chatting with the chat robot for a period of time, which is indeed what the user initially expects the chat robot to have. The interpretable chat robot makes the user more patient and more involved in the chat, thereby greatly reducing the cost of using human services.

[0151] The core idea of the present application is to use Explainable Artificial Intelligence (XAI) to make the chat robot more friendly and transparent, and when the chat robot makes a request for the user to rephrase the question, the user can be more patient in rephrasing their question and can be more involved in the chat conversation.

[0152] The embodiments of the present application explain why the chat robot makes such a reply by providing a user-readable explanation, and then the chat robot can provide some suggestions to the user (automatically and quickly, rather than using predefined replies), thereby improving the transparency of the chat robot, and accordingly helping the user to rephrase the question, which increases the user's involvement in the current chat and reduces the labor cost.

[0153] The chat robot provided in the embodiments of the present application includes a monitor for monitoring the conversation between the user and the chat robot, and once the user attempts to leave the chat room or requires connection to human service, the monitor provides a human-readable explanation of why the chat robot makes such a reply, and then provides some suggestions to the user, thereby reducing the probability that the user wants to quickly leave the chat room or immediately request human service. The monitor monitors the reply given by the chat robot to the user in each round and the question of the user, the feedback of the user to the reply given by the chat robot. For example: the feedback of the user to the reply given by the chat robot is none of the above, and then the monitor generates a user-readable explanation after receiving this reply, which is used to explain to the user why the chat robot makes such a reply, and then the chat robot can provide some suggestions to the user.

[0154] Figure 6Ais a structural schematic diagram of a chatbot monitor provided by an embodiment of the present application. As shown in Figure 6A The chatbot monitor includes a generation model that generates a second-hand explanation including explanation items and suggestion items. In addition, the input of the generation model comes from each round of reply of the chatbot and a plurality of first-hand explanations generated by the user's question. The output of the generation model is the second-hand explanation including the explanation items and the suggestion items.

[0155] In implementation, the first-hand explanation is generated using a saliency map, in which the words in the first-hand explanation mainly affect the reply of the chatbot. In addition, the first-hand explanation can also be generated using XAI methods unrelated to the model, such as Local Interpretable Model (LIME) and Shapley Additive Explanation (SHAP).

[0156] Here, as shown in Figure 1B When the user's question is: My xx model notebook computer's battery cannot be charged, and I need to replace the battery in Beijing, the generated first-hand explanation is a feature word set composed of the following feature words: cannot, charge, battery, replace, and Beijing. In other words, the first-hand explanation is the top-ranked important feature words, in which the word charge is ranked more forward. The first-hand explanation can affect the reply content of the chatbot, and the more forward the ranking is, the greater the influence on the reply content of the chatbot, for example, the word charge can affect the reply of the chatbot more than the word battery.

[0157] Here, the second-hand explanation includes the following features:

[0158] (1) Human-readable text: provides human-readable or understandable explanations to explain the reasons why the chatbot makes these replies, and the explanations are generated based on the feature words in the first-hand explanation.

[0159] (2) Text enrichment: enriches the second-hand explanation by injecting more information about the impact on the chatbot model (for example, assuming that the word Beijing is used in the user's question, and Beijing is selected as one of the top N feature words that have the greatest impact on the model in the first-hand explanation, from the perspective of Name Entity Recognition (NER), EL and knowledge graph, the company headquarters in Beijing will be replaced by Beijing in generating the second-hand explanation). This can release more information about the way the model thinks to the user, and can help the user to restate the question accordingly.

[0160] (3) Provide reason: Provide a very short reason why the chatbot responded as it did to the user's question. Illustratively, the chatbot provides the reason as: "Sorry, I think you might need to buy a new battery for your x-type laptop because the battery of your laptop is no longer charging." The content of the reason depends mainly on the first-hand explanation, the chatbot's provided response, and the user's selected target response.

[0161] (4) Suggestion: The monitor provides suggestions to the user based on the first-hand explanation and the extended intent. For example, the user does not know in advance what the chatbot presents as the internal content that can match the user's question, and the monitor generates suggestions by monitoring the chat, which in turn focuses on the first-hand explanation and the extended version of each presented intent. For example, the monitor generates the following suggestion: "But if you need to repair the charger, click on item 2." Then, the chatbot does not respond with "Please rephrase your question and try again," but its response is accompanied by an explanation of why the chatbot made the previous specific response, disambiguated certain entities, and provided suggestions to the user.

[0162] Figure 6B An implementation flow diagram for generating explanation content is provided for the embodiments of the present application. As shown in Figure 6B , first, the topic words in the content of the user's question and the user's selected options are extracted by the topic model; second, all mentioned entities in the topic words are replaced with the corresponding entity links in the Wikipedia (or use the local knowledge graph); third, the content in the user's question and the user's selected options is classified by the binary classifier, the content representing the user's existing problem is classified into one class, and the content representing the user's demand is classified into another class; fourth, the content representing the user's existing problem is input into the explanation generation model, and the content representing the user's demand is input into the reasoning generation model, to generate the summary of the user's existing problem and the summary of the user's demand; and fifth, the summary of the user's existing problem and the summary of the user's demand are input into the semantic enrichment model and the concatenation model to generate the second-hand explanation.

[0163] During training, a user utterance dataset containing more information needs to be created. For this purpose, longer utterances and utterances appearing at the beginning of the chat log can be selected. Then each utterance is segmented / annotated into two main general segments: the explanation segment and the reasoning segment. The explanation segment is the utterance or part of the sentence that represents the user's existing problem (e.g., "My laptop battery cannot be charged"), and the reasoning segment is the utterance that represents the customer's demand (e.g., "I need to replace the battery in Beijing").

[0164] In addition, the explanation generation model and the reasoning generation model are both models for generating an abstract, which is based on a sequence-to-sequence + attention mechanism baseline model and adds a pointer structure, a generator structure and a coverage structure. The pointer structure is used to point to a word in the user's question, the generator structure is used to generate a new word, and the coverage structure is used to cover repeated content in the customer question. The explanation generation model and the reasoning generation model are both encoder-decoder structures. In implementation, by modifying the weight of a feature word in the attention mechanism, and using the pointer structure, the generator structure and the coverage structure, a golden abstract is generated, so that the words in the golden abstract are related to the top-ranked feature words in the first-hand explanation.

[0165] The binary classifier labels the content in the user's question and the user-selected options as an explanation segment (1) and a reasoning segment (0). The utterance can be a combination of explanation / reasoning segments, or it can only contain one segment. In training, the binary classifier is annotated and trained using a dependency tree.

[0166] The generation model of the recommended item in the second-hand explanation includes the topic of each extended intent and the feature words, target response and extended intent from the first-hand explanation. The extended intent of each intent means a complete explanation of solving the problem raised by the user. Assuming that the user sends a query to the chat robot, and the chat robot replies to the user through three items (i.e., three intents), if the user selects one of the items, the chat robot will go to the complete explanation of how to solve the user's problem, which is called an extended intent. In implementation, the LDA algorithm is used to extract the topic of each extended intent. Each topic is composed of several words, and only the top-ranked (Top-L) words are considered. In addition, KNN is used to select K extended intents to recommend to the user.

[0167] Based on the above method, an electronic device is provided, such as Figure 7 As shown in the figure, the electronic device includes:

[0168] The memory 710 is configured to store computer-executable instructions.

[0169] The processor 720 is configured to execute the program to implement the steps of the dialogue generation method in the embodiments of the present application.

[0170] Based on the foregoing embodiments, a dialogue generation apparatus is provided, which includes various modules, sub-modules and units included in the modules. The units included in the sub-modules can be implemented by a processor in an electronic device. Of course, the units can also be implemented by a logic circuit. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA).

[0171] Figure 8 A component structure diagram of a dialogue generation device provided by an embodiment of the present application is shown in Figure 8 The device comprises:

[0172] An acquisition module 810 is configured to acquire interactive content of a dialogue with a user.

[0173] A first generation module 820 is configured to, in a case where the user meets a specified interactive condition in the dialogue, generate, based on the interactive content, explanation item content, the explanation item content being used to explain reasons for feedback content provided in response to a question of the user in the interactive content.

[0174] A presentation module 830 is configured to present the explanation item content; wherein the specified interactive condition at least represents one of the following: the user will end the dialogue; question content of the user meets a triggering condition; a number of repetitions of the question of the user meets a triggering condition.

[0175] In some embodiments, the specified interactive condition represents that the user will end the dialogue.

[0176] In some embodiments, the first generation module comprises: a presentation submodule configured to present, to the user, a current set of to-be-responded options representing an intention of the user, the current set of to-be-responded options being generated based on the question of the user and / or target responses made by the user in response to a previous set of to-be-responded options; a first acquisition submodule configured to acquire a current set of target responses in response to a response operation made by the user in response to the current set of to-be-responded options; and a first determination submodule configured to determine, based on the current set of target responses, whether the user will end the dialogue.

[0177] Or,

[0178] The first generation module comprises a second determination submodule configured to determine, according to whether the question content of the user currently contains a target keyword, whether the user will end the dialogue.

[0179] In some embodiments, the specified interactive condition represents that the question content of the user meets a triggering condition.

[0180] In some embodiments, the first generation module comprises: a third determination submodule configured to determine, based on a result of semantic analysis on the question content of the user currently, one of a sentence structure, a length of a sentence, and a keyword of a sentence of the question content currently; and a fourth determination submodule configured to determine, according to at least one of the sentence structure, the length of the sentence, and the keyword of the sentence of the question content currently, whether the question of the user meets the triggering condition.

[0181] In some embodiments, the interaction content comprises: a question of the user, at least one set of response options provided, a target response of the user, and an extended intent of the target response.

[0182] In some embodiments, the first generation module comprises a fifth determination submodule configured to determine the explanation item content based on the question of the user and the extended intent of the target response.

[0183] In some embodiments, the apparatus further comprises a second generation module configured to generate and present suggestion item content based on the question of the user, the target response of the user, and the extended intent of the target response, the suggestion item content being used to indicate an operation mode associated with at least one of the response options under the explanation item content.

[0184] In some embodiments, the apparatus further comprises a preprocessing module configured to preprocess the question and the extended intent to obtain a first sentence set.

[0185] In some embodiments, the first generation module comprises a classification submodule configured to classify the first sentence set to obtain a second sentence set and a third sentence set, wherein the second sentence set represents the question pointed out by the user, and the third sentence set represents the demand content of the user; an extraction submodule configured to extract an abstract of the second sentence set and an abstract of the third sentence set, respectively; and a sixth determination submodule configured to determine the explanation item content based on the abstract of the second sentence set and the abstract of the third sentence set.

[0186] In some embodiments, the preprocessing module comprises a seventh determination submodule configured to determine a subject of the question and a subject of the extended intent, respectively; an association submodule configured to associate words in the subjects of the question and the extended intent to a knowledge graph, respectively; and an eighth determination submodule configured to determine the first sentence set based on the words in the knowledge graph after association.

[0187] In some embodiments, the second generation module comprises:

[0188] a second acquisition submodule configured to acquire a feature word set of the question and a subject of the extended intent, respectively; a ninth determination submodule configured to determine the feature word set, the subject of the extended intent, the target response, and a semantic representation vector of the extended intent, respectively; and a clustering submodule configured to cluster the feature word set, the subject of the extended intent, the target response, and the semantic representation vector of the extended intent to obtain the suggestion item content.

[0189] In some embodiments, the clustering submodule comprises: a first clustering unit configured to cluster the semantic representation vectors of the feature word set, the topic of the extended intent, and the target response to obtain a keyword set; wherein the keyword set comprises K1 keywords; a second clustering unit configured to cluster the semantic representation vectors of the extended intent based on the keyword set to obtain a suggestion sentence set; and a concatenating unit configured to concatenate the keyword set and the suggestion sentence set to obtain the suggestion item content.

[0190] In some embodiments, the device further comprises: a first determining module configured to determine a text feature vector set of the question; an ordering module configured to order the importance of words in the question based on the saliency map and the text feature vector set to obtain a feature word set of the question; wherein the feature word set comprises the top N feature words with the highest importance in the question; and a second determining module configured to determine the first set of response options to be selected based on the feature word set.

[0191] The above device embodiments are similar to the descriptions of the method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application.

[0192] It should be noted that, in the embodiments of the present application, if the above dialogue generation method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various program code storage media. Thus, the embodiments of the present application are not limited to any specific hardware and software combination.

[0193] The embodiments of the present application provide a computer storage medium, which stores one or more programs executable by one or more processors to implement the method steps of the dialogue generation method of any one of the above embodiments.

[0194] It should be noted that: the above description of the storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For technical details not disclosed in the storage medium embodiments of the present application, please refer to the description of the method embodiments of the present application.

[0195] It is understood that a specific feature, structure, or characteristic described in one implementation can be included in another implementation and the genetic combinations of features, structures, or characteristics are specifically contemplated. Embodiments can be implemented in a variety of ways, and that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. Embodiments should be understood to encompass all combinations of one or more features covered by this disclosure. It will be appreciated that any "computer" or "processor" or "controller" forms of the present application can be implemented as one or more physical devices, such as one or more central processing units (CPUs), microprocessors, microcomputers, microcontrollers, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or any other digital or analog circuitry.

[0196] It should be noted that, as used in this document, the terms "include," "includes," "including," "has," "have," "having," or the like are used inclusively, in a like manner to the term "comprise." That is, these terms allow for items to be present or not present, included or not included, as appropriate to the context of their usage. Any statement herein which contains one or more of these terms should be understood to allow for items, components, elements, or the like not explicitly stated, in addition to those items explicitly stated. These "open" terms do not on their own imply that any more limitations than are explicitly stated can be present in the process, method, article, or apparatus.

[0197] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0198] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they can be located in one place or distributed on multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0199] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be a single unit, or two or more units can be integrated in one unit; the integrated unit can be realized in the form of hardware or in the form of hardware plus software function unit.

[0200] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program executes the steps including the above-mentioned method embodiments when executed; and the foregoing storage medium includes a mobile storage device, a read only memory (ROM), a magnetic disc or an optical disc, and various storage program codes.

[0201] Alternatively, when the integrated unit of the present application is realized in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a plurality of instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes a mobile storage device, a ROM, a magnetic disc or an optical disc, and various storage program codes.

[0202] The above is only an embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0203] The above is only a preferred embodiment of the present application, and is not used to limit the protection scope of the present application, and any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A dialogue generation method, characterized by, The method comprises: obtaining interaction content of a conversation with a user; determining, according to the interaction content, whether the user meets a specified interaction condition in the conversation, and generating, based on the interaction content, explanation item content for explaining reasons for feedback content provided in response to a question of the user in the interaction content, when the user meets the specified interaction condition in the conversation; presenting the explanation item content; wherein the specified interaction condition at least represents one of: the user will end the conversation; the question content of the user meets a trigger condition; the number of repetitions of the question of the user meets a trigger condition.

2. The method of claim 1, wherein, When the specified interaction condition represents that the user will end the conversation, the determining, according to the interaction content, whether the user meets the specified interaction condition in the conversation comprises: presenting, to the user, a current set of to-be-responded options representing the user's intention, the current set of to-be-responded options being generated based on the question of the user and / or target responses of the user to a previous set of to-be-responded options; obtaining a current set of target responses in response to a response operation of the user to the current set of to-be-responded options; determining, based on the current set of target responses, whether the user will end the conversation; or determining, according to whether the question content of the user currently contains a target keyword, whether the user will end the conversation. When the specified interaction condition represents that the question content of the user meets a trigger condition, the determining, according to the interaction content, whether the user meets the specified interaction condition in the conversation comprises:

3. The method according to claim 1 or 2, characterized in that, determining, based on a result of semantic analysis on the question content of the user currently, at least one of a sentence structure, a sentence length, and a sentence keyword of the question content of the user currently; determining, according to at least one of the sentence structure, the sentence length, and the sentence keyword of the question content of the user currently, whether the question content of the user meets the trigger condition. The interaction content comprises: the question of the user, at least one set of to-be-responded options provided, target responses of the user, and an extended intention of the target responses; 4. The method according to any one of claims 1 to 3, characterized in that, The generating, based on the interaction content, of the explanation item content comprises: determining the explanation item content based on the question of the user and the extended intention of the target responses; The method further comprises: generating and presenting, based on the question of the user, the target responses of the user, and the extended intention of the target responses, suggestion item content for indicating an operation mode associated with at least one of the to-be-responded options under the explanation item content. The method further comprises:

5. The method of claim 4, wherein, preprocessing the question and the extended intention to obtain a first sentence set; The determining, based on the question of the user and the extended intention of the target responses, of the explanation item content comprises: classifying the first sentence set to obtain a second sentence set and a third sentence set; wherein the second sentence set represents the question pointed out by the user, and the third sentence set represents demand content of the user; extracting an abstract of the second sentence set and an abstract of the third sentence set, respectively; determining the explanation item content based on the abstract of the second sentence set and the abstract of the third sentence set. ​ 6. The method of claim 5, wherein, The preprocessing of the question and the extended intent to obtain a first sentence set comprises: respectively determining a subject of the question and a subject of the extended intent; respectively associating words in the subject of the question and the subject of the extended intent to a knowledge graph; determining the first sentence set based on the associated words of the knowledge graph.

7. The method according to any one of claims 4 to 6, characterized in that, The generating and presenting of the suggestion item content based on the question of the user, the target response of the user and the extended intent of the target response comprises: respectively obtaining a feature word set of the question and a subject of the extended intent; respectively determining the feature word set, the subject of the extended intent, the target response and a semantic representation vector of the extended intent; clustering the feature word set, the subject of the extended intent, the target response and the semantic representation vector of the extended intent to obtain the suggestion item content.

8. The method of claim 7, wherein, The clustering of the feature word set, the subject of the extended intent, the target response and the semantic representation vector of the extended intent to obtain the suggestion item content comprises: clustering the semantic representation vector of the target response, the feature word set and the subject of the extended intent to obtain a keyword set; wherein the keyword set comprises K1 keywords; clustering the semantic representation vector of the extended intent based on the keyword set to obtain a suggestion sentence set; concatenating the keyword set and the suggestion sentence set to obtain the suggestion item content.

9. The method according to any one of claims 2 to 8, characterized in that, The method further comprises: determining a text feature vector set of the question; sorting the importance of words in the question based on a saliency map and the text feature vector set to obtain a feature word set of the question; wherein the feature word set comprises the first N feature words with the largest importance of words in the question; determining the first set of response options based on the feature word set.

10. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores computer executable instructions, and the processor executes the program to implement the steps in the dialogue generation method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for information recommendation based on conversation interaction, server, and storage medium

    CN107832433A

  • Question and answer interacting method and device, computer equipment and computer readable storage medium

    CN107992543A

  • Interactive difficult portrait retrieval method, client and system

    CN112269889A

  • Dialogue generation method and device

    CN112818096A

  • Unknown intention recognition method and device, equipment and storage medium

    CN112966088A