Dialogue method and related product

By generating target prompt words and using language models, it is solved in the prior art that it is difficult to generate target questioning related to historical dialogues, and the interactive experience between the dialogue device and the target object is improved.

CN119577076APending Publication Date: 2025-03-07SHUXING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411567546.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The prior art is difficult to generate target questioning questions related to historical dialogues, resulting in the dialogue device being unable to effectively guide the target object to engage in interesting and related dialogues.

Method used

By obtaining historical dialogues, generating target prompt words, and using the language model of natural language processing capabilities, we generate target question-related questions based on target prompt words.

Benefits of technology

The matching degree between the topic of the target question question and the topic of the target object is improved, the interactive experience between the dialogue device and the target object is enhanced, and the time and energy investment of the target object in thinking and asking questions is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577076A_ABST
    Figure CN119577076A_ABST
Patent Text Reader

Abstract

The invention discloses a dialogue method and related products, the method is applied to a dialogue device, and the method is used for generating a target questioning question related to a historical dialogue for a target object under the condition that the dialogue device and the target object have generated the historical dialogue. The method comprises the steps of obtaining a historical dialogue; generating a target cue word based on the historical dialogue, the target cue word being used for guiding a language model to generate a target questioning question based on the historical dialogue, and the language model being a model having a natural language processing capability; and under the guidance of the target cue word, utilizing a language model to generate a target questioning question based on the historical dialogue. As the theme of the historical dialogue is the theme interested by the target object, the dialogue device generates the target question-asking problem related to the historical dialogue, and the probability that the theme of the target question-asking problem is the theme interested by the target object can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a dialogue method and related products. Background Art

[0002] With the development of natural language processing technology, the application of automatic dialogue is becoming more and more widespread. Among them, automatic dialogue refers to the dialogue between a dialogue device and an object. During the dialogue process, the dialogue device can guide the object to dialogue with the dialogue device by generating follow-up questions, so how to generate follow-up questions is of great significance. Summary of the invention

[0003] The present application provides a dialogue method and related products to generate target follow-up questions with the subject being the subject of interest to the target object, wherein the related products include a dialogue device, an electronic device, a computer-readable storage medium and a computer program product.

[0004] In a first aspect, a conversation method is provided, the method being applied to a conversation device, the method being used to generate, for a target object, a target follow-up question related to the historical conversation when the conversation device and a target object have had a historical conversation, the method comprising:

[0005] Obtain the historical conversation;

[0006] Based on the historical conversation, a target prompt word is generated, wherein the target prompt word is used to guide a language model to generate the target follow-up question based on the historical conversation, and the language model is a model with natural language processing capability;

[0007] Under the guidance of the target prompt word, the target follow-up question is generated based on the historical dialogue using the language model.

[0008] In combination with any embodiment of the present application, the target prompt word includes a first position identifier; the first position identifier is used to indicate the position of the historical conversation in the target prompt word;

[0009] The step of generating the target follow-up question based on the historical dialogue using the language model under the guidance of the target prompt word includes:

[0010] Determining the first position identifier from the target prompt word using the language model;

[0011] Determining the historical conversation from the target prompt word based on the first position identifier using the language model;

[0012] The target follow-up question is generated based on the historical dialogue using the language model.

[0013] In combination with any embodiment of the present application, the target prompt word includes a target example and a second position identifier; the target example is an example of a reference follow-up question related to the reference dialogue generated based on a reference dialogue, the reference dialogue is different from the historical dialogue, and the second position identifier is used to indicate the position of the target example in the target prompt word;

[0014] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0015] Determining the second position identifier from the target prompt word using the language model;

[0016] Determining the target example from the target prompt word using the language model based on the second position identifier;

[0017] Under the prompt of the target example, the target follow-up question is generated based on the historical dialogue using the language model.

[0018] In combination with any implementation manner of the present application, generating a target prompt word based on the historical conversation includes:

[0019] Acquire generation requirements, where the generation requirements are requirements that the target follow-up questions generated by the dialogue device need to meet;

[0020] Based on the historical dialogue and the generation requirement, the target prompt word is generated, and the target prompt word is used to guide the language model to generate the target follow-up question that meets the generation requirement based on the historical dialogue.

[0021] In combination with any implementation manner of the present application, generating a target prompt word based on the historical conversation includes:

[0022] Acquire a preset template, wherein the preset template includes a first indicator mark for indicating a position to be filled in with the historical conversation, and a second indicator mark for indicating a position to be filled in with the target example;

[0023] Determine, in the preset template, a position indicated by the first indicator as a first position;

[0024] Determine, in the preset template, a position indicated by the second indicator as a second position;

[0025] Filling the historical dialogue into the first position in the preset template to obtain a reference prompt word;

[0026] The target example is filled into the second position of the reference prompt word to obtain the target prompt word.

[0027] In combination with any embodiment of the present application, the generation requirement includes that, when the subject of the text input by the target object in the last round of the historical dialogue does not meet the preset requirement, the subject of the target follow-up question generated by the dialogue device meets the preset requirement;

[0028] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0029] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0030] When the subject of the target text does not meet the preset requirements, the language model is used to generate the target follow-up question that meets the preset requirements.

[0031] In combination with any embodiment of the present application, the target prompt word includes a third position identifier, and the third position identifier is used to indicate the position of the last round of dialogue in the historical dialogue in the target prompt word;

[0032] Before determining the text input by the target object in the last round of the historical dialogue to obtain the target text, the method further includes:

[0033] Determining the third position marker from the target prompt word using the language model;

[0034] The language model is used to determine the last round of the historical dialogue from the target prompt word based on the third position identifier.

[0035] In combination with any embodiment of the present application, the third position identifier is used to indicate the beginning of the last round of dialogue in the historical dialogue in the target prompt word, and the target prompt word includes a first round separator, and the first round separator is a separator of two adjacent rounds of dialogue in the historical dialogue;

[0036] The step of using the language model to determine the last round of the historical dialogue from the target prompt word based on the third position identifier includes:

[0037] The language model is used to determine from the target prompt word that the content between the third position marker and the last first round separator is the last round of the historical dialogue.

[0038] In combination with any embodiment of the present application, the generation requirement includes that the topic of the target follow-up question generated by the dialogue device is an extension of the topic of the last round of dialogue in the historical dialogue;

[0039] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0040] The language model is used to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue.

[0041] In combination with any embodiment of the present application, the step of using the language model to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue, includes:

[0042] Extracting the last round of dialogue from the historical dialogue to obtain a target dialogue;

[0043] Extracting keywords of the target conversation to obtain target keywords;

[0044] Generate candidate follow-up questions based on the historical conversation using the language model;

[0045] When the degree of matching between the semantics of the candidate follow-up question and the semantics of the target keyword is greater than or equal to a semantic threshold, the candidate follow-up question is determined to be the target follow-up question.

[0046] In conjunction with any embodiment of the present application, the generation requirement includes, when the text input by the target object in the last round of the historical conversation is a creative text, the target follow-up question includes guiding the target object to input a description of a text with clear subject, the creative text is a text with a number of subjects greater than 1, and the number of subjects of the text with clear subject is 1;

[0047] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0048] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0049] Determine the number of topics in the target text to obtain a target number;

[0050] When the target number is greater than 1, determining the target text as the creative text;

[0051] In the case where the target text is the creative text, the language model is used to generate the target follow-up question including a description for guiding the target object to input the subject-specific text.

[0052] In combination with any implementation manner of the present application, the obtaining of historical conversations includes:

[0053] Acquire a conversation that has occurred between the target object and the conversation device as a candidate conversation;

[0054] When the number of rounds of the conversations included in the candidate conversations is greater than or equal to n, the conversations of n rounds with the largest timestamps in the candidate conversations are taken as the historical conversations;

[0055] When the number of turns of the dialogue included in the candidate dialogue is less than n, the candidate dialogue is used as the historical dialogue.

[0056] In combination with any embodiment of the present application, the generation requirement includes that the number of the target follow-up questions generated by the dialogue device is m;

[0057] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0058] Using the language model and based on the historical conversation, generating m candidate follow-up questions related to the historical conversation for the target object;

[0059] The m candidate follow-up questions are used as the target follow-up questions.

[0060] In conjunction with any embodiment of the present application, the generation requirement includes that in a conversation between an object and the language model, the object's question is different from the follow-up question generated by the conversation device; the historical conversation includes k conversation questions of the target object;

[0061] The step of using the language model to generate the target follow-up question based on the historical dialogue includes:

[0062] The target follow-up question is generated based on the historical dialogue using the language model; the target follow-up question is different from the k dialogue questions.

[0063] In a second aspect, another dialogue method is provided, the method being applied to a dialogue device, the method comprising:

[0064] The target object conducts a dialogue with the dialogue device to generate a historical dialogue;

[0065] After the target object and the dialogue device finish a round of dialogue, the dialogue device displays a target follow-up question, where the target follow-up question is a follow-up question generated by the dialogue device for the target object and is related to the historical dialogue;

[0066] In a case where the target object selects the target follow-up question to ask, a target answer to the target follow-up question determined by using the language model is displayed to the target object.

[0067] In a third aspect, a dialogue device is provided, the dialogue device comprising:

[0068] An acquisition unit, used for acquiring the historical conversation;

[0069] A first generating unit is used to generate a target prompt word based on the historical dialogue, wherein the target prompt word is used to guide a language model to generate the target follow-up question based on the historical dialogue, and the language model is a model with natural language processing capability;

[0070] The second generating unit is used to generate the target follow-up question based on the historical dialogue by using the language model under the guidance of the target prompt word.

[0071] In combination with any embodiment of the present application, the target prompt word includes a first position identifier; the first position identifier is used to indicate the position of the historical conversation in the target prompt word;

[0072] The second generating unit is further used for:

[0073] Determining the first position identifier from the target prompt word using the language model;

[0074] Determining the historical conversation from the target prompt word based on the first position identifier using the language model;

[0075] The target follow-up question is generated based on the historical dialogue using the language model.

[0076] In combination with any embodiment of the present application, the target prompt word includes a target example and a second position identifier; the target example is an example of a reference follow-up question related to the reference dialogue generated based on a reference dialogue, the reference dialogue is different from the historical dialogue, and the second position identifier is used to indicate the position of the target example in the target prompt word;

[0077] The second generating unit is further used for:

[0078] Determining the second position identifier from the target prompt word using the language model;

[0079] Determining the target example from the target prompt word using the language model based on the second position identifier;

[0080] Under the prompt of the target example, the target follow-up question is generated based on the historical dialogue using the language model.

[0081] In conjunction with any embodiment of the present application, the first generating unit is specifically used to:

[0082] Acquire generation requirements, where the generation requirements are requirements that the target follow-up questions generated by the dialogue device need to meet;

[0083] Based on the historical dialogue and the generation requirement, the target prompt word is generated, and the target prompt word is used to guide the language model to generate the target follow-up question that meets the generation requirement based on the historical dialogue.

[0084] In conjunction with any embodiment of the present application, the first generating unit is specifically used to:

[0085] Acquire a preset template, wherein the preset template includes a first indicator mark for indicating a position to be filled in with the historical conversation, and a second indicator mark for indicating a position to be filled in with the target example;

[0086] Determine, in the preset template, a position indicated by the first indicator as a first position;

[0087] Determine, in the preset template, a position indicated by the second indicator as a second position;

[0088] Filling the historical dialogue into the first position in the preset template to obtain a reference prompt word;

[0089] The target example is filled into the second position of the reference prompt word to obtain the target prompt word.

[0090] In combination with any embodiment of the present application, the target prompt word includes a third position identifier, and the third position identifier is used to indicate the position of the last round of dialogue in the historical dialogue in the target prompt word;

[0091] The second generating unit is further used for:

[0092] Determining the third position marker from the target prompt word using the language model;

[0093] The language model is used to determine the last round of the historical dialogue from the target prompt word based on the third position identifier.

[0094] In combination with any embodiment of the present application, the third position identifier is used to indicate the beginning of the last round of dialogue in the historical dialogue in the target prompt word, and the target prompt word includes a first round separator, and the first round separator is a separator of two adjacent rounds of dialogue in the historical dialogue;

[0095] The second generating unit is further used for:

[0096] The language model is used to determine from the target prompt word that the content between the third position marker and the last first round separator is the last round of the historical dialogue.

[0097] In combination with any embodiment of the present application, the generation requirement includes that, when the subject of the text input by the target object in the last round of the historical dialogue does not meet the preset requirement, the subject of the target follow-up question generated by the dialogue device meets the preset requirement;

[0098] The second generating unit is specifically used for:

[0099] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0100] When the subject of the target text does not meet the preset requirements, the language model is used to generate the target follow-up question that meets the preset requirements.

[0101] In combination with any embodiment of the present application, the generation requirement includes that the topic of the target follow-up question generated by the dialogue device is an extension of the topic of the last round of dialogue in the historical dialogue;

[0102] The second generating unit is specifically used for:

[0103] The language model is used to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue.

[0104] In combination with any embodiment of the present application, the second generating unit is further used to:

[0105] Extracting the last round of dialogue from the historical dialogue to obtain a target dialogue;

[0106] Extracting keywords of the target conversation to obtain target keywords;

[0107] Generate candidate follow-up questions based on the historical conversation using the language model;

[0108] When the degree of matching between the semantics of the candidate follow-up question and the semantics of the target keyword is greater than or equal to a semantic threshold, the candidate follow-up question is determined to be the target follow-up question.

[0109] In conjunction with any embodiment of the present application, the generation requirement includes, when the text input by the target object in the last round of the historical conversation is a creative text, the target follow-up question includes guiding the target object to input a description of a text with clear subject, the creative text is a text with a number of subjects greater than 1, and the number of subjects of the text with clear subject is 1;

[0110] The second generating unit is specifically used for:

[0111] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0112] Determine the number of topics in the target text to obtain a target number;

[0113] When the target number is greater than 1, determining the target text as the creative text;

[0114] In the case where the target text is the creative text, the language model is used to generate the target follow-up question including a description for guiding the target object to input the subject-specific text.

[0115] In a fourth aspect, another dialogue device is provided, the dialogue device comprising:

[0116] An acquisition unit, used for the target object to have a conversation with the conversation device and generate a historical conversation;

[0117] a display unit, configured to display a target follow-up question by the dialogue device after the target object and the dialogue device finish a round of dialogue, wherein the target follow-up question is a follow-up question generated by the dialogue device for the target object and related to the historical dialogue;

[0118] An answering unit is used to display a target answer to the target follow-up question determined by using the language model to the target object when the target object selects the target follow-up question to ask.

[0119] In a fifth aspect, an electronic device is provided, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the electronic device executes the above-mentioned first aspect and any embodiment thereof, or executes the above-mentioned second aspect and any embodiment thereof.

[0120] In a sixth aspect, another electronic device is provided, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the first aspect and any embodiment thereof, or executes the second aspect and any embodiment thereof.

[0121] In the seventh aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the first aspect and any embodiment thereof, or to execute the second aspect and any embodiment thereof.

[0122] In an eighth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to execute the above-mentioned first aspect and any embodiment thereof, or execute the above-mentioned second aspect and any embodiment thereof.

[0123] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.

[0124] In an embodiment of the present application, when a dialogue device generates a historical dialogue with a target object, the dialogue device generates a target prompt word based on the historical dialogue, wherein the target prompt word is used to guide the language model to generate a target follow-up question related to the historical dialogue based on the historical dialogue. Because the historical dialogue is a dialogue generated by the target object and the dialogue device based on the topic of the historical dialogue driven by interest, the topic of the historical dialogue is the topic of interest to the target object. After generating the target prompt word, the dialogue device can use the target prompt word to guide the language model to generate a target follow-up question based on the historical dialogue. Since the topic of the historical dialogue is the topic of interest to the target object, the dialogue device generates a target follow-up question related to the historical dialogue, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object.

[0125] In a possible scenario, after the dialogue device generates a target follow-up question for the target object, it displays the target follow-up question to the target object. After the target object receives the target follow-up question displayed by the dialogue device, it selects the target follow-up question to ask. After receiving the target object's request to select the target follow-up question to ask, the dialogue device generates an answer to the question based on the target follow-up question, and displays the generated answer to the target object, thereby guiding the target object to have further dialogue with the dialogue device, reducing the time and energy invested by the target object in thinking about the follow-up question, and improving the interactive experience between the target object and the dialogue device. BRIEF DESCRIPTION OF THE DRAWINGS

[0126] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0127] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0128] Figure 1 A flowchart of a dialogue method provided in an embodiment of the present application;

[0129] Figure 2 A schematic diagram of a target prompt word including more than one target example and a second position identifier provided in an embodiment of the present application;

[0130] Figure 3 A schematic diagram of a target prompt word including generation requirements provided in an embodiment of the present application;

[0131] Figure 4 A flowchart of another dialogue method provided in an embodiment of the present application;

[0132] Figure 5 A flowchart of a conversation method provided in an embodiment of the present application;

[0133] Figure 6 A schematic diagram of the structure of a conversation device provided in an embodiment of the present application;

[0134] Figure 7 A schematic diagram of the structure of another dialogue device provided in an embodiment of the present application;

[0135] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0136] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0137] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0138] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0139] The execution subject of the embodiment of the present application is a dialogue device, wherein the dialogue device can be any electronic device that can execute the technical solution disclosed in the method embodiment of the present application. Optionally, the dialogue device can be one of the following: a computer, a server.

[0140] It should be understood that the method embodiment of the present application can also be implemented by a processor executing a computer program code. The following describes the embodiment of the present application in conjunction with the drawings in the embodiment of the present application. Figure 1 , Figure 1 A flowchart of a dialogue method provided in an embodiment of the present application.

[0141] 101. Get historical conversations.

[0142] In the embodiment of the present application, the historical dialogue is a dialogue generated between the target object and the dialogue device, wherein the historical dialogue can be a dialogue containing any content. In a possible implementation, the historical dialogue can be a dialogue in which the target object asks the dialogue device a question. For example, the historical dialogue includes a dialogue a1 of the target object and a dialogue a2 of the dialogue device, and the dialogue a1 includes: What is the weather like today? The dialogue a2 includes: The weather today is cloudy, 30 to 35 degrees.

[0143] In another possible implementation, the historical dialogue may be a dialogue between the target object and the dialogue device. For example, the historical dialogue includes dialogue a3 of the target object and dialogue a4 of the dialogue device. Dialogue a3 includes: It seems not suitable to go out today. Dialogue a4 includes: It is very hot outside, but you can go to the indoor cinema to watch a movie.

[0144] In another possible implementation, the historical dialogue may be a dialogue in which the target object instructs the dialogue device to perform a task. For example, the historical dialogue includes dialogue a5 of the target object and dialogue a6 of the dialogue device, where dialogue a5 includes: Help me find out which movies are shown around 3 o'clock. Dialogue a6 includes: Help you find out that the cinema will show movie B at 2:55.

[0145] Optionally, the historical dialogue includes one or more rounds of dialogue between the target object and the dialogue device, and one round of dialogue includes an input from the target object and an answer generated by the dialogue device based on the input.

[0146] In one implementation of obtaining historical conversations, a conversation device obtains at least one round of conversations between a target object and the conversation device. At least one topic of at least one round of conversations is determined. The number of conversations corresponding to each topic in at least one topic is determined. Historical conversations are determined based on the conversations corresponding to the topics with the largest number. For example, the conversation device obtains three rounds of conversations between the target object and the conversation device, including conversation a1, conversation a2, and conversation a3, wherein the topics of conversation a1 and conversation a2 are games, and the topic of conversation a3 is beauty. At this time, the number of conversations corresponding to the game topic is 2, and the number of conversations corresponding to the beauty topic is 1. Since the number of game topics is greater than the number of beauty topics, historical conversations are determined based on the conversations corresponding to the game topics, specifically, based on conversations a1 and conversation a2. Optionally, the conversations corresponding to the topics with the largest number are taken as historical conversations.

[0147] In another implementation of obtaining historical conversations, conversations whose time interval from the current time is less than or equal to the time threshold are determined from the conversations between the target object and the conversation device as historical conversations. Considering that the conversation between the target object and the conversation device may be interrupted, the time interval between the last few rounds of conversations between the target object and the conversation device may be far from the current time. As for the topics of conversations with a long time interval, the probability that the target object is currently interested in them may not be great. Therefore, this implementation determines the conversations whose time interval from the current time is less than or equal to the time threshold as historical conversations, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object, and thus increase the probability that the target object selects the target follow-up question for follow-up. For example, the target object has a round of conversation with the conversation device at time t1 (hereinafter referred to as conversation a). Due to being interrupted by other things, the target object interrupts the conversation with the conversation device after conversation a, and then continues to have a round of conversation with the conversation device at time t2 (hereinafter referred to as conversation b). If the current time is t2, and the time interval between t1 and t2 is 5 hours, although dialogue a is one of the two most recent dialogues between the target object and the dialogue device, the probability that the target object is currently interested in the topic of dialogue a may not be high because it occurred a long time ago.

[0148] In one method of acquiring historical conversations, a conversation device receives historical conversations input by a user through an input component. The input component includes at least one of the following: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.

[0149] In another method of obtaining historical conversations, the conversation device receives historical conversations sent by a terminal. The terminal includes at least one of the following: a mobile phone, a computer, a tablet computer, and a server.

[0150] 102. Generate target prompt words based on the above historical dialogue.

[0151] In the embodiment of the present application, the target prompt is used to guide the language model to generate a target follow-up question based on the historical dialogue, wherein the target prompt includes the historical dialogue. The target follow-up question is a follow-up question related to the historical dialogue generated by the dialogue device for the target object, wherein the target follow-up question is a question provided to the target object to inquire the dialogue device.

[0152] Because the target object, driven by interest, conducts a dialogue with the dialogue device based on the topic of the historical dialogue and obtains the historical dialogue, the target object is interested in the topic of the historical dialogue. Since the target object is interested in the topic of the historical dialogue, by guiding the language model to generate target follow-up questions related to the historical dialogue, the probability that the target object is interested in the topic of the target follow-up question can be increased, thereby increasing the probability that the target object selects the target follow-up question to ask.

[0153] In the embodiment of the present application, the language model has the ability of natural language processing. In a possible implementation method, the language model is obtained by training text training data, wherein the text training data includes one or more of masked text and non-masked text. Masked text is text including mask. When the text training data includes masked text, the language model is trained using the text training data, so that the language model can predict the content blocked by the mask in the masked text to obtain a first prediction result, and then the loss of the language model is determined based on the difference between the first prediction result and the true value (ground truth, GT) of the mask. The parameters of the language model are updated based on the loss until the loss of the language model converges, and the training of the language model can be completed. Non-masked text is text that does not include mask. When the text training data does not include non-masked text, the language model is trained using text training data, so that the language model can perform natural language processing tasks using non-masked text, thereby improving the natural language processing ability of the language model, wherein the natural language processing tasks include: summarizing the summary of the text, determining the order of sentences, and determining the answer to the question based on the text.

[0154] Optionally, the above language model is a large language model (LLM), where LLM refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question answering, dialogue, generating text summaries, and generating code.

[0155] 103. Under the guidance of the target prompt words, the target follow-up questions are generated based on the historical dialogue using the language model.

[0156] In the embodiment of the present application, after generating the target prompt word, the dialogue device uses the target prompt word to guide the language model to generate a follow-up question that the target object is interested in based on the historical dialogue, and obtains the target follow-up question. Specifically, the target follow-up question is a follow-up question that can be connected to the historical dialogue after the dialogue device uses the language model to determine the information in the historical dialogue, wherein the connection characterizes that the target follow-up question is an extended follow-up question of the theme of the historical dialogue, or characterizes that the target follow-up question is a follow-up question that matches the semantics of the historical dialogue.

[0157] In a possible implementation, the target follow-up question is a follow-up question that extends the theme of the historical conversation. For example, when the theme of the text input by the target object in the historical conversation is region A, the target follow-up question is a follow-up question that extends the theme of region A, including: What are the attractions in region A? What are the delicacies in region A?

[0158] In another possible implementation, the target follow-up question is a follow-up question that matches the semantics of the historical conversation. For example, when the text input by the target object in the historical conversation includes: What are the delicacies in area A? The answer generated by the dialogue device in the historical conversation includes: The delicacies in area A include delicacies X. The target follow-up question is a follow-up question that matches the semantics of delicacies X in the historical conversation, including: Which restaurant in area A has delicious delicacies X? Where can I buy delicacies X in area A?

[0159] In an embodiment of the present application, when a dialogue device generates a historical dialogue with a target object, the dialogue device generates a target prompt word based on the historical dialogue, wherein the target prompt word is used to guide the language model to generate a target follow-up question related to the historical dialogue based on the historical dialogue. Because the historical dialogue is a dialogue generated by the target object and the dialogue device based on the topic of the historical dialogue driven by interest, the topic of the historical dialogue is the topic of interest to the target object. After generating the target prompt word, the dialogue device can use the target prompt word to guide the language model to generate a target follow-up question based on the historical dialogue. Since the topic of the historical dialogue is the topic of interest to the target object, the dialogue device generates a target follow-up question related to the historical dialogue, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object.

[0160] In a possible scenario, after the dialogue device generates a target follow-up question for the target object, it displays the target follow-up question to the target object. After the target object receives the target follow-up question displayed by the dialogue device, it selects the target follow-up question to ask. After receiving the target object's request to select the target follow-up question to ask, the dialogue device generates an answer to the question based on the target follow-up question, and displays the generated answer to the target object, thereby realizing further dialogue between the target object and the dialogue device, reducing the time and energy invested by the target object in thinking about the follow-up question, and improving the interactive experience between the target object and the dialogue device.

[0161] As an optional implementation, the target prompt word includes a first position identifier, and the first position identifier is used to indicate the position of the historical dialogue in the target prompt word. The dialogue device performs the following steps during the execution of step 103:

[0162] 201. Determine the first position marker from the target prompt word using the language model.

[0163] In an embodiment of the present application, the target prompt word includes a first position identifier and a historical conversation, wherein the first position identifier is used to indicate the position of the historical conversation in the target prompt word, and the conversation device can determine the historical conversation from the target prompt word based on the first position identifier.

[0164] In a possible implementation, the first position identifier includes a start symbol and an end symbol, wherein the position where the start symbol appears indicates the position where the historical conversation starts, and the position where the end symbol appears indicates the position where the historical conversation ends.

[0165] In another possible implementation, the first position identifier includes a first position text describing the position of the historical conversation in the target prompt word and a first round separator, wherein the first round separator is a separator of two adjacent rounds of conversation in the historical conversation, that is, the appearance of the first round separator indicates the end of a round of conversation. At this time, the content between two adjacent first round separators is a round of conversation. The language model can determine that the content after the first position text is a historical conversation based on the first position identifier, that is, the beginning of the historical conversation can be determined based on the first position text, and whether the historical conversation has ended can be determined based on the first round separator, that is, the end of the historical conversation can be determined based on the last first round separator. For example, the first position text is "The following is a historical conversation between the target object and the dialogue device", and the first round separator is "-----". The language model can determine that the content after "The following is the historical dialogue between the target object and the dialogue device" is the beginning of the historical dialogue, and can determine that the last "-----" is the end of the last round of dialogue in the historical dialogue, and further determine that the content after "The following is the historical dialogue between the target object and the dialogue device" and before the last "-----" is the historical dialogue.

[0166] In another possible implementation, the first position marker indicates a paragraph in the target prompt word, and the position indicated by the first position marker is the paragraph in the target prompt word. For example, the paragraph indicated by the first position marker is the third paragraph, and the content of the third paragraph in the target prompt word is a historical conversation. For another example, the paragraph indicated by the first position marker is the third to sixth paragraphs, and the content of the third to sixth paragraphs in the target prompt word is a historical conversation.

[0167] 202. Determine the historical dialogue from the target prompt word using the language model based on the first position identifier.

[0168] In the embodiment of the present application, when the dialogue device determines the first position mark in the target prompt word using the language model, the position of the historical dialogue in the target prompt word is determined according to the position indicated by the first position mark. After determining the position of the historical dialogue in the target prompt word, the historical dialogue can be determined.

[0169] In one possible implementation, the first position identifier includes a start symbol and an end symbol. The dialogue device uses a language model to determine that the content between the start symbol and the end symbol in the target prompt word is a historical dialogue. In another possible implementation, the first position identifier includes a first position text and a first round separator that describe the position of the historical dialogue in the target prompt word. The dialogue device uses a language model to determine that the content after the first position text and before the last first round separator in the target prompt word is a historical dialogue. In yet another possible implementation, the first position identifier indicates a paragraph in the target prompt word, and the dialogue device uses a language model to determine that the paragraph indicated by the first position identifier is a historical dialogue.

[0170] 203. Generate the target follow-up question based on the historical dialogue using the language model.

[0171] In the embodiment of the present application, after the dialogue device uses the language model to determine the historical dialogue in the target prompt word, it uses the language model to generate follow-up questions that the target object is interested in based on the historical dialogue to obtain the target follow-up question.

[0172] In this embodiment, the dialogue device uses a language model to determine the first position identifier in the target prompt word, then determines the historical conversation in the target prompt word based on the first position identifier, and finally generates a target follow-up question based on the historical conversation. In the case where there is a first position identifier in the target prompt word, after the dialogue device uses a language model to determine the first position identifier, the position of the historical conversation in the target prompt word can be determined according to the position indicated by the first position identifier, and the historical conversation in the target prompt word can be accurately determined according to the content of the position indicated by the first position identifier, which is more accurate than determining the historical conversation from the target prompt word through the semantics of the target prompt word. By improving the accuracy of the historical conversation that the target object is interested in, when the target follow-up question is related to the historical conversation, the probability that the subject of the target follow-up question is the subject of interest to the target object can be increased, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0173] As an optional implementation, the target prompt word includes a target example and a second position identifier. The target example is an example of a reference follow-up question related to the reference dialogue generated based on a reference dialogue. The reference dialogue is different from the historical dialogue. The second position identifier is used to indicate the position of the target example in the target prompt word. It should be understood that the target prompt word is used to guide the language model to generate a target follow-up question based on the historical dialogue, that is, the target prompt word includes the historical dialogue. Because in this implementation, the target prompt word includes the target example and the second position identifier, the target prompt word includes the second position identifier, the historical dialogue, and the target example.

[0174] The dialogue device generates the target follow-up question based on the historical dialogue using the language model by executing the following steps:

[0175] 301. Determine the second position marker from the target prompt word using the language model.

[0176] In the embodiment of the present application, the target example is an example of generating a reference follow-up question related to the reference dialogue based on the reference dialogue, and the reference dialogue is different from the historical dialogue. The target example includes the reference dialogue and the reference follow-up question related to the reference dialogue, wherein the reference dialogue includes one or more rounds of dialogue. The dialogue device uses the language model to obtain a prompt for generating a reference follow-up question related to the reference dialogue from the target example, and generates a target follow-up question related to the historical dialogue based on the prompt.

[0177] In the embodiment of the present application, the second position identifier is used to indicate the position of the target example in the target prompt word, and the dialogue device can determine the target example from the target prompt word based on the second position identifier.

[0178] In a possible implementation, the second position identifier includes a start symbol and an end symbol, wherein the position where the start symbol appears indicates the position where the target example starts, and the position where the end symbol appears indicates the position where the target example ends.

[0179] In another possible implementation, the second position identifier includes a second position text and a second round separator that describes the position of the target example in the target prompt word, wherein the second round separator is a separator of two adjacent rounds of dialogue in the reference dialogue of the target example, that is, the appearance of the second round separator indicates the end of a round of dialogue. At this time, the content between two adjacent second round separators is a round of dialogue. The language model can determine that the content after the second position text is the target example based on the second position identifier, that is, the beginning of the target example can be determined based on the second position text, and can determine whether the reference dialogue in the target example has ended based on the second round separator, that is, the end of the reference dialogue in the target example can be determined based on the last second round separator. The beginning of the reference follow-up question in the target example can also be determined based on the last second round separator. For example, the second position text includes "The following is the reference dialogue of the target example", and the second round separator is "*****". The language model can determine that the content after "The following is the reference dialogue of the target example" is the beginning of the reference dialogue in the target example, and can determine that the last "*****" is the end of the last round of dialogue in the reference dialogue, and further determine that the content after "The following is the reference dialogue of the target example" and before the last "*****" is the reference dialogue. The language model can also determine that the content after the last "*****" is the reference follow-up question in the target example.

[0180] In another possible implementation, the second position marker indicates a paragraph in the target prompt word. In this case, the position indicated by the second position marker is the paragraph in the target prompt word. For example, the paragraph indicated by the second position marker is the 4th paragraph. In this case, the 4th paragraph in the target prompt word is the target example. For another example, the paragraph indicated by the second position marker is the 4th to 6th paragraphs. In this case, the contents of the 4th to 6th paragraphs in the target prompt word are the target examples.

[0181] Optionally, the number of target examples in the target prompt word is greater than 1. The dialogue device can use the language model to obtain one or more prompts to generate reference follow-up questions related to the reference dialogue from one or more target examples, and the target follow-up questions generated based on one or more prompts are more relevant to the historical dialogue. In a possible implementation, the number of target examples in the target prompt word is greater than 1, and the target prompt word contains more than one second position identifier, and any two adjacent second position identifiers indicate the positions of different target examples in the target prompt word. For example, the target examples in the target prompt word include example s1 and example s2, the second position identifier is identifier b2, and there are three identifiers b2 in the target prompt word. At this time, it means that the content between the first identifier b2 and the third identifier b2 is the target example, wherein the content between the first identifier b2 and the second identifier b2 is example s1, and the content between the second identifier b2 and the third identifier b2 is example s2.

[0182] Optionally, the target example includes a fourth position identifier, which is used to indicate the position of the last round of dialogue in the reference dialogue in the target prompt word. In this way, the language model can determine the last round of dialogue in the reference dialogue from the target example based on the fourth position identifier, and then can generate a target follow-up question based on the last round of dialogue in the historical dialogue based on the relationship between the last round of dialogue in the reference dialogue and the reference follow-up question.

[0183] See also Figure 2 , Figure 2 A schematic diagram of a target prompt word including more than one target example and a second position identifier provided for an embodiment of the present application. Specifically, the target prompt word includes Example-1, Example-2, and Example-3. Example-1 is represented by "[Example-1]" in the figure, Example-2 is represented by "[Example-2]" in the figure, and Example-3 is represented by "[Example-3]" in the figure.

[0184] Example-1 includes the following:

[0185] The chat log between [Subject 1] and [Dialogue Device]. \"--------\" is the separator between each round of conversation.

[0186] Subject 1: Will the floor heating crack due to freezing?

[0187] Dialogue device: Whether the floor heating will be frozen and cracked depends mainly on whether there is still water in the floor heating pipe. If the water in the floor heating pipe freezes at low temperatures, since the volume of ice is larger than that of water, it may cause pressure on the floor heating pipe, which may cause the floor heating pipe to crack. Therefore, if the floor heating is not used in winter, it is best to drain all the water while there is still water in the floor heating pipe to prevent the floor heating pipe from being frozen and cracked. If conditions permit, you can also add antifreeze to the floor heating system, so that even at low temperatures, the floor heating pipe will not be cracked due to the freezing of water.

[0188] --------

[0189] Here is [the final round of conversation].

[0190] Object 1: Which city has the most squares?

[0191] Dialogue device: In Area A, you will find squares everywhere, with a total of 102 squares, which is known as the city with the most squares. Among them, the First Square is the largest city square in Area A. In addition to the First Square, there are many squares worth visiting in Area A, such as the Second Square, the Third Square, the Fourth Square, etc. Each square has its own unique charm and characteristics. Whether you like to appreciate the musical fountain, interact with pigeons, or stroll in the square to appreciate the surrounding buildings, the squares in Area A can satisfy you.

[0192] --------

[0193] Generated questions:

[0194] 1. What else is fun to do in Area A?

[0195] 2. Which other cities have many squares?

[0196] 3.What fun things are there around the First Square?

[0197] Example-2 includes the following:

[0198] The following is a conversation log between [Subject 2] and [Dialogue Device]. \"--------\" is the separator between each round of conversation. The following is the [last round of conversation].

[0199] Subject 2: Where can I watch Movie B?

[0200] Dialogue device: Hey, I found a few places where you can watch Movie B: 1. Movie TV: This is a platform dedicated to playing movies, and it must have Movie B. 2. Tablet: You can download some APPs on your tablet to watch Movie B, but you need to be aware that you may only be able to watch the first episode on your phone. The above are the platforms I found for watching Movie B, I hope it will be helpful to you!

[0201] --------

[0202] Generated questions:

[0203] 1. Which platform has the best picture quality?

[0204] 2.Who are the main actors?

[0205] 3.What is the Douban rating?

[0206] Example-3 includes the following:

[0207] The following is a log of the conversation between [Subject 3] and [Dialogue Device]. \"--------\" is the separator between each round of conversation.

[0208] Object 3: Introduction to famous attractions in area A.

[0209] Dialogue device: There are many attractions worth visiting in Area A. 1. Attraction A1: This is one of the most famous landmarks in Area A, located on a hill in the city center, with a white facade and a green dome. 2. Attraction A2: This is an area in the north of Area A, known as the hometown of Santa Claus. There are large tracts of virgin forests, lakes and northern lights here. It is a place full of mystery and romance. 3. Attraction A3: This is a beautiful island national park in the southwest of Area A, including more than 30,000 small islands. 4. Attraction A4: This is one of the most famous national parks in Area A, located in the middle of Area A. There are large tracts of forests, lakes and swamps here, and it is also the habitat of many animals. The above is an introduction to some famous attractions in Area A, I hope it will be helpful to you.

[0210] --------

[0211] Here is [the final round of conversation].

[0212] Item 3: What other famous attractions are there in Area A?

[0213] Dialogue device: Region A is a place full of mystery and magic, with many attractions worth visiting. 1. Attraction A5: The capital of Region A, the cultural and political center. 2. Attraction A6: The spectacular glacial lake where icebergs drift into the sea. 3. Attraction A7: Attraction A7 stands out from the crowd, not taking the traditional route, and its apocalyptic beauty is unique. 4. Attraction A8: Experience the extraordinary feeling of stepping on two continents. The attractions include Attraction A81, Attraction A82 and Attraction A83. 5. Attraction A9: The famous geothermal hot spring. 6. Attraction A10 and Attraction A11: Attraction A10 is one of the few waterfalls in the world where you can walk behind the water curtain. Attraction A11 is not only beautiful in appearance, but also often hangs a rainbow, so it is affectionately called "Rainbow Falls" by many friends. The above is an introduction to some famous attractions in Region A, I hope it will be helpful to you.

[0214] --------

[0215] Generated questions:

[0216] 1. What is the best season to travel to Area A?

[0217] 2. What is the ticket price for attraction A11?

[0218] 3. How to plan travel in area A?

[0219] exist Figure 2 In the example above, the target prompt word also includes generation requirements that need to be met by the dialogue device to generate follow-up questions. Specifically, the generation requirements include: referring to the above example, generate 3 questions of no more than 7 words for the dialogue between the following object and the dialogue device, and ensure that the differences between the generated 3 questions are large enough.

[0220] Figure 2 In the example, the second position identifier includes the identifier of the first round of dialogue in the example-1 guiding the dialogue device to determine the first round of dialogue in the example-1, including: The following is a chat record between [object 1] and [dialogue device]. \"--------\" is a separator between each round of dialogue.

[0221] The second position identifier also includes an identifier for guiding the dialogue device in Example-1 to determine the last round of dialogue in Example-1, including: the following is [the last round of dialogue].

[0222] The second position identifier also includes an identifier in Example-1 that guides the dialogue device to determine the follow-up question generated in Example-1, including: the generated question.

[0223] The second position identifier also includes an identifier in Example-2 that guides the dialogue device to determine the last round of dialogue in Example-2, including: The following is a chat record between [object 2] and [dialogue device]. \"--------\" is a separator between each round of dialogue. The following is [the last round of dialogue].

[0224] The second position identifier also includes an identifier for guiding the dialogue device in Example-2 to determine the follow-up question generated in Example-2, including: the generated question.

[0225] The second location identifier also includes an identifier in Example-3 that guides the dialogue device to determine the first round of dialogue in Example-3, including: The following is a chat record between [object 3] and [dialogue device]. \"--------\" is a separator between each round of dialogue.

[0226] The second position identifier also includes an identifier for guiding the dialogue device in Example-3 to determine the last round of dialogue in Example-3, including: the following is [the last round of dialogue].

[0227] The second location identifier also includes the identifier of the guide dialogue device in Example-3 to determine the follow-up question generated in Example-3, including: the generated question.

[0228] The second position mark also includes a symbol mark, the symbol mark is Figure 2 In the example-1, the first round of dialogue is represented as "--------". After the dialogue device determines the identifier of the first round of dialogue in Example-1, it continues to determine the symbol identifier in the following text. When the first symbol identifier is determined, the content between the identifier of the first round of dialogue in Example-1 and the first symbol identifier after the identifier of the first round of dialogue in Example-1 is determined as the first round of dialogue in Example-1.

[0229] After the dialogue device determines the identifier of the last round of dialogue in Example-1, it continues to determine the symbol identifier in the following text. When the first symbol identifier is determined, the content between the identifier of the last round of dialogue in Example-1 and the first symbol identifier after the identifier of the last round of dialogue in Example-1 is determined as the last round of dialogue in Example-1.

[0230] When the dialog device determines the identifier of the follow-up question generated in Example-1, "[Example-2]" is determined below. When "[Example-2]" is determined, the content between the identifier of the follow-up question generated in Example-1 and "[Example-2]" is determined as the follow-up question generated in Example-1.

[0231] After the dialogue device determines the identifier of the last round of dialogue in Example-2, it continues to determine the symbol identifier in the following text. When the first symbol identifier is determined, the content between the identifier of the last round of dialogue in Example-2 and the first symbol identifier after the identifier of the last round of dialogue in Example-2 is determined as the last round of dialogue in Example-2.

[0232] When the dialog device determines the identifier of the follow-up question generated in Example-2, "[Example-3]" is determined below. When "[Example-3]" is determined, the content between the identifier of the follow-up question generated in Example-2 and "[Example-3]" is determined as the follow-up question generated in Example-2.

[0233] After the dialogue device determines the identifier of the first round of dialogue in Example-3, it continues to determine the symbol identifier in the following. When the first symbol identifier is determined, the content between the identifier of the first round of dialogue in Example-3 and the first symbol identifier after the identifier of the first round of dialogue in Example-3 is determined as the first round of dialogue in Example-3.

[0234] After the dialogue device determines the identifier of the last round of dialogue in Example-3, it continues to determine the symbol identifier in the following text. When the first symbol identifier is determined, the content between the identifier of the last round of dialogue in Example-3 and the first symbol identifier after the identifier of the last round of dialogue in Example-3 is determined as the last round of dialogue in Example-1.

[0235] After the dialogue device determines the identifier of the follow-up question generated in Example-3, the requirements that need to be met by the dialogue device to generate the follow-up question are determined below. When the requirements that need to be met by the dialogue device to generate the follow-up question are determined, the content between the identifier of the follow-up question generated in Example-3 and the requirements that need to be met by the dialogue device to generate the follow-up question is determined as the follow-up question generated in Example-3.

[0236] exist Figure 2 In the embodiment, different second position identifiers can not only indicate the positions of different examples in the target example in the target prompt word, but also indicate the positions of different rounds of dialogues and follow-up questions in the same example in the target prompt word, so that the dialogue device can quickly use the second position identifier to determine the text of the target example, thereby improving the accuracy and speed of determining the target example.

[0237] 302. Determine the target example from the target prompt word using the language model based on the second position identifier.

[0238] In the embodiment of the present application, when the dialogue device determines the second position identifier in the target prompt word using the language model, the position of the target example in the target prompt word is determined according to the position indicated by the second position identifier. After determining the position of the target example in the target prompt word, the target example can be determined.

[0239] In one possible implementation, the second position identifier includes a start symbol and an end symbol. The dialogue device uses a language model to determine that the content between the start symbol and the end symbol in the target prompt word is the target example. In another possible implementation, the second position identifier includes a second position text and a second round separator that describe the position of the target example in the target prompt word. The dialogue device uses a language model to determine that the content in the target prompt word that is located after the first position text and between the last second round separator is the reference dialogue in the target example, and determines that the content after the last second round separator is the reference follow-up question in the target example. In yet another possible implementation, the second position identifier indicates a paragraph in the target prompt word, and the dialogue device uses a language model to determine the paragraph indicated by the second position identifier as the target example.

[0240] In a possible implementation scenario, the target prompt word contains historical conversations, target examples, a first position identifier, and a second position identifier. The dialogue device uses a language model to determine the first position identifier and the second position identifier in the target prompt word, determines the position of the historical conversation in the target prompt word through the first position identifier, and determines the position of the target example in the target prompt word through the second position identifier. After determining the positions of the target example and the historical conversation in the target prompt word, the historical conversation and the target example are determined from the target prompt word.

[0241] In an implementation method for generating a target prompt word, the semantics of the historical conversation and the target example are determined by a deep learning model, and the semantics of the historical conversation and the target example are spliced ​​to obtain the target prompt word, and the target prompt word also includes a first position identifier and a second position identifier pointing to the splicing position of the historical conversation and the target example. For example, there is a historical conversation M1 and a target example M2. The deep learning model determines the semantics of the historical conversation M1 to obtain M3, and determines the semantics of the target example M2 to obtain M4. M3 and M4 are spliced ​​to obtain the target prompt word. The target prompt word also includes a first position identifier b3 and a second position identifier b4, the first position identifier b3 points to the position of M3 in the spliced ​​content of M3 and M4, and the second position identifier b4 points to the position of M4 in the spliced ​​content of M3 and M4. Therefore, the target prompt word includes M3, M4, the first position identifier b3 and the second position identifier b4.

[0242] In another implementation of generating a target prompt word, a first indicator for indicating a position to be filled in with the historical conversation and a second indicator for indicating a position to be filled in with the target example are present in the preset template. After acquiring the preset template, the dialogue device determines the position indicated by the first indicator from the preset template as the first position, and determines the position indicated by the second indicator from the preset template as the second position. After determining the first position and the second position, the dialogue device fills the historical conversation into the first position of the preset template to obtain a reference prompt word, and then fills the target example into the reference prompt word to obtain a target prompt word.

[0243] It should be understood that, because in the preset template, the first indicator indicates the position where the historical conversation is filled in, and the second indicator indicates the position where the target example is filled in, after generating the target prompt word by filling the historical conversation and the target example into the preset template, the first indicator indicates the position of the historical conversation, and the second indicator indicates the position of the target example, that is, the first indicator is the first position indicator in the target prompt word, and the second indicator is the second position indicator in the target prompt word.

[0244] By generating the target prompt word according to the preset template, the positions of the historical conversation and the target example in the target prompt word can be fixed, and the dialogue device can determine the first position of the historical conversation in the target prompt word and the second position of the target example in the target prompt word according to the first position identifier and the second position identifier, respectively. When the first position and the second position are determined, the dialogue device can determine the historical conversation and the target example according to the first position and the second position. Compared with determining the historical conversation and the target example from the target prompt word through the semantics of the target prompt word, this can improve the accuracy of the historical conversation and the target example determined by the dialogue device, and can also reduce the complexity of the operation of the dialogue device in the process of processing the target prompt word, thereby reducing the consumption of resources of the language model in the dialogue device, reducing the time of processing the target prompt word, and improving the efficiency of the dialogue device in processing the target prompt word using the language model.

[0245] 303. Under the prompt of the above target example, the above target follow-up question is generated based on the above historical dialogue using the above language model.

[0246] In the embodiment of the present application, after the dialogue device uses the language model to determine the target example in the target prompt word, the dialogue device uses the language model to generate follow-up questions that the target object is interested in based on historical dialogues under the prompt of the target example, and obtains the target follow-up question.

[0247] When the prompt word includes the target example, the dialogue device can use the language model to obtain a prompt for generating a reference follow-up question related to the reference dialogue from the target example, and generate a target follow-up question based on the prompt. The target follow-up question generated by the above method is a follow-up question related to the historical dialogue.

[0248] In this embodiment, the dialogue device determines the second position identifier in the target prompt word using a language model, and then determines the target example in the target prompt word based on the second position identifier, wherein the target example includes a reference dialogue and a reference follow-up question related to the reference dialogue. Based on the second position identifier, an accurate target example is determined. After the dialogue device determines the second position identifier in the target prompt word, the position of the target example in the target prompt word can be determined according to the position indicated by the second position identifier, and the target example in the target prompt word can be accurately determined according to the content of the position indicated by the second position identifier, which is more accurate than determining the target example from the target prompt word through the semantics of the target prompt word. Under the instruction of the target example, the dialogue device generates a target follow-up question using a language model. After obtaining the target example, the dialogue device obtains a prompt for generating a reference follow-up question related to the reference dialogue from the target example using a language model. Under the guidance of the prompt, the language model determines that a follow-up question related to the dialogue should be generated, and generates a target follow-up question related to the historical dialogue. When the dialogue device generates a target follow-up question related to the historical dialogue, since the target object is interested in the topic of the historical dialogue, the probability that the topic of the target follow-up question is the topic of interest to the target object can be increased, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0249] As an optional implementation, the dialogue device performs the following steps during the process of executing step 102:

[0250] 4001. Get generation requirements.

[0251] In the embodiment of the present application, the generation requirements are the requirements that need to be met by the target follow-up questions generated by the dialogue device. By adding generation requirements to the target follow-up questions generated by the dialogue device, the possibility of the dialogue device generating follow-up questions that are irrelevant or have a low degree of relevance to the historical dialogue can be reduced, thereby ensuring that the target follow-up questions are relevant to the historical dialogue.

[0252] As an optional implementation, the generation requirements include one or more requirements, and the more requirements there are, the higher the relevance of the target follow-up questions generated by the dialogue device to the historical dialogue. The topic of the historical dialogue is the topic that the target object is interested in. Therefore, the higher the relevance of the historical dialogue to the target follow-up questions, the more similar the topic of the target follow-up questions is to the topic of the historical dialogue, and the higher the probability that the target object is interested in the topic of the target follow-up questions. For example, the generation requirements include: do not generate questions that the target object already knows the answer to or are irrelevant to the topic of the historical dialogue. For another example, the generation requirements include: generate very short and clear questions that the target object may ask the dialogue device, rather than questions that the dialogue device asks the target object. For another example, the generation requirements include: always generate extended questions that are only related to the last round of dialogue, and ensure that the difference between each question is large enough. For another example, the generated questions need to be extended from the content of the target object's last question, and also need to be extended from the content of the dialogue device's last answer. For another example, the generation requirements include: generate 3 follow-up questions each time, output in the form of an ordered list, and each follow-up question does not exceed 10 words. For another example, the generation requirement includes: if the target object's question involves a creative task, please give a follow-up question that adds a limiting requirement to the creative task. For another example, the generation requirement includes: if the dialogue device refuses to answer the target object's question, the dialogue device randomly asks 3 follow-up questions that are not related to the current question. For another example, the generated follow-up question is different from the question in the historical dialogue.

[0253] 4002. Based on the historical dialogue and the generation requirement, generate the target prompt word.

[0254] In an embodiment of the present application, the target prompt words are used to guide the language model to generate target follow-up questions based on historical conversations, and the generated target follow-up questions should meet generation requirements, wherein the target prompt words include historical conversations and generation requirements.

[0255] In the case where the target prompt word includes a generation requirement, the dialogue device can determine the requirements that need to be met for generating the follow-up question from the generation requirement. When the target follow-up question generated by the dialogue device meets the generation requirement, the possibility of the dialogue device generating a follow-up question that is irrelevant to the historical dialogue or has a low degree of relevance can be reduced, so that the generated target follow-up question is relevant to the historical dialogue. In addition, because the topic of the historical dialogue is the topic that the target object is interested in, the higher the degree of relevance between the historical dialogue and the target follow-up question, the higher the probability that the target object is interested in the topic of the target follow-up question.

[0256] See also Figure 3 , Figure 3 A schematic diagram of a target prompt word including generation requirements provided by this application. Figure 3The target prompt words shown contain generation requirements. Specifically, the generation requirements include: if you are a dialogue robot, consider the personality settings of the dialogue robot, the chat records between the object and the dialogue robot, think about the scene, intention, and background of the object's last question, and generate the questions that the object is most likely to ask the dialogue robot next. 1. Do not generate questions that the target object already knows the answer to or are irrelevant to the topic of the historical dialogue. 2. Generate very short and clear questions that the target object may ask the dialogue device, rather than questions that the dialogue device asks the target object. 3. Always generate extended questions that are only related to the last round of dialogue, and ensure that the difference between each question is large enough. 4. The generated questions need to be extended from the content of the target object's last question, and also need to be extended from the content of the dialogue device's last answer. The generation requirements also include additional requirements, including: 1. Generate 3 follow-up questions each time, output in the form of an ordered list, and each follow-up question does not exceed 10 words. 2. If the target object's question involves a creative task, please give a follow-up question that adds a limiting requirement for the creative task. 3. If the dialogue device refuses to answer the target object's question, the dialogue device randomly asks 3 follow-up questions that are not related to the current question. 4. The questions generated are different from those in historical dialogues.

[0257] In this embodiment, the dialogue device obtains the generation requirement, wherein the generation requirement is the requirement that the target follow-up question generated by the dialogue device needs to meet. After obtaining the generation requirement, the target prompt word is generated based on the historical dialogue and the generation requirement, and the generated target prompt word meets the generation requirement. The target prompt word generated by the dialogue device through the above steps can enable the dialogue device to determine the requirements that need to be met for generating the target follow-up question from the generation requirement in the target prompt word, and enable the dialogue device to use the language model to generate the target follow-up question based on the historical dialogue to meet the generation requirement. When the target follow-up question generated by the dialogue device meets the generation requirement, the possibility of the dialogue device generating follow-up questions that are irrelevant to the historical dialogue or have a low degree of relevance can be reduced, thereby ensuring that the target follow-up question is related to the historical dialogue. The topic of the historical dialogue is the topic that the target object is interested in. Therefore, the higher the degree of relevance between the historical dialogue and the target follow-up question, the more similar the topic of the target follow-up question is to the topic of the historical dialogue, and the higher the probability that the target object is interested in the topic of the target follow-up question, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0258] As an optional implementation, after acquiring the historical conversation, the target example, and the generation requirement, the dialogue device generates a target prompt word based on the historical conversation, the target example, and the generation requirement, wherein the target prompt word also includes a first position identifier indicating the position of the historical conversation in the target prompt word, and a second position identifier indicating the position of the target example in the target prompt word. After generating the target prompt word, the dialogue device uses a language model to determine the first position identifier and the second position identifier in the target prompt word, determines the position of the historical conversation in the target prompt word through the first position identifier, and determines the position of the target example in the target prompt word through the second position identifier. After determining the positions of the target example and the historical conversation in the target prompt word, the historical conversation and the target example are determined from the target prompt word.

[0259] The dialogue device uses a language model to obtain a prompt for generating a reference follow-up question related to the reference dialogue from the target example, and generates a target follow-up question based on the prompt. The target follow-up question generated by this method is a follow-up question related to the historical dialogue. The reason for the historical dialogue is that the target object is interested in the topic of the historical dialogue, so the target object, driven by interest, conducts a dialogue with the dialogue device based on the topic of the historical dialogue, thereby generating a historical dialogue with a topic that the target object is interested in. The dialogue device generates a target follow-up question related to the historical dialogue, which can increase the probability that the topic of the target follow-up question is a topic that the target object is interested in, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0260] At the same time, the dialogue device also uses the language model to determine the requirements that need to be met for generating follow-up questions from the generation requirements in the target prompt words, so that the target follow-up questions generated by the dialogue device based on the historical dialogue using the language model meet the generation requirements. When the dialogue device uses the target follow-up questions generated by the dialogue device to meet the generation requirements, the possibility of the dialogue device generating follow-up questions that are irrelevant to the historical dialogue or have a low degree of relevance can be reduced, so that the generated target follow-up questions are relevant to the historical dialogue. Because the topic of the historical dialogue is the topic of interest to the target object, the higher the degree of relevance between the historical dialogue and the target follow-up question, the higher the probability that the target object is interested in the topic of the target follow-up question.

[0261] After the dialogue device uses the language model to determine the prompts for generating reference follow-up questions related to the reference dialogue and the requirements for generating follow-up questions from the target examples and the generation requirements, the dialogue device generates target follow-up questions that meet the generation requirements based on the historical dialogue using the language model under the prompts of the target examples. As an optional implementation, the dialogue device performs the following steps during the execution of step 101:

[0262] 5001. Obtain the dialogue that has occurred between the target object and the dialogue device as a candidate dialogue.

[0263] In the embodiment of the present application, the candidate dialogue is the dialogue between the target object and the dialogue device, wherein the candidate dialogue is the dialogue of all rounds between the target object and the dialogue device. The historical dialogue is the dialogue of all rounds in the candidate dialogue, or the dialogue of part of the rounds.

[0264] 5002. When the number of rounds of dialogues included in the candidate dialogues is greater than or equal to n, the dialogues of n rounds with the largest timestamps in the candidate dialogues are taken as the historical dialogues.

[0265] In an embodiment of the present application, the number of rounds of conversation in the historical conversation is controlled to be less than or equal to n rounds, where n is a positive integer greater than 1.

[0266] On the one hand, when there is a topic of conversation before the last round of conversation between the target object and the dialogue device, and the target object wants to have a conversation on the topic of conversation in the last round of conversation, the text entered by the target object in the last round of conversation will omit the topic of conversation. For example, when the topic of conversation before the last round of conversation between the target object and the dialogue device is the food of region A, and the target object wants to have a conversation on the food of region A in the last round of conversation, the questions entered by the target object in the last round of conversation that omit the topic of conversation include: Where is the (food of region A) better? Can you introduce (food of region A) in detail? For questions that omit the topic of conversation, the dialogue device cannot determine the topic of the question, and thus cannot generate a target follow-up question related to the topic of the question. Therefore, in order to avoid the situation where the topic of the question cannot be determined due to the omission of the topic of conversation, and thus the follow-up question cannot be generated, the number of conversations in the historical conversation needs to be greater than 1. In the case where the number of conversations in the historical conversation is greater than 1, and the text entered by the target object in the last round of conversation omits the topic of conversation, the dialogue device can determine the topic of conversation from the conversation before the last round of conversation in the historical conversation.

[0267] On the other hand, in order to avoid too many conversation rounds in the historical conversation, which leads to too many conversation topics in the historical conversation and confusion in the conversation device's determination of the conversation topic using the language model, the number of conversation rounds in the historical conversation is controlled to be equal to n. By controlling the number of conversation rounds in the historical conversation, the length of the historical conversation can also be reduced, the reasoning efficiency of the language model can be improved, and the speed at which the conversation device determines the target follow-up question can be increased.

[0268] In the embodiment of the present application, when the number of rounds of dialogue in the candidate dialogue is greater than or equal to n, the dialogue with the largest timestamp in the candidate dialogue is taken as the historical dialogue. The timestamp of the candidate dialogue is the total number of seconds from Greenwich Mean Time, i.e., 8:0:00 on January 1, 1970, Beijing time, to the time when the dialogue occurred. Therefore, the larger the timestamp, the later the dialogue occurred, and the dialogue with the largest timestamp in the candidate dialogue is the dialogue with the latest n rounds of dialogue.

[0269] Since the target object's interest in the topic of the conversation will decrease over time, the target object's interest in the topic of the conversation with a smaller timestamp is less, and conversely, the target object's interest in the topic of the conversation with a larger timestamp is higher. By using the n rounds of conversations with the largest timestamps as the historical conversations as the basis for the conversation device to generate the target follow-up questions, the probability that the topic of the target follow-up question is the topic of interest to the target object can be increased, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0270] Optionally, when the conversations with the largest n rounds of timestamps in the candidate conversations are taken as historical conversations, and there are two or more topics in the conversations with the largest n rounds of timestamps, two or more follow-up questions are generated based on the two or more topics as target follow-up questions. Since for each round of conversations in the candidate conversations, the larger the timestamp, the higher the degree of interest of the target object in the topic of the round of conversations, the probability that the topic of the conversations with the largest n rounds of timestamps in the candidate conversations is the topic of interest to the target object is high. Therefore, when there are two or more different topics in the topics of the conversations with the largest n rounds of timestamps, two or more follow-up questions are generated based on the two or more topics as target follow-up questions, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object, and thus increase the probability that the target object selects the target follow-up question for follow-up.

[0271] Optionally, when two or more follow-up questions are generated based on two or more topics as target follow-up questions, all target follow-up questions are sorted in descending order of the timestamps of the conversations corresponding to the target follow-up questions, and the sorting results are displayed so that the target object can select the target follow-up questions of interest according to the sorting results. 5003. When the number of turns of the conversation included in the candidate conversation is less than n, the candidate conversation is used as the historical conversation.

[0272] In the embodiment of the present application, when the number of dialogue turns included in the candidate dialogue is less than n, the candidate dialogue is used as a historical dialogue. When the number of dialogue turns between the target object and the dialogue device is less than n, the dialogue device can also generate a target follow-up question based on all the dialogue turns between the target object and the dialogue device.

[0273] In this embodiment, after obtaining the candidate dialogue, the dialogue device determines the number of dialogue rounds in the candidate dialogue, wherein the candidate dialogue is a dialogue in which all rounds are generated between the target object and the dialogue device. When the number of dialogue rounds in the candidate dialogue is greater than or equal to n, the dialogue rounds with the largest timestamps in the candidate dialogue are taken as historical dialogues, wherein n is a positive integer greater than 1. By selecting n rounds of dialogue, it is possible to reduce the situation where, in the case of selecting a dialogue round, the dialogue device cannot determine the topic of the question due to the omission of the dialogue topic in the last round of the dialogue of the target object, thereby failing to generate the target follow-up question. It is also possible to reduce the situation where, in the case of selecting too many rounds of dialogue, there are too many dialogue topics in the historical dialogue, causing confusion in the dialogue device identifying the dialogue topic using the language model. It is also possible to reduce the length of the historical dialogue, improve the reasoning efficiency of the language model, and improve the speed of the dialogue device determining the target follow-up question. In order to reduce the situation where the target object's interest in the topic of the historical conversation will weaken as the conversation time goes by, resulting in the target object's low interest in the topic of the target follow-up question related to the historical conversation, the conversation with the largest timestamp is selected as the historical conversation, wherein the conversation with the largest timestamp is the conversation with the latest occurrence time. Therefore, the target object's interest in the topic of the historical conversation weakens less and the interest in the topic of the historical conversation is higher. The dialogue device generates target follow-up questions related to the historical conversation, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object, thereby increasing the probability that the target object selects the target follow-up question for follow-up. When the number of conversation rounds in the candidate conversation is less than n, the candidate conversation is taken as the historical conversation. So that when the number of conversation rounds between the target object and the conversation device is less than n, the conversation device can also generate target follow-up questions based on all the conversation rounds between the target object and the conversation device.

[0274] As an optional implementation, the generation requirement includes that the number of questions in the target follow-up questions generated by the dialogue device is m. The dialogue device performs the following steps during the execution of step 103:

[0275] 6001. Generate m alternative follow-up questions related to the above historical dialogue for the above target object using the above language model based on the above historical dialogue.

[0276] In an embodiment of the present application, the candidate follow-up questions are questions of interest generated by the dialogue device for the target object using a language model, and among the m candidate follow-up questions, any two candidate follow-up questions are different, where m is a positive integer greater than 1.

[0277] In a possible application scenario, among the m candidate follow-up questions, the number of words in any one of the candidate follow-up questions is less than x. By limiting the number of words in any one of the candidate follow-up questions, when the m candidate follow-up questions are presented to the target object as the target follow-up questions, the target object can quickly determine the information of the m candidate follow-up questions, thereby reducing the long time cost caused by the target object browsing the long text and improving the interactive experience between the target object and the dialogue device.

[0278] 6002. Use the m alternative follow-up questions as the target follow-up questions.

[0279] In this embodiment, by setting the number of questions in the target follow-up questions generated by the dialogue device to be m, there are m candidate follow-up questions in the target follow-up questions generated by the dialogue device, thereby meeting the above generation requirement. During the dialogue between the target object and the dialogue device, in order to guide the target object to have further dialogue with the dialogue device, the dialogue device can generate m candidate follow-up questions and provide them to the target object for selection, so that the target object can select the question that he is most interested in from the m candidate follow-up questions, thereby increasing the probability of the target object having further dialogue with the dialogue device.

[0280] In this embodiment, in order to avoid generating too many follow-up questions, which would cause the target object to spend a long time browsing all the follow-up questions, the number of alternative follow-up questions in the target follow-up question is limited to m, thereby reducing the time cost for the target object to browse the target follow-up questions. Optionally, when displaying the target follow-up questions to the target object, the dialogue device may increase the probability of displaying all the alternative follow-up questions in the target question on one display page, thereby reducing the probability of additional operation steps that may be required when the target object browses the target follow-up questions.

[0281] As an optional implementation, the generation requirement includes that, in the last round of the historical dialogue, when the subject of the text input by the target object does not comply with the preset provisions, the subject of the target follow-up question generated by the dialogue device complies with the preset provisions. It should be understood that the preset provisions are compliance provisions for determining the compliance of the subject of the text input by the target object. When the subject of the text input by the target object does not comply with the preset provisions, the subject of the text input by the target object is not compliant, so the dialogue device cannot generate the target follow-up question based on the subject of the text input by the target object. In this case, the subject of the target follow-up question generated by the dialogue device should comply with the preset provisions. When there is a preset content that cannot appear in the subject of the text input by the target object, the subject of the text input by the target object is determined as a subject that does not comply with the preset provisions. For example, when the subject of the text input by the target object promotes violent behavior, the subject of the text input by the target object is determined as a subject that does not comply with the preset provisions. For another example, when the subject of the text input by the target object uses insulting language, the subject of the text input by the target object is determined as a subject that does not comply with the preset provisions. For another example, when the subject of the text input by the target object promotes illegal behavior, the subject of the text input by the target object is determined as a subject that does not comply with the preset provisions.

[0282] The dialogue device performs the following steps during the execution of step 103:

[0283] 7001. Determine the text input by the target object from the last round of the historical dialogue to obtain the target text.

[0284] In the embodiment of the present application, the target text is the text input by the target object in the last round of the historical conversation.

[0285] 7002. When the subject of the target text does not meet the preset requirements, the language model is used to generate the target follow-up questions that meet the preset requirements.

[0286] In an embodiment of the present application, when the dialogue device determines the topic of the target text from the target text, and the topic of the target text does not meet the preset requirements, the dialogue device uses a language model to generate a target follow-up question that meets the preset requirements, and the topic of the generated target follow-up question is different from the topic of the target text.

[0287] In a possible implementation, when the subject of the target text does not conform to preset regulations, the dialogue device generates a target follow-up question based on a random subject using a language model, wherein the random subject is a subject that conforms to preset regulations.

[0288] In another possible implementation, when the topic of the target text does not meet the preset requirements and the topic of the penultimate round of dialogue in the historical dialogue meets the preset requirements, the dialogue device uses a language model to generate a target follow-up question based on the topic of the penultimate round of dialogue in the historical dialogue.

[0289] In this embodiment, the dialogue device uses the text input by the target object in the last round of the historical dialogue as the target text, and determines the subject of the target text. When the subject of the target text does not meet the preset regulations, the dialogue device uses the language model to generate target follow-up questions that meet the preset regulations. The dialogue device uses the preset regulations as a basis to determine whether the subject of the target text is compliant or not. When the subject of the target text meets the preset regulations, the subject of the target text is compliant. When the subject of the target text does not meet the preset regulations, the subject of the target text is not compliant, and therefore the dialogue device cannot generate follow-up questions based on the subject of the target text. In this case, the target follow-up questions generated by the dialogue device should meet the preset regulations.

[0290] Optionally, after the dialogue device generates a target follow-up question that meets the preset requirements for the target object, the target follow-up question can be displayed to the target object. If the target object selects the target follow-up question to ask, the dialogue device can guide the topic of the dialogue with the target object to a topic that meets the preset requirements, ensuring that the topic of the dialogue between the target object and the dialogue device is in compliance with the requirements.

[0291] As an optional implementation, the generation requirement includes that the follow-up question generated by the dialogue device is an extension of the topic of the last round of dialogue between the subject and the dialogue device. The dialogue device performs the following steps during the execution of step 103:

[0292] 8001. Utilizing the language model and based on the historical dialogue, generate the target follow-up question whose topic is an extension of the topic of the last round of dialogue in the historical dialogue.

[0293] In the embodiment of the present application, the subject of the target follow-up question generated by the dialogue device is an extension of the subject of the last round of dialogue in the historical dialogue, wherein the extension of the subject of the dialogue indicates that the subject of the target follow-up question is a refinement of the subject of the last round of dialogue in the historical dialogue. For example, when the subject of the last round of dialogue in the historical dialogue is movie B, the subject of the target follow-up question can be the director of movie B or other works of the director of movie B.

[0294] In a possible implementation, the dialogue device generates candidate follow-up questions based on the historical dialogue using a language model. After obtaining the candidate follow-up questions, the dialogue device determines the number of words that have appeared in both the related follow-up questions and the target dialogue, wherein the target dialogue is the last round of dialogue in the historical dialogue. When the number of words that have appeared in both the candidate follow-up questions and the target dialogue exceeds the vocabulary threshold, it indicates that the content of the candidate follow-up question has a high degree of similarity with the content of the target dialogue, and therefore the candidate follow-up question is determined to be an extension of the theme of the target dialogue, and the related follow-up question is used as the target follow-up question.

[0295] In another possible implementation, the dialogue device generates candidate follow-up questions based on historical dialogues using a language model, and determines the last round of dialogue in the historical dialogue to obtain a target dialogue, and determines the keywords of the target dialogue to obtain the target keywords. By determining the matching degree of the semantics of the candidate follow-up questions and the semantics of the target keywords. When the matching degree of the semantics of the candidate follow-up questions and the semantics of the target keywords is greater than or equal to the semantic threshold, the candidate follow-up questions are determined as the target follow-up questions. In this way, a target follow-up question based on the extension of the theme of the target dialogue is generated. In this implementation, when the matching degree of the semantics of the candidate follow-up questions and the semantics of the target keywords is less than the semantic threshold, the dialogue device determines that the theme of the candidate follow-up questions is not an extension of the theme of the target dialogue, and the dialogue device needs to regenerate the follow-up questions. The dialogue device uses the matching degree of the semantics of the relevant follow-up questions and the semantics of the theme of the target keywords as a judgment basis to obtain a target follow-up question with a matching degree greater than or equal to the semantic threshold. In this way, the generation of a target follow-up question that extends the theme of the target dialogue is achieved.

[0296] Optionally, the last round of dialogue in the historical dialogue includes the text input by the target object and the answer of the dialogue device, so the theme of the target follow-up question generated by the dialogue device can be an extension of the theme of the text input by the target object in the last round of dialogue, or an extension of the theme of the answer of the dialogue device in the last round of dialogue. For example, the last round of dialogue in the historical dialogue is dialogue s6, and dialogue s6 includes text s61 and answer s62. Text s61 includes: How is movie B? Answer s62 includes: Movie B is a thriller movie, with an online rating of 8.5, and is a movie worth watching. I will help you find out that the nearest cinema to you has movie B showing in the afternoon. If you want to buy a ticket, you can tell me. At this time, the target follow-up question can be an extension of text s61, such as, who is the male lead of movie B? The target follow-up question can also be an extension of answer s62, such as, what time is the screening time of movie B in the cinema?

[0297] In this embodiment, the dialogue device generates a target follow-up question based on the historical dialogue using a language model, wherein the subject of the target follow-up question is an extension of the subject of the last round of dialogue in the historical dialogue. The subject of the dialogue between the target object and the dialogue device is a subject that the target object is interested in, and the target follow-up question is generated by extending the subject of the last round of dialogue in the historical dialogue.

[0298] Optionally, the historical dialogue is generated because the target object is interested in the topic of the historical dialogue and thus has a dialogue with the dialogue device. When the dialogue device generates a target follow-up question for the target object that is an extension of the topic of the target dialogue, the target object has a higher probability of selecting the target follow-up question due to interest, thereby having a further dialogue with the dialogue device.

[0299] As an optional implementation, the generation requirement includes that when the text input by the target object in the last round of the historical dialogue is a creative text, the target follow-up question includes guiding the target object to input a description of a text with clear subject, the creative text is a text with a number of subjects greater than 1, and the number of subjects of the text with clear subject is 1. The dialogue device performs the following steps in the process of executing step 103:

[0300] 9001. Determine the text input by the target object from the last round of the historical dialogue to obtain the target text.

[0301] The implementation method of step 9001 is the same as that of step 7001 and will not be repeated here.

[0302] 9002. Determine the number of topics of the target text to obtain a target number.

[0303] 9003. When the above target number is greater than 1, the above target text is determined as the above creative text.

[0304] In the embodiment of the present application, the creative text is a text with a number of topics greater than 1. When the number of topics in the target text, that is, the target number, is greater than 1, the target text is a creative text.

[0305] 9004. In the case where the target text is the creative text, the language model is used to generate the target follow-up question including guiding the target object to input a description of the topic-specific text.

[0306] In the embodiment of the present application, when the number of topics in the target text is greater than 1, the target text is a creative text. When the dialogue device uses a language model to answer the creative text, in order to generate an answer including all topics in the creative text, the dialogue device generates a longer answer, which reduces the efficiency of the dialogue device in generating answers. When the target object browses the longer answer, the time cost consumed is high, which affects the experience of the target object.

[0307] In this embodiment, when the target text is a creative text, the target follow-up question generated by the dialogue device using the language model includes guiding the target object to input a description of a text with a clear theme, wherein the number of themes of the text with a clear theme is 1. When the dialogue device uses the language model to answer the text with a clear theme, the dialogue device generates an answer for one theme of the text with a clear theme, so that the dialogue device reduces the complexity of information processing by the dialogue device using the language model and improves the efficiency of the dialogue device in generating answers. The probability that the answer generated by the dialogue device for one theme is a long text is low, and the time cost consumed by the target object when browsing the answer is low, thereby improving the experience of the target object.

[0308] In a possible implementation scenario, the subject of the subject-specific text is one of the more than one subjects in the creative text. Because the target object, driven by interest, conducts a dialogue with the dialogue device on the more than one subject in the creative text, thereby generating the creative text, the more than one subject in the creative text is the subject that the target object is interested in. Therefore, the subject of the subject-specific text is one of the more than one subjects in the creative text, which can increase the probability that the subject of the subject-specific text is the subject that the target object is interested in.

[0309] In this implementation, the dialogue device uses the text input by the target object in the last round of the historical dialogue as the target text, and determines the number of topics of the target text. When the number of topics of the target text is greater than 1, it is determined to be a creative text. In the case where the target text is a creative text, a target follow-up question is generated that includes a description of the text that guides the target object to input a clear topic. The dialogue device uses the number of topics of the target text as a basis to determine whether the target text is a creative text. When the number of topics of the target text is greater than 1, the target text is a creative text. The dialogue device processes information on more than one topic in the creative text, so the efficiency of the generated answer is low. And if the answer generated by the dialogue device includes all topics in the creative text, the probability of the generated answer being longer is higher. The target object consumes a high time cost when browsing a longer answer, which affects the experience of the target object. In this case, the dialogue device generates a target follow-up question that guides the target object to input a description of the text that clearly defines the topic.

[0310] Optionally, after the dialogue device displays the target follow-up question that guides the target object to enter the description of the topic-clear text to the target object, if the target object selects the target follow-up question, that is, enters the description of the topic-clear text to ask a follow-up question, the dialogue device can generate an answer for one topic of the topic-clear text, reducing the complexity of processing information and improving the efficiency of the dialogue device in generating answers. In addition, the probability that the answer generated by the dialogue device for one topic is a long text is low, and the target object consumes less time cost when browsing the answer, thereby improving the experience of the target object.

[0311] As an optional implementation, the target prompt word includes a third position identifier, wherein the third position identifier is used to indicate the position of the last round of dialogue in the historical dialogue in the target prompt word. In this case, the dialogue device can determine the last round of dialogue in the historical dialogue from the target prompt word by performing the following steps: using a language model to determine the third position identifier from the target prompt word. Using a language model based on the third position identifier, determine the last round of dialogue in the historical dialogue from the target prompt word. In the case where the target prompt word includes the third position identifier, the language model can determine the last round of dialogue in the historical dialogue from the target prompt word based on the third position identifier, thereby improving the accuracy of the determined last round of dialogue.

[0312] Optionally, before executing step 7001, the dialogue device determines the last round of dialogue in the historical dialogue from the target prompt word by executing the above steps.

[0313] As an optional implementation, the third position identifier is used to indicate the beginning of the last round of dialogue in the historical dialogue in the target prompt word. In a possible implementation, the third position identifier is the third position text that describes the position of the last round of dialogue in the historical dialogue in the target prompt word. For example, the third position text is "The following is [the last round of dialogue]", then in the target prompt word, the content after the third position text is the last round of dialogue in the historical dialogue. At this time, the language model can determine that the content after the third position text is the last round of dialogue after determining the semantics of the third position text.

[0314] In this embodiment, the target prompt word includes a round separator, wherein the round separator is a separator of two adjacent rounds of dialogue in the historical dialogue. The dialogue device performs the following steps in the process of executing the step of "using the language model to determine the last round of dialogue in the historical dialogue from the target prompt word based on the third position identifier": using the language model to determine from the target prompt word that the content between the third position identifier and the last round separator is the last round of dialogue in the historical dialogue. Since the round separator is the separator of two adjacent rounds of dialogue in the historical dialogue, the round separator indicates the end of a round of dialogue. Therefore, the last round separator in the target prompt word indicates the end of the last round of dialogue in the historical dialogue. And because the third position identifier is used to indicate the beginning of the last round of dialogue in the historical dialogue in the target prompt word, the language model can determine that the content between the third position identifier and the last round separator is the last round of dialogue in the historical dialogue, thereby improving the accuracy of the determined last round of dialogue.

[0315] See also Figure 4 , Figure 4 A flowchart of another dialogue method provided in an embodiment of the present application. The dialogue method is performed by another dialogue device, wherein the dialogue device can be any electronic device that can execute the technical solution disclosed in the embodiment of the method of the present application. Optionally, the dialogue device can be one of the following: a computer, a server.

[0316] 401. The target object communicates with the dialogue device to generate a historical dialogue.

[0317] In the embodiment of the present application, the historical dialogue is the dialogue generated between the target object and the dialogue device.

[0318] 402. After the target object and the dialogue device finish a round of dialogue, the dialogue device displays target follow-up questions.

[0319] In the embodiment of the present application, the target follow-up question is a follow-up question generated by the dialogue device based on the historical dialogue that the target object is interested in. After the dialogue device displays the answer of the dialogue device in the last round of the historical dialogue to the target object, the dialogue device displays the target follow-up question to the target object.

[0320] In a possible implementation, the dialogue device generates the target follow-up question by using a language model based on historical dialogues. The specific implementation is the same as that of steps 101 to 103 and any of the embodiments thereof, and will not be described in detail here.

[0321] In a possible implementation, the dialogue device displays the target follow-up question to the target object through a chat box. When the target object is interested in the target follow-up question, the target object can select the chat box of the target follow-up question to ask the target follow-up question. Optionally, the target follow-up question includes one or more follow-up questions, so the dialogue device will also display one or more chat boxes to the target object. When the target object is interested in any of the target follow-up questions, the target object can select the chat box of the question of interest to ask the follow-up question.

[0322] In another possible implementation, the dialogue device embeds the target follow-up question into the answer of the last round of dialogue and displays it to the target object. For example, the questions of the target object in the last round of dialogue include: What fun places are nearby. The target answers generated by the dialogue device based on the target object's questions include: Place A is beautiful and fun. The target follow-up questions determined by the dialogue device include: What delicious food is nearby. When displaying the target answer to the target object, the dialogue device can fuse the target answer and the target follow-up question into a fused answer, and the fused answer includes: There is a place A with beautiful scenery nearby, and there are many delicious foods near place A. Do you want to know about it? After determining the fused answer, the dialogue device displays the fused answer as a combination of the target answer and the target follow-up question to the target object, and guides the target object to ask follow-up questions through normal dialogue, thereby improving the fluency of the dialogue and the interactive experience of the target object.

[0323] 403. When the target object selects the target follow-up question to ask, a target answer to the target follow-up question determined by using the language model is displayed to the target object.

[0324] In an embodiment of the present application, when the target object is interested in a target follow-up question and selects the target follow-up question in the dialogue device, the dialogue device generates a target answer to the target follow-up question using a language model and displays the target answer to the target object.

[0325] In the embodiment of the present application, the dialogue device conducts a dialogue with the target object and generates a historical dialogue. After the last round of dialogue in the historical dialogue ends, the dialogue device generates a target follow-up question for the target object based on the historical dialogue using a language model, wherein the target follow-up question is a follow-up question related to the historical dialogue. After the dialogue device obtains the target follow-up question using the language model, it displays the target follow-up question to the target object. After the target object is interested in the target follow-up question and selects the target follow-up question, the dialogue device generates a target answer to the target follow-up question using the language model, and displays the target answer generated by the dialogue device to the target object, completing the dialogue of this round of follow-up. Through the above steps, the dialogue device generates a target follow-up question related to the historical dialogue for the target object, and after the target object selects the target follow-up question, the dialogue device generates an answer to the target follow-up question for the target object using the language model, thereby completing the further dialogue between the target object and the dialogue device, reducing the time and energy investment of the target object in thinking about the follow-up question during the follow-up process, and improving the interactive experience between the target object and the dialogue device.

[0326] Figure 5 A flowchart of a conversation method provided in an embodiment of the present application. Specifically, the target object and the conversation device have more than one round of conversations. When the last round of conversation between the target object and the conversation device ends, the two rounds of conversations with the largest timestamps between the target object and the conversation device are taken as historical conversations. After determining the historical conversation, the conversation device uses a language model to generate target follow-up questions for the target object based on the historical conversation, wherein the target follow-up questions include 3 follow-up questions. In addition, the conversation device can use the language model to obtain a prompt for generating a reference follow-up question related to the reference conversation from the target example, and generate a target follow-up question related to the historical conversation based on the prompt. The conversation device can also use the language model to determine the requirements that need to be met for generating follow-up questions from the generation requirements. When the target follow-up question generated by the conversation device meets the generation requirements, the possibility of the conversation device generating follow-up questions that are irrelevant to the historical conversation or have a low degree of relevance can be reduced, thereby ensuring that the target follow-up question is related to the historical conversation. For example, the generation requirements include: understanding the scene and theme of the historical conversation. For another example, the generation requirement includes: the topic of the target follow-up question generated by the dialogue device may be an extension of the topic of the question of the target object in the last round of dialogue, or an extension of the topic of the answer of the dialogue device in the last round of dialogue. Optionally, the dialogue device may generate a target prompt word based on the historical dialogue, the target example, and the generation requirement. Under the guidance of the target prompt word, the dialogue device uses the language model to obtain a prompt for generating a reference follow-up question related to the reference dialogue from the target example, and generates a target follow-up question related to the historical dialogue based on the prompt, and the generated target follow-up question meets the generation requirement.

[0327] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0328] The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.

[0329] See also Figure 6 , Figure 6 This is a structural diagram of a dialogue device provided in an embodiment of the present application. The dialogue device 1 includes: an acquisition unit 11, a first generation unit 12, and a second generation unit 13. Among them:

[0330] An acquisition unit 11 is used to acquire the above historical conversations;

[0331] A first generating unit 12 is used to generate a target prompt word based on the historical dialogue, wherein the target prompt word is used to guide the language model to generate the target follow-up question based on the historical dialogue, and the language model is a model with natural language processing capability;

[0332] The second generating unit 13 is used to generate the target follow-up question based on the historical dialogue by using the language model under the guidance of the target prompt word.

[0333] In combination with any embodiment of the present application, the target prompt word includes a first position identifier; the first position identifier is used to indicate the position of the historical conversation in the target prompt word;

[0334] The second generating unit 13 is further used for:

[0335] Using the language model, determining the first position marker from the target prompt word;

[0336] Determining the historical dialogue from the target prompt word using the language model based on the first position identifier;

[0337] The target follow-up question is generated based on the historical dialogue using the language model.

[0338] In combination with any embodiment of the present application, the target prompt word includes a target example and a second position identifier; the target example is an example of a reference follow-up question related to the reference dialogue generated based on a reference dialogue, the reference dialogue is different from the historical dialogue, and the second position identifier is used to indicate the position of the target example in the target prompt word;

[0339] The second generating unit 13 is further used for:

[0340] Using the language model, determining the second position marker from the target prompt word;

[0341] Determine the target example from the target prompt word using the language model based on the second position identifier;

[0342] Prompted by the above target example, the above target follow-up question is generated based on the above historical dialogue using the above language model.

[0343] In combination with any embodiment of the present application, the first generating unit 12 is specifically used for:

[0344] Obtaining generation requirements, where the generation requirements are requirements that the target follow-up questions generated by the dialogue device need to meet;

[0345] Based on the above historical dialogue and the above generation requirements, the above target prompt words are generated, and the above target prompt words are used to guide the above language model to generate the above target follow-up questions that meet the above generation requirements based on the above historical dialogue.

[0346] In combination with any embodiment of the present application, the first generating unit 12 is specifically used for:

[0347] Obtaining a preset template, the preset template comprising a first indicator for indicating a position to be filled in with the historical conversation, and a second indicator for indicating a position to be filled in with the target example;

[0348] Determine the position indicated by the first indicator in the preset template as the first position;

[0349] Determine the position indicated by the second indicator in the preset template as the second position;

[0350] Fill the historical dialogue into the first position in the preset template to obtain a reference prompt word;

[0351] The target example is filled into the second position of the reference prompt word to obtain the target prompt word.

[0352] In conjunction with any embodiment of the present application, the generation requirement includes that, when the subject of the text input by the target object in the last round of the historical dialogue does not meet the preset requirement, the subject of the target follow-up question generated by the dialogue device meets the preset requirement;

[0353] The second generating unit 13 is specifically used for:

[0354] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0355] When the subject of the target text does not conform to the preset requirements, the language model is used to generate the target follow-up question that meets the preset requirements.

[0356] In combination with any embodiment of the present application, the target prompt word includes a third position identifier, and the third position identifier is used to indicate the position of the last round of dialogue in the historical dialogue in the target prompt word;

[0357] The second generating unit 13 is further used for:

[0358] Determining the third position marker from the target prompt word using the language model;

[0359] The language model is used to determine the last round of the historical dialogue from the target prompt word based on the third position identifier.

[0360] In combination with any embodiment of the present application, the third position identifier is used to indicate the beginning of the last round of dialogue in the historical dialogue in the target prompt word, and the target prompt word includes a first round separator, and the first round separator is a separator of two adjacent rounds of dialogue in the historical dialogue;

[0361] The second generating unit 13 is further used for:

[0362] The language model is used to determine from the target prompt word that the content between the third position marker and the last first round separator is the last round of the historical dialogue.

[0363] In combination with any embodiment of the present application, the generation requirement includes that the topic of the target follow-up question generated by the dialogue device is an extension of the topic of the last round of dialogue in the historical dialogue;

[0364] The second generating unit 13 is specifically used for:

[0365] The language model is used to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue.

[0366] In combination with any embodiment of the present application, the second generating unit 13 is further configured to:

[0367] Extract the last round of dialogue from the above historical dialogues to obtain the target dialogue;

[0368] Extracting keywords from the target conversation to obtain target keywords;

[0369] Generate candidate follow-up questions based on the historical conversation using the language model;

[0370] When the degree of matching between the semantics of the candidate follow-up question and the semantics of the target keyword is greater than or equal to a semantic threshold, the candidate follow-up question is determined to be the target follow-up question.

[0371] In conjunction with any embodiment of the present application, the generation requirement includes that, in the case where the text input by the target object in the last round of the historical dialogue is a creative text, the target follow-up question includes guiding the target object to input a description of a text with clear subject, the creative text is a text with a number of subjects greater than 1, and the number of subjects of the text with clear subject is 1;

[0372] The second generating unit 13 is specifically used for:

[0373] Determining the text input by the target object from the last round of the historical dialogue to obtain the target text;

[0374] Determine the number of topics in the target text to obtain a target number;

[0375] When the above target number is greater than 1, the above target text is determined as the above creative text;

[0376] In the case where the target text is the creative text, the language model is used to generate the target follow-up question including guiding the target object to input a description of the subject-specific text.

[0377] In an embodiment of the present application, when a dialogue device generates a historical dialogue with a target object, the dialogue device generates a target prompt word based on the historical dialogue, wherein the target prompt word is used to guide the language model to generate a target follow-up question related to the historical dialogue based on the historical dialogue. Because the historical dialogue is a dialogue generated by the target object and the dialogue device based on the topic of the historical dialogue driven by interest, the topic of the historical dialogue is the topic of interest to the target object. After generating the target prompt word, the dialogue device can use the target prompt word to guide the language model to generate a target follow-up question based on the historical dialogue. Since the topic of the historical dialogue is the topic of interest to the target object, the dialogue device generates a target follow-up question related to the historical dialogue, which can increase the probability that the topic of the target follow-up question is the topic of interest to the target object, thereby increasing the probability that the target object selects the target follow-up question for follow-up.

[0378] In a possible scenario, after the dialogue device generates a target follow-up question for the target object, it displays the target follow-up question to the target object. After the target object receives the target follow-up question displayed by the dialogue device, it selects the target follow-up question to ask. After receiving the target object's request to select the target follow-up question to ask, the dialogue device generates an answer to the question based on the target follow-up question, and displays the generated answer to the target object, thereby realizing further dialogue between the target object and the dialogue device, reducing the time and energy invested by the target object in thinking about the follow-up question, and improving the interactive experience between the target object and the dialogue device.

[0379] See also Figure 7 , Figure 7 This is a structural diagram of another dialogue device provided in an embodiment of the present application. The dialogue device 2 includes: an acquisition unit 21, a display unit 22, and an answering unit 23. Among them:

[0380] An acquisition unit 21 is used for the target object to have a conversation with the conversation device to generate a historical conversation;

[0381] A display unit 22, configured to display a target follow-up question on the dialogue device after the target object and the dialogue device finish a round of dialogue, wherein the target follow-up question is a follow-up question generated by the dialogue device for the target object and related to the historical dialogue;

[0382] The answering unit 23 is used for displaying a target answer to the target follow-up question determined by using the language model to the target object when the target object selects the target follow-up question to ask.

[0383] In the embodiment of the present application, the dialogue device conducts a dialogue with the target object and generates a historical dialogue. After the last round of dialogue in the historical dialogue ends, the dialogue device generates a target follow-up question for the target object based on the historical dialogue using a language model, wherein the target follow-up question is a follow-up question related to the historical dialogue. After the dialogue device obtains the target follow-up question using the language model, it displays the target follow-up question to the target object. After the target object is interested in the target follow-up question and selects the target follow-up question, the dialogue device generates a target answer to the target follow-up question using the language model, and displays the target answer generated by the dialogue device to the target object, completing the dialogue of this round of follow-up. Through the above steps, the dialogue device generates a target follow-up question related to the historical dialogue for the target object, and after the target object selects the target follow-up question, the dialogue device generates an answer to the target follow-up question for the target object using the language model, thereby completing the further dialogue between the target object and the dialogue device, reducing the time and energy investment of the target object in thinking about the follow-up question during the follow-up process, and improving the interactive experience between the target object and the dialogue device.

[0384] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0385] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device 3 includes a processor 31 and a memory 32. Optionally, the electronic device 3 also includes an input device 33 and an output device 34. The processor 31, the memory 32, the input device 33 and the output device 34 are coupled via a connector, and the connector includes various interfaces, transmission lines or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.

[0386] The processor 31 may include one or more processors, for example, one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Optionally, the processor 31 may be a processor group consisting of multiple CPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present application.

[0387] The memory 32 can be used to store computer program instructions and various computer program codes including the program code for executing the program code of the present application. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0388] The input device 33 is used to input data and / or signals, and the output device 34 is used to output data and / or signals. The input device 33 and the output device 34 can be independent devices or an integrated device.

[0389] It can be understood that in the embodiment of the present application, the memory 32 can be used not only to store relevant instructions, but also to store relevant data. For example, the memory 32 can be used to store historical conversations obtained through the input device 33, or the memory 32 can also be used to store target follow-up questions generated by the processor 31, etc. The embodiment of the present application does not limit the specific data stored in the memory.

[0390] Understandably, Figure 8 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of the present application are within the protection scope of the present application.

[0391] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0392] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0393] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0394] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0395] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0396] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0397] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. A conversation method, characterized in that: The method is applied to a dialogue device, and is used to generate a target follow-up question related to the historical dialogue for the target object when the dialogue device has generated a historical dialogue with the target object. The method includes: Obtain the historical conversation; Based on the historical conversation, a target prompt word is generated, wherein the target prompt word is used to guide a language model to generate the target follow-up question based on the historical conversation, and the language model is a model with natural language processing capability; Under the guidance of the target prompt word, the target follow-up question is generated based on the historical dialogue using the language model.

2. The method according to claim 1, characterized in that The target prompt word includes a first position identifier, and the first position identifier is used to indicate the position of the historical conversation in the target prompt word; The step of generating the target follow-up question based on the historical dialogue using the language model under the guidance of the target prompt word includes: Determining the first position identifier from the target prompt word using the language model; Determining the historical conversation from the target prompt word based on the first position identifier using the language model; The target follow-up question is generated based on the historical dialogue using the language model.

3. The method according to claim 1 or 2, characterized in that: The target prompt word includes a target example and a second position identifier, the target example is an example of a reference follow-up question related to the reference dialogue generated based on a reference dialogue, the reference dialogue is different from the historical dialogue, and the second position identifier is used to indicate the position of the target example in the target prompt word; The step of generating the target follow-up question based on the historical dialogue using the language model includes: Determining the second position identifier from the target prompt word using the language model; Determining the target example from the target prompt word using the language model based on the second position identifier; Under the prompt of the target example, the target follow-up question is generated based on the historical dialogue using the language model.

4. The method according to claim 3, characterized in that The generating of target prompt words based on the historical dialogue includes: Acquire a preset template, wherein the preset template includes a first indicator mark for indicating a position to be filled in with the historical conversation, and a second indicator mark for indicating a position to be filled in with the target example; Determine, in the preset template, a position indicated by the first indicator as a first position; Determine, in the preset template, a position indicated by the second indicator as a second position; Filling the historical dialogue into the first position in the preset template to obtain a reference prompt word; The target example is filled into the second position of the reference prompt word to obtain the target prompt word.

5. The method according to claim 1 or 2, characterized in that: The generating of target prompt words based on the historical dialogue includes: Acquire generation requirements, where the generation requirements are requirements that the target follow-up questions generated by the dialogue device need to meet; Based on the historical dialogue and the generation requirement, the target prompt word is generated, and the target prompt word is used to guide the language model to generate the target follow-up question that meets the generation requirement based on the historical dialogue.

6. The method according to claim 5, characterized in that The generation requirement includes that when the subject of the text input by the target object in the last round of the historical dialogue does not meet the preset requirement, the subject of the target follow-up question generated by the dialogue device meets the preset requirement; The step of using the language model to generate the target follow-up question based on the historical dialogue includes: Determining the text input by the target object from the last round of the historical dialogue to obtain the target text; When the subject of the target text does not meet the preset requirements, the language model is used to generate the target follow-up question that meets the preset requirements.

7. The method according to claim 6, characterized in that The target prompt word includes a third position identifier, and the third position identifier is used to indicate the position of the last round of dialogue in the historical dialogue in the target prompt word; Before determining the text input by the target object in the last round of the historical dialogue to obtain the target text, the method further includes: Determining the third position marker from the target prompt word using the language model; The language model is used to determine the last round of the historical dialogue from the target prompt word based on the third position identifier.

8. The method according to claim 7, characterized in that The third position marker is used to indicate the beginning of the last round of the conversation in the historical conversation in the target prompt word, and the target prompt word includes a first round separator, and the first round separator is a separator between two adjacent rounds of conversation in the historical conversation; The step of using the language model to determine the last round of the historical dialogue from the target prompt word based on the third position identifier includes: The language model is used to determine from the target prompt word that the content between the third position marker and the last first round separator is the last round of the historical dialogue.

9. The method according to claim 5, characterized in that The generation requirement includes that the subject of the target follow-up question generated by the dialogue device is an extension of the subject of the last round of dialogue in the historical dialogue; The step of using the language model to generate the target follow-up question based on the historical dialogue includes: The language model is used to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue.

10. The method according to claim 9, characterized in that The step of using the language model to generate the target follow-up question based on the historical dialogue, the topic of which is an extension of the topic of the last round of dialogue in the historical dialogue, includes: Extracting the last round of dialogue from the historical dialogue to obtain a target dialogue; Extracting keywords of the target conversation to obtain target keywords; Generate candidate follow-up questions based on the historical conversation using the language model; When the degree of matching between the semantics of the candidate follow-up question and the semantics of the target keyword is greater than or equal to a semantic threshold, the candidate follow-up question is determined to be the target follow-up question.

11. The method according to claim 5, characterized in that The generation requirement includes that, in the case where the text input by the target object in the last round of the historical dialogue is a creative text, the target follow-up question includes guiding the target object to input a description of a text with clear subject, the creative text is a text with a number of subjects greater than 1, and the number of subjects of the text with clear subject is 1; The step of generating the target follow-up question based on the historical dialogue using the language model includes: Determining the text input by the target object from the last round of the historical dialogue to obtain the target text; Determine the number of topics in the target text to obtain a target number; When the target number is greater than 1, determining the target text as the creative text; In the case where the target text is the creative text, the language model is used to generate the target follow-up question including a description for guiding the target object to input the subject-specific text.

12. A conversation method, characterized in that: The method is applied to a dialogue device, and the method comprises: The target object conducts a dialogue with the dialogue device to generate a historical dialogue; After the target object and the dialogue device finish a round of dialogue, the dialogue device displays a target follow-up question, where the target follow-up question is a follow-up question generated by the dialogue device for the target object and is related to the historical dialogue; In a case where the target object selects the target follow-up question to ask, a target answer to the target follow-up question determined by using the language model is displayed to the target object.

13. A conversation device, characterized in that: When the dialogue device and the target object have had a historical dialogue, a target follow-up question related to the historical dialogue is generated for the target object, and the dialogue device includes: An acquisition unit, used for acquiring the historical conversation; A first generating unit is configured to generate a target prompt word based on the historical dialogue; the target prompt word is used to guide a language model to generate the target follow-up question based on the historical dialogue, and the language model is a model with natural language processing capabilities; The second generating unit is used to generate the target follow-up question based on the historical dialogue by using the language model under the guidance of the target prompt word.

14. A conversation device, characterized in that: The dialogue device comprises: An acquisition unit, used for the target object to have a dialogue with the dialogue device and generate a historical dialogue; A display unit, configured to display a target follow-up question on the dialogue device after the target object and the dialogue device finish a round of dialogue, wherein the target follow-up question is a follow-up question generated by the dialogue device for the target object and related to the historical dialogue; An answering unit is used to display a target answer to the target follow-up question determined by using the language model to the target object when the target object selects the target follow-up question.

15. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as claimed in any one of claims 1 to 11, or the electronic device executes the method as claimed in claim 12.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 11, or the processor executes the method according to claim 12.

17. A computer program product, characterized in that The computer program product includes a computer program or instructions; when the computer program or instructions are run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 11, and the computer may execute the method according to claim 12.