Dialogue method, virtual character dialogue method and related products

By obtaining the speech and dialogue context of the target object, determining the topic based on attributes and generating related replies, the problem of low interest rate of reply in traditional methods is solved, and the interactive experience is improved.

CN120448496APending Publication Date: 2025-08-08SHUXING TECH (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510558285.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional methods determine that the object's response is low chance of interest, resulting in poor interaction experience.

Method used

By obtaining the target object's speech and dialogue context, combining the target object's properties, identify relevant topics, and generate replies related to the topic.

Benefits of technology

It increases the chance of the target object being interested in reply and improves the interactive experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448496A_ABST
    Figure CN120448496A_ABST
Patent Text Reader

Abstract

The invention discloses a dialogue method, a virtual character dialogue method and a related product. The dialogue method is applied to the dialogue device and comprises the steps that a first speech of a target object in a target dialogue is acquired, and the target dialogue comprises a dialogue between the target object and a target role; the target conversation includes a conversation context prior to the first utterance. And determining a first topic based on at least one of the first speech, the attribute of the target object and the dialogue context. And generating a target reply of the target role to the first speech based on the first topic, wherein the target reply is related to the first topic. The target reply of the first speech of the target object is generated based on the dialogue method, the probability that the target object is interested in the target reply can be improved, and then the dialogue experience of the target object is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In today's digital age, dialogue systems, as a key technology for human-computer interaction, are widely used in a variety of fields, including intelligent customer service, intelligent assistants, and virtual chatbots, providing convenient and efficient interactive services. However, traditional methods for determining responses to a subject's speech often result in a low probability of the target subject showing interest in the response. Summary of the Invention

[0003] The present application provides a dialogue method, a virtual character dialogue method and related products to increase the probability of a target object being interested in a target reply, wherein the related products include a dialogue device, a virtual character 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, which is applied to a conversation device and includes:

[0005] Obtaining a first speech of a target object in a target dialogue, wherein the target dialogue includes a dialogue between the target object and a target character; the target dialogue includes a dialogue context before the first speech;

[0006] Determining a first topic based on at least one of the first speech, the attribute of the target object, and the conversation context;

[0007] A target reply of the target role to the first speech is generated based on the first topic, and the target reply is related to the first topic.

[0008] In combination with any embodiment of the present application, determining the first topic based on at least one of the first speech, the attribute of the target object, and the conversation context includes:

[0009] A first topic is determined based on the attributes of the target object and a conversation context, where the conversation context is related to a second topic, and the first topic is different from the second topic.

[0010] In combination with any embodiment of the present application, determining the first topic based on at least one of the first speech, the attribute of the target object, and the conversation context includes:

[0011] A first topic is obtained based on the first speech of the target object.

[0012] In combination with any embodiment of the present application, the method further includes:

[0013] Based on the first statement and / or the conversation context of the first statement, a target reply to the first statement is generated.

[0014] In combination with any embodiment of the present application, after obtaining the first speech of the target object in the target conversation, the method further includes:

[0015] Based on the first speech and / or the conversation context, the intention of the target object is determined, and the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, implicit retrieval intention; the intention of the target object is used to select one of the following to generate the target reply: based on the attributes of the target object and the conversation context, determine the first topic; based on the first speech of the target object, obtain the first topic; based on the first speech and / or the conversation context of the first speech, generate a target reply to the first speech.

[0016] In combination with any embodiment of the present application, generating a target reply to the first speech based on the first topic includes:

[0017] Based on the first topic, retrieve at least one first search result from a database;

[0018] The target reply to the first statement is generated based on the at least one first search result and the first topic.

[0019] In combination with any embodiment of the present application, generating the target reply to the first speech based on the at least one first search result and the first topic includes:

[0020] Obtaining first summary content based on content related to the first topic in the at least one first search result;

[0021] The target reply is obtained based on the first summary content and / or the conversation context of the first speech.

[0022] In combination with any embodiment of the present application, the method further includes:

[0023] When the target activity of the target object is less than or equal to a first threshold, the initial speech of the target dialogue is sent by the target character. The target activity is the activity of the target object in the dialogue between the target object and the target character.

[0024] In conjunction with any embodiment of the present application, the initial speech is obtained by the following steps: determining a third topic for conversation with the target object based on the attributes of the target object;

[0025] Based on the third topic, the initial speech is generated, where the initial speech is related to the third topic.

[0026] In combination with any embodiment of the present application, generating the initial speech based on the third topic includes:

[0027] Based on the third topic, retrieve at least one second search result from the database;

[0028] The initial speech is generated based on the at least one second search result and the third topic.

[0029] In combination with any embodiment of the present application, the target activity of the target object is determined based on at least one of the following: the frequency of conversations between the target object and the target character, and the duration of no conversation between the target object and the target character.

[0030] In combination with any embodiment of the present application, the method further includes:

[0031] Based on the target conversation, attributes of the target object are updated.

[0032] In combination with any embodiment of the present application, at least one of the first topic, the target reply, the intention of the target object, the third topic, and the initial speech is obtained by a language model based on corresponding instructions.

[0033] In a second aspect, a virtual character dialogue method is provided, the method comprising:

[0034] Obtaining a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character; the target dialogue includes a dialogue context before the first speech;

[0035] Determining a first topic based on at least one of the first speech, the attribute of the target object, and the conversation context;

[0036] A target reply of the virtual character to the first speech is generated based on the first topic, where the target reply is related to the first topic.

[0037] In combination with any embodiment of the present application, generating, based on the first topic, a target reply of the virtual character to the first speech includes:

[0038] The target reply is generated based on the first topic, the attributes and / or schedule of the virtual character.

[0039] According to a third aspect, a conversation device is provided, comprising:

[0040] an acquisition unit, configured to acquire a first speech of a target object in a target dialogue, wherein the target dialogue includes a dialogue between the target object and a target character; and the target dialogue includes a dialogue context before the first speech;

[0041] a determining unit, configured to determine a first topic based on at least one of the first speech, an attribute of the target object, and a conversation context;

[0042] A generating unit is configured to generate a target reply of the target role to the first speech based on the first topic, wherein the target reply is related to the first topic.

[0043] In combination with any embodiment of the present application, the determining unit is further configured to:

[0044] A first topic is determined based on the attributes of the target object and a conversation context, where the conversation context is related to a second topic, and the first topic is different from the second topic.

[0045] In combination with any embodiment of the present application, the determining unit is further configured to:

[0046] A first topic is obtained based on the first speech of the target object.

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

[0048] Based on the first statement and / or the conversation context of the first statement, a target reply to the first statement is generated.

[0049] In combination with any embodiment of the present application, the determining unit is further configured to:

[0050] Based on the first speech and / or the conversation context, the intention of the target object is determined, and the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, implicit retrieval intention; the intention of the target object is used to select one of the following to generate the target reply: based on the attributes of the target object and the conversation context, determine the first topic; based on the first speech of the target object, obtain the first topic; based on the first speech and / or the conversation context of the first speech, generate a target reply to the first speech.

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

[0052] Based on the first topic, retrieve at least one first search result from a database;

[0053] The target reply to the first statement is generated based on the at least one first search result and the first topic.

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

[0055] Obtaining first summary content based on content related to the first topic in the at least one first search result;

[0056] The target reply is obtained based on the first summary content and / or the conversation context of the first speech.

[0057] In combination with any embodiment of the present application, when the target activity of the target object is less than or equal to a first threshold, the initial speech of the target dialogue is sent by the target character, and the target activity is the activity of the target object in the dialogue between the target object and the target character.

[0058] In conjunction with any embodiment of the present application, the initial speech is obtained by the following steps: determining a third topic for conversation with the target object based on the attributes of the target object;

[0059] Based on the third topic, the initial speech is generated, where the initial speech is related to the third topic.

[0060] In combination with any embodiment of the present application, generating the initial speech based on the third topic includes:

[0061] Based on the third topic, retrieve at least one second search result from the database;

[0062] The initial speech is generated based on the at least one second search result and the third topic.

[0063] In combination with any embodiment of the present application, the target activity of the target object is determined based on at least one of the following: the frequency of conversations between the target object and the target character, and the duration of no conversation between the target object and the target character.

[0064] In combination with any embodiment of the present application, the dialogue device further includes: an updating unit, configured to update the attributes of the target object based on the target dialogue.

[0065] In combination with any embodiment of the present application, at least one of the first topic, the target reply, the intention of the target object, the third topic, and the initial speech is obtained by a language model based on corresponding instructions.

[0066] In a fourth aspect, a virtual character dialogue device is provided, the virtual character dialogue device comprising:

[0067] an acquisition unit, configured to acquire a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character; and the target dialogue includes a dialogue context before the first speech;

[0068] a determining unit, configured to determine a first topic based on at least one of the first speech, an attribute of the target object, and a conversation context;

[0069] A generating unit is configured to generate a target reply of the virtual character to the first speech based on the first topic, wherein the target reply is related to the first topic.

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

[0071] The target reply is generated based on the first topic, the attributes and / or schedule of the virtual character.

[0072] 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 one of its embodiments, or the electronic device executes the technical solution of the above-mentioned second aspect.

[0073] In the sixth aspect, another electronic device is provided, including: 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 implementation method thereof, or the electronic device executes the technical solution of the second aspect.

[0074] In the seventh aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the above-mentioned first aspect and any implementation method thereof, or the processor is caused to execute the technical solution of the above-mentioned second aspect.

[0075] In an eighth aspect, a computer program product is provided, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer is enabled to execute the above-mentioned first aspect and any implementation manner thereof, or the computer is enabled to execute the technical solution of the above-mentioned second aspect.

[0076] 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.

[0077] In an embodiment of the present application, the target conversation includes a conversation between a target object and a target character, wherein the target conversation includes a first speech and the conversation context preceding the first speech. After obtaining the target object's first speech in the target conversation, the conversation device determines a first topic for the target character to engage in conversation with the target object after the first speech based on at least one of the first speech, the target object's attributes, and the conversation context, thereby increasing the probability that the target object will be interested in the first topic. A target reply related to the first topic for the first speech is then generated based on the first topic, thereby increasing the probability that the target object will be interested in the target reply. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] 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.

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

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

[0081] Figure 2 A flowchart of a virtual character dialogue method provided in an embodiment of the present application;

[0082] Figure 3a A schematic diagram of a virtual character dialogue implemented by a traditional method provided in an embodiment of the present application;

[0083] Figure 3b The embodiment of the present application provides a method based on Figure 2 A schematic diagram of a virtual character dialogue implemented by the virtual character dialogue method;

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

[0085] Figure 5 A schematic diagram of the structure of a virtual character dialogue device provided in an embodiment of the present application;

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

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

[0088] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0089] It should be understood that, in this application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three or more, and "and / or" is used to describe the relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist, where A and B can be singular or plural. The character " / " can indicate that the associated objects are in an "or" relationship, referring to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or plural. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.

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

[0091] Before introducing the embodiments of the present application, the terms that appear in the embodiments of the present application are first introduced.

[0092] 1. Prompt: This refers to the text or instructions that provide input to the language model to instruct it to generate a specific output.

[0093] 2. Language model refers to a model with natural language processing (NLP) capabilities.

[0094] The embodiment of the present application is performed by a 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.

[0095] It should be understood that the method embodiment of the present application can also be implemented by a processor executing 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.

[0096] 101. Obtain a first speech of a target object in a target dialogue, wherein the target dialogue includes a dialogue between the target object and a target character, and the target dialogue includes a dialogue context before the first speech.

[0097] In an embodiment of the present application, the target object can be any object. In one possible implementation, the target object is the object that has a conversation with the target character, wherein the target character can be any virtual character, and the virtual character is a character image created and simulated by means of computer technology, artificial intelligence, etc. For example, the target character is a virtual pet, and the target object is the object that adopts the virtual pet, wherein the virtual pet is a virtual animal based on artificial intelligence technology, which accompanies humans in their daily lives by simulating the behavior and expressions of real pets. The target object can realize a conversation with the target character by having a conversation with the virtual pet. For another example, the target character is a virtual character, and the target object can realize a conversation with the dialogue device by having a conversation with the virtual character, wherein the virtual character is a character image created and simulated by means of computer technology, artificial intelligence technology, etc. For another example, the target character includes customer service, and the target object can realize a conversation with the target character by having a conversation with the customer service.

[0098] The target conversation includes the conversation between the target subject and the target character, and the target conversation also includes the conversation context before the first speech. That is, the target conversation includes the conversation between the target subject and the target character before the first speech. For example, the target conversation includes the target subject making speech a, the target character making reply b to speech a, and the target subject making speech c in response to reply b. If speech c is the first speech, then speech a and reply b constitute the conversation context before the first speech.

[0099] The target conversation's speech includes messages output by any dialog character through any means, where dialog characters include the target object and the target character. For example, the target object's speech in the conversation can be a message output by the target object via text. In another example, the target object's speech in the conversation can be a message output by the target object via voice. In another example, the target object's speech in the conversation can be a message output by the target object via image. In another example, the target object's speech in the conversation can be a message output by the target object via video.

[0100] In a possible implementation, the target character runs a virtual pet, and the target dialogue includes a dialogue between the target object and the virtual pet.

[0101] In another possible implementation, the target conversation includes the most recent conversation between the target object and the target character. Optionally, the time interval between two adjacent speeches in the same conversation is less than or equal to the duration threshold, and the time interval between any two speeches in different conversations is greater than the duration threshold. For example, the target object makes speech a at time t1, the target character makes speech b at time t2, the target object makes speech c at time t3, and the target character makes speech d at time t4. If t1 is earlier than t2, t2 is earlier than t3, and t3 is earlier than t4, and the duration between t1 and t2 is less than or equal to the duration threshold, the duration between t2 and t3 is greater than the duration threshold, and the duration between t3 and t4 is less than or equal to the duration threshold, then speech a and speech b belong to the same conversation, speech c and speech d belong to the same conversation, and speech b and speech c belong to different conversations.

[0102] Optionally, the first speech is the latest speech produced by the target object in the target dialogue.

[0103] In an implementation method of obtaining a first speech of a target object in a target conversation, the target character receives the first speech input by a user through an input component, wherein the input component includes: a keyboard, a mouse, a touch screen, a touchpad, and an audio input device.

[0104] In another implementation of obtaining the first speech of the target object in the target conversation, the target role receives the first speech sent by a terminal, where the terminal includes: a mobile phone, a computer, a tablet computer, and a server.

[0105] In another implementation of obtaining the first speech of the target object in the target dialogue, after obtaining the target dialogue, the target role takes the latest speech produced by the target object in the target dialogue as the first speech.

[0106] 102. Determine a first topic based on at least one of the first speech, attributes of the target object, and the conversation context.

[0107] In the embodiment of the present application, the first topic is the topic of the conversation between the target character and the target object after the first speech.

[0108] In this embodiment of the present application, the target object's attributes include at least one of the following: the target object's interests, the target object's occupation, the target object's age, and the target object's gender. The target object's attributes facilitate determining topics of interest to the target object. Therefore, the dialogue device determines a third topic for conversation with the target object based on the target object's attributes, thereby increasing the probability that the target object will be interested in the third topic. Based on the third topic, the dialogue device then generates a second speech related to the third topic and outputs the second speech to the target object. This can increase the target object's activity in the conversation with the dialogue device, thereby increasing the target object's interest in the conversation with the dialogue device.

[0109] Optionally, the attributes of the target object include the interests of the target object, and the dialogue device determines the interests of the target object as the third topic.

[0110] Optionally, the attributes of the target object are obtained based on a conversation between the target object and the dialogue device. For example, in a conversation between the target object and the dialogue device, the target object mentions that he likes playing basketball, so it can be determined that the target object's interests include basketball.

[0111] Optionally, the attributes of the target object include a portrait of the target object.

[0112] It should be understood that if the attributes of the target object involve the personal information of the target object, the personal information involved in the object embedding is obtained when the target object has authorized the use of the personal information.

[0113] The dialogue device determines the first topic based on at least one of the first speech, the attributes of the target object, and the dialogue context. The first topic may be determined based on any one of the first speech, the attributes of the target object, and the dialogue context. In one possible implementation, the dialogue device determines the first topic based on the first speech. Optionally, the dialogue device inputs the first speech into a language model to obtain the first topic output by the language model. Optionally, the language model includes a large language model (LLM). In another possible implementation, the dialogue device determines the first topic based on the attributes of the target object. Optionally, the dialogue device inputs the attributes of the target object into the language model to obtain the first topic output by the language model. In yet another possible implementation, the dialogue device determines the first topic based on the dialogue context. Optionally, the dialogue device inputs the dialogue context into the language model to obtain the first topic output by the language model.

[0114] The dialogue device determines the first topic based on at least one of the first statement, the attributes of the target object, and the conversation context. The first topic may be determined based on any two of the first statement, the attributes of the target object, and the conversation context. In one possible implementation, the dialogue device determines the first topic based on the first statement and the attributes of the target object. In another possible implementation, the dialogue device determines the first topic based on the first statement and the conversation context. In yet another possible implementation, the dialogue device determines the first topic based on the attributes of the target object and the conversation context.

[0115] The dialogue device determines the first topic based on at least one of the first speech, the attribute of the target object, and the dialogue context. The first topic can also be determined based on the first speech, the attribute of the target object, and the dialogue context.

[0116] 103. Generate a target response for the target role to the first speech based on the first topic, wherein the target response is related to the first topic.

[0117] In the embodiment of the present application, the target reply is the target character's reply to the first speech. After determining the first topic, the dialogue device can generate a target reply related to the first topic based on the first topic.

[0118] In one possible implementation, the dialogue device inputs the first topic into a language model and obtains a target response output by the language model. In another possible implementation, the dialogue device determines a response related to the first topic from among preset responses and uses it as the target response. In yet another possible implementation, the dialogue device generates a target response related to the first topic based on retrieval-augmented generation (RAG).

[0119] In an embodiment of the present application, the target conversation includes a conversation between a target object and a target character, wherein the target conversation includes a first speech and the conversation context preceding the first speech. After obtaining the target object's first speech in the target conversation, the conversation device determines a first topic for the target character to engage in conversation with the target object after the first speech based on at least one of the first speech, the target object's attributes, and the conversation context, thereby increasing the probability that the target object will be interested in the first topic. A target reply related to the first topic for the first speech is then generated based on the first topic, thereby increasing the probability that the target object will be interested in the target reply.

[0120] As an optional implementation, the dialogue device performs the following steps during step 102:

[0121] 2001. Determine a first topic based on attributes of a target object and a conversation context, wherein the conversation context is related to a second topic, and the first topic is different from the second topic.

[0122] In step 2001, the conversation context is related to the second topic, while the first topic is different from the second topic. Therefore, the conversation device can switch topics by executing step 2001. For example, if the conversation context is about Movie A, the second topic would be Movie A. The first topic could be a different topic from Movie A, such as basketball.

[0123] As an optional implementation, the dialogue device performs the following steps during step 102:

[0124] 3001. Based on the first speech of the target object, obtain the first topic.

[0125] By executing step 3001, the dialogue device can determine a first topic for dialogue with the target object based on the target object's speech, so as to subsequently determine a target reply to the first speech based on the first topic.

[0126] As an optional implementation, after acquiring the first speech, the dialogue device further generates a target reply to the first speech by performing the following steps:

[0127] 4001. Generate a target response to the first speech based on the first speech and / or the conversation context of the first speech.

[0128] By executing step 4001, the dialogue device can directly generate a target response to the first speech based on the first speech and / or the conversation context of the first speech. In one possible implementation, the dialogue device generates a target response to the first speech based on the first speech. In another possible implementation, the conversation context of the first speech is related to the first speech. Therefore, the dialogue device determines the target response to the first speech based on the conversation context of the first speech, thereby increasing the probability that the target recipient will be interested in the target response. In yet another possible implementation, the dialogue device generates a target response to the first speech based on the first speech and the conversation context of the first speech.

[0129] As an optional implementation, before executing step 102, the dialogue device determines the intention of the target object based on the first speech and / or dialogue context, wherein the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, and implicit retrieval intention.

[0130] Non-retrieval intent refers to the target subject's interest in continuing the target conversation. For example, in the target conversation, the first statement in the conversation context is related to Movie A, and the first statement is about who is the star of Movie A. In this case, the first statement has a non-retrieval intent, meaning that the target subject, through the first statement, expresses interest in continuing the conversation related to Movie A. Optionally, the target subject's interest in continuing the target conversation includes interest in continuing the conversation related to a second topic.

[0131] Explicit search intent refers to the target subject expressing interest in a topic through entities in their posts. For example, the target subject's first post includes "I recently watched Movie A," where Movie A is an entity. The target subject expressed interest in Movie A through their first post.

[0132] Implicit search intent refers to the target audience's decreased interest in the second topic. For example, in the target conversation, the first statement in the conversation context is related to Movie A. The first statement is "I'm talking to you about this interesting movie." In this case, based on the first statement, it can be determined that the target audience's interest in Movie A has decreased.

[0133] When the target object's intention includes non-retrieval intention, it indicates that the target object is interested in continuing the target dialogue. Therefore, the dialogue device can generate a target response to the first speech directly based on the first speech and / or the dialogue context of the first speech by executing step 4001, thereby continuing the target dialogue.

[0134] If the target subject's intent includes an explicit search intent, this indicates that the target subject is interested in the entity in the speech. Therefore, the dialogue device can determine the first topic by executing step 3001, thereby increasing the probability that the target subject will be interested in the first topic. Optionally, if the target subject's intent includes an explicit search intent, the dialogue device can determine the first topic based on the entity in the first speech. For example, if the target subject's first speech includes, "I recently watched Movie A," where Movie A is an entity, the dialogue device may determine Movie A as the first topic.

[0135] If the target object's intention includes an implicit search intent, this indicates that the target object's interest in the target conversation has decreased. If the target character continues to engage in a conversation with the target object related to the topic of the target conversation, this may cause the target object to further lose interest in the conversation. Therefore, if the target object's intention includes an implicit search intent, the dialogue device responds by switching topics to increase the target object's interest in the conversation with the target character. Therefore, if the target object's intention includes an implicit search intent, the dialogue device can determine the first topic by executing step 2001.

[0136] In one possible implementation, the conversation device generates a first prompt word based on the attributes of the target object and the conversation context. The first prompt word instructs a language model to determine the topic of the conversation based on the attributes of the target object and the conversation context. The first prompt word is input into the language model, and the language model outputs a first topic.

[0137] Optionally, when the target object's intent includes an implicit search intent, the dialogue device generates a target response for the first statement based on the first and second topics, wherein the target response is used to transition the topic from the second topic to the first topic, that is, the target response can serve as a link between the previous and the next topic. For example, the second topic is Movie A, and the first topic is basketball. The target response can be: The protagonist in Movie A never gives up his fighting spirit in the face of adversity, just like the players on the basketball court who dribble the ball and shoot hard to win, interpreting their dedication and love for the sport with blood and sweat. Optionally, the dialogue device generates a target response based on a language model, wherein the target response is used to transition the topic from the second topic to the first topic.

[0138] Optionally, the dialogue device determines the intention of the target object based on the first speech and / or the dialogue context as expressed by the following formula:

[0139] c,q=LLM(profile,context,prompt r )…Formula (1)

[0140] Among them, c represents the intention of the target object, q represents the first topic, LLM(·) represents the processing of the language model, profile represents the attribute of the target object, and context represents the conversation context. r The second prompt word indicates that the language model determines the target object's intention based on the first utterance and / or the conversation context, and determines the first topic based on at least one of the first utterance, the conversation context, and the target object's attributes. As an optional embodiment, the dialogue device performs the following steps during step 103:

[0141] 5001. Based on a first topic, retrieve at least one first search result from a database.

[0142] 5002. Generate a target reply to the first speech based on at least one first search result and a first topic.

[0143] In the embodiments of the present application, the database is pre-set. Optionally, the data in the database originates from the internet. This can improve the diversity and real-time nature of the data in the database, as well as the amount of information carried by the data in the database. It should be understood that if the data in the database involves personal information, the personal information is obtained with authorization.

[0144] Optionally, the data in the database may be in any modality. For example, the data in the database may include multimedia content, where the multimedia content includes one or more of the following: images, audio, text, and video. For example, the multimedia content may include text. Another example may include text and images. Another example may include audio, text, and video.

[0145] Optionally, the language model can obtain first knowledge through training, wherein the first knowledge is knowledge used to generate replies related to a specific topic. The language model can then generate a target reply related to the first question based on the first knowledge. Since the data used for training is limited, the first knowledge learned by the language model through training is also limited, which leads to a low probability that the target object is interested in the generated target reply. Therefore, in order to make up for the defect of the limited first knowledge of the language model. The dialogue device can retrieve at least one first retrieval result related to the first topic from the database based on the first topic. The dialogue device then generates a target reply related to the first topic based on the at least one first retrieval result and the first topic, which can increase the probability that the target object is interested in the target reply.

[0146] Optionally, the amount of data in the database is greater than the amount of data used to train the language model, so that the amount of information carried by the data in the database is greater than the amount of information carried by the data used to train the language model.

[0147] Optionally, the dialogue device searches the database based on the first topic to obtain n first intermediate search results related to the first topic, and determines k first intermediate search results most relevant to the first topic from the n first intermediate search results as the at least one first search result.

[0148] Optionally, the dialogue device retrieves at least one first search result from the database and expresses it as follows:

[0149] note1,…,note k =Retriever(q)…Formula (2)

[0150] Among them, note represents the first search result, note1,…,note k Retriever(·) indicates searching the database, and q indicates the first topic.

[0151] Optionally, the dialogue device generates a third prompt word based on the conversation context of the first speech, the first topic, and the at least one first search result. The third prompt word is used to instruct the language model to generate a response to the first speech based on the at least one first search result and the conversation context of the first speech, and the response is related to the first topic. The third prompt word is input into the language model to obtain a target response output by the language model.

[0152] Optionally, the conversation device generates a first summary based on content related to the first topic in at least one first search result. This eliminates interference from content in the at least one first search result that is irrelevant to the first topic in the subsequent generation of the target reply. Generating the target reply based on the first summary and / or the conversational context of the first statement can increase the likelihood that the target recipient will be interested in the target reply.

[0153] Optionally, the dialogue device obtains the first summary content using the following formula:

[0154] summary=LLM(q,[note1,…,note k ],prompt s )…Formula (3)

[0155] Where, summary represents the first summary content, LLM(·) represents the processing of the language model, and q represents the first topic.

[0156] [note1,…,note k ] indicates at least one first search result. s Represents a summary prompt word, wherein the summary prompt word is used to instruct the language model to summarize the content related to the first topic in at least one first search result.

[0157] Optionally, the dialogue device generates a fourth prompt word based on the first summary and the conversation context of the first speech, where the fourth prompt word is used to instruct the language model to generate a response to the first speech based on the first summary and the conversation context of the first speech. The fourth prompt word is input into the language model to obtain a target response output by the language model.

[0158] Optionally, the dialogue device generates a target response to the first speech based on the first summary content and the dialogue context of the first speech, which is expressed as follows:

[0159] response=LLM9context,summary,prompt g )…Formula (4)

[0160] Among them, response represents the target response, LLM(·) represents the processing of the language model, context represents the conversation context, and summary represents the first summary content. g Indicates the fourth prompt word.

[0161] As an optional embodiment, the dialogue device randomly determines a preset question from a preset question library as the initial speech. For example, the preset question library includes the following preset questions: "Is there any place you particularly want to go?", "What type of books do you like to read?"

[0162] As an optional implementation, the dialogue device further performs the following steps:

[0163] 6001. When the target activity of the target object is less than or equal to a first threshold, the initial speech of the target dialogue is sent by the target character. The target activity is the activity of the target object in the dialogue between the target object and the target character.

[0164] In this embodiment of the present application, target activity refers to the target object's activity in the conversation between the target object and the target character. Target activity can be used to measure the target object's level of participation in the conversation with the target character. Specifically, a higher target activity indicates a higher level of participation in the conversation between the target object and the target character.

[0165] Optionally, the target activity is determined based on at least one of the following aspects: the frequency of conversations between the target object and the target character, the duration of no conversation between the target object and the target character, the duration of conversations between the target object and the target character, the proportion of the target object's speeches in the conversations between the target object and the target character, the number of words spoken by the target object during the conversation with the target character, the depth of participation of the target object in the conversation with the target character, the number of topic indications given by the target object during the conversation with the target character, and the emotional involvement of the target object during the conversation with the target character.

[0166] The less frequently the target subject and the target character talk, the lower the target's activity. The longer the duration of no conversation between the target subject and the target character, the lower the target's activity. The shorter the duration of conversation between the target subject and the target character, the lower the target's activity. The fewer words the target subject speaks during a conversation with the target character, the lower the target's activity.

[0167] The target's speech percentage in the conversation between the target and the target character refers to the percentage of the target's speech in the conversation between the target and the target character. For example, if the conversation between the target and the target character consists of 10 speeches, 3 of which are made by the target, then the target's speech percentage in the conversation between the target and the target character is 3 / 10. The lower the percentage of the target's speech in the conversation between the target and the target character, the lower the target's activity.

[0168] The depth of the target subject's engagement in a conversation with the target character is reflected in their in-depth discussion and active responses to the topic. If the target subject's engagement is shallow, they will elaborate on their views, providing rich details and examples to support their opinions. They will also carefully consider and respond to the target character's remarks, raising targeted questions or rebuttals. For example, when discussing a movie plot with the target character, if the target subject's engagement is deep, they will analyze the character's personality, the plot's direction, and the underlying meaning. If the target subject's target activity is low, they will simply express their likes or dislikes. The shallower the target subject's engagement in a conversation with the target character, the lower the target activity.

[0169] The number of topic indications given by the target subject during a conversation with the target character refers to the number of times the target subject extended the topic during the conversation. By extending the topic, the target subject can indicate the direction of the topic and introduce a new topic to the conversation between the target subject and the target character. Optionally, the target subject may extend the topic during a conversation by asking related extended questions based on the current topic or by expanding the topic by combining knowledge from other related fields. For example, when discussing a basketball game, if the target subject extends the topic, they may move from the rules of the game to the history of basketball, and then to the basketball culture of different countries. The fewer the number of topic indications given by the target subject during a conversation with the target character, the lower the target's activity level.

[0170] The lower the target subject's emotional engagement during a conversation with the target character, the lower the target's activity level. Optionally, the higher the target subject's emotional engagement during a conversation with the target character, the more emoticons the target subject uses. Optionally, the higher the target subject's emotional engagement during a conversation with the target character, the more vivid the language used. For example, when discussing their favorite team's victory, the target subject might express joy with an excited tone and numerous exclamation points.

[0171] Optionally, the target activity level is represented by a numerical value. That is, based on at least one of the aforementioned aspects, a numerical value representing the target activity level can be determined. A larger numerical value representing the target activity level indicates a higher target activity level. Therefore, if the target activity level is less than or equal to a first threshold, the target activity level is low. In other words, the first threshold serves as a basis for determining whether the target activity level is high or low.

[0172] Optionally, when the target activity of the target object is determined based on the frequency of conversations between the target object and the target character, the frequency of conversations between the target object and the target character is less than or equal to the first threshold, indicating that the target activity is less than or equal to the first threshold, and further indicating that the target activity of the target object is low.

[0173] Optionally, when the target activity of the target object is determined based on the duration during which no conversation occurs between the target object and the target character, the duration during which no conversation occurs between the target object and the target character is greater than or equal to the second threshold, indicating that the target activity is less than or equal to the first threshold, and further indicating that the target activity of the target object is low.

[0174] As mentioned above, if the target object's activity is less than or equal to the first threshold, it means that the target object is not very active in the conversation with the target character, which means that the target object has a low interest in the conversation with the target character. Therefore, in order to increase the target object's interest in the conversation with the target character, when the target object's target activity is less than or equal to the first threshold, the target character actively initiates a conversation, thereby increasing the target object's activity in the conversation with the target character, and thus increasing the target object's interest in the conversation with the target character. Therefore, when the target object's target activity is less than or equal to the first threshold, the initial speech of the target conversation is sent by the target character, that is, the target conversation is actively initiated by the target character.

[0175] Optionally, the initial speech is obtained by the following steps: determining a third topic for conversation with the target object based on the attributes of the target object; and generating the initial speech based on the third topic, wherein the initial speech is related to the third topic.

[0176] Determining the third topic based on the attributes of the target object can increase the probability that the target object is interested in the third topic, and then generating an initial speech based on the third topic can increase the probability that the target object is interested in the initial speech.

[0177] Optionally, the attributes of the target object include the interests of the target object, and the dialogue device determines the interests of the target object as the third topic.

[0178] In an implementation method for generating an initial speech based on a third topic, the dialogue device inputs the third topic into a language model to obtain an initial speech output by the language model.

[0179] In another implementation of generating an initial speech based on the third topic, at least one second search result is retrieved from a database based on the third topic, and the initial speech is generated based on the at least one second search result and the third topic.

[0180] Optionally, the dialogue device searches the database based on the first topic to obtain n second intermediate search results related to the first topic, and determines k second intermediate search results most relevant to the third topic from the n second intermediate search results as the at least one second search result.

[0181] Optionally, the conversation device generates a fifth prompt word based on the third topic and the at least one second search result, wherein the fifth prompt word is used to instruct the language model to generate an utterance related to the third topic based on the at least one first search result. The fifth prompt word is input into the language model to obtain an initial utterance output by the language model.

[0182] Optionally, the conversation device generates a second summary based on content related to the third topic in at least one second search result. This eliminates interference from content in the at least one second search result that is irrelevant to the third topic in the subsequent generation of the initial speech. Generating the initial speech based on the second summary increases the likelihood that the target audience will be interested in the initial speech.

[0183] Optionally, the dialogue device generates a sixth prompt word based on the second summary content, wherein the sixth prompt word is used to instruct the language model to generate a speech based on the second summary content. The sixth prompt word is input into the language model to obtain an initial speech output by the language model.

[0184] As an optional embodiment, the dialogue device further performs the following steps: based on the target conversation, updating the attributes of the target object. Because the target conversation carries the attribute information of the target object, the dialogue device can determine the attributes of the target object based on the target conversation and, in turn, update the attributes of the target object. For example, before the target conversation, the attributes of the target object include that the target object's favorite sport is football. However, based on the target conversation, it is determined that the target object's favorite sport is basketball. Therefore, based on the target conversation, the target object's favorite sport in the attributes can be updated from football to basketball.

[0185] As an optional implementation, at least one of the first topic, target reply, target object's intention, third topic, and initial speech is obtained by the language model based on corresponding instructions. The corresponding instructions are used to instruct the language model to generate corresponding content. Specifically, the instruction corresponding to the first topic is an instruction for instructing the language model to generate the first topic, the instruction corresponding to the target reply is an instruction for instructing the language model to generate the target reply, and the instruction corresponding to the target object's intention is an instruction for instructing the language model to generate the target object's intention.

[0186] Optionally, the instruction belongs to a prompt word. The instruction corresponding to the first topic belongs to the first prompt word mentioned above, that is, the first topic is obtained by the language model based on the first prompt word. The instruction corresponding to the target reply belongs to the third prompt word mentioned above, that is, the target reply is obtained by the language model based on the third prompt word. The instruction corresponding to the intention of the target object belongs to the second prompt word mentioned above, that is, the intention of the target object is obtained by the language model based on the second prompt word. The instruction corresponding to the third topic belongs to the seventh prompt word, that is, the third topic is obtained by the language model based on the seventh prompt word, wherein the seventh prompt word is used to instruct the language model to determine the topic of the conversation with the target object based on the attributes of the target object. The instruction corresponding to the initial speech belongs to the fifth prompt word mentioned above, that is, the intention of the target object is obtained by the language model based on the fifth prompt word.

[0187] Based on the dialogue method described above, the embodiment of the present application also provides a possible implementation method. When the target activity of the target object is less than or equal to the first threshold, the dialogue device outputs an initial speech to the target object to actively initiate a dialogue. In one implementation method of outputting the initial speech to the target object, the dialogue device controls the display device to display the initial speech to present the initial speech to the target object. For example, the target object conducts a dialogue with the dialogue device through a mobile phone, and the dialogue device sends an instruction to the mobile phone to cause the mobile phone to display the initial speech through the display screen, so that the target object can see the initial speech. In another implementation method of outputting the initial speech to the target object, the dialogue device controls the target character to output a voice including the initial speech so that the target object can hear the initial speech. For example, the dialogue device controls the speaker to output a voice including the initial speech so that the target object can hear the initial speech.

[0188] After outputting the initial speech, a target dialogue is conducted with the target object, and after obtaining the first speech of the target object in the target dialogue, the intention of the target object is determined based on the first speech and / or the dialogue context, wherein the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, implicit retrieval intention. In the case where the intention of the target object is non-retrieval intention, a target reply to the first speech is generated based on the first speech and / or the dialogue context of the first speech. In the case where the intention of the target object is explicit retrieval intention, a first topic is obtained based on the first speech of the target object. In the case where the intention of the target object is implicit retrieval intention, a first topic is determined based on the attributes of the target object and the dialogue context. In the case where the first topic is determined, a target reply to the first speech is generated based on the first topic. After generating the target reply, the target reply is output through the target role.

[0189] This allows the target person to increase their target activity by proactively initiating a conversation, even when their target activity is low, and initiate a targeted conversation between the target character and the target person. During the targeted conversation, the conversation device determines different reply methods based on the target person's intent and then determines the target reply for the first statement based on the determined reply methods, thereby increasing the probability that the target person will be interested in the target reply.

[0190] On the one hand, with the development of technology, natural language processing has brought new perspectives and methods to various human-related tasks, inspiring many interesting research directions. One important exploration direction is to use natural language processing to achieve dialogue expression and role construction, thereby realizing emotional care and communication. On the other hand, because digital emotional care tools have practical benefits in mental health, related technical solutions are expected to become an effective path for various institutions to address mental health issues and achieve emotional care. Based on the above two aspects, natural language processing technology can be used to build emotional care products, realizing emotional care solutions that are in line with real scenarios, with warmth and more humanization, so as to further provide emotional care to a large number of people based on this emotional care solution.

[0191] Based on this, embodiments of the present application also provide a virtual character dialogue method, which can determine a target response for a virtual character to a target object's first statement, thereby enabling a dialogue between the virtual character and the target object. The virtual character dialogue method is performed by a virtual character dialogue device, which can be any electronic device capable of executing the technical solutions disclosed in the embodiments of the present application. Optionally, the virtual character dialogue device can be any of the following: a computer or a server.

[0192] See also Figure 2 , Figure 2 A flowchart of a virtual character dialogue method provided in an embodiment of the present application.

[0193] 201. Obtain a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character, and the target dialogue includes a dialogue context before the first speech.

[0194] exist Figure 2 In the virtual character dialogue method, the virtual character dialogue device runs the virtual character, and the target dialogue includes a dialogue between the target object and the virtual character. The implementation of step 201 can refer to the implementation of step 101 and will not be repeated here.

[0195] 202. Determine a first topic based on at least one of the first speech, attributes of the target object, and the conversation context.

[0196] The implementation of step 202 can refer to the implementation of step 102 and will not be repeated here.

[0197] 203. Generate a target response of the virtual character to the first speech based on the first topic, wherein the target response is related to the first topic.

[0198] exist Figure 2 In the virtual character dialogue method, the target reply includes the virtual character's reply to the first speech of the target object. The implementation of step 203 can refer to the implementation of step 103 and will not be repeated here.

[0199] Optionally, the virtual character dialogue device generates a targeted response based on the first topic, the virtual character's attributes, and / or schedule. The virtual character's attributes include at least one of the following: the virtual character's interests, occupation, age, and gender. The virtual character's schedule includes the virtual character's daily time allocation. Based on the virtual character's schedule, tasks to be completed, activities to be participated in, or matters to be undertaken by the virtual character within a specific time period can be determined.

[0200] Generating targeted responses based on the avatar's attributes can make the conversation between the avatar and the target person more lively. For example, if the avatar's attributes include that the avatar likes basketball, then a targeted response generated based on the avatar's attributes might be: "I like basketball. What sports do you like?" For another example, if the avatar's schedule includes playing basketball from 10:00 to 10:30, then a targeted response generated based on the avatar's attributes might be: "I'm going to play basketball at 10:00. Do you want to join me?"

[0201] In an embodiment of the present application, the target conversation includes a conversation between a target subject and a virtual character, wherein the target conversation includes a first speech and the conversation context preceding the first speech. After obtaining the target subject's first speech in the target conversation, the conversation device determines a first topic for the virtual character to engage in conversation with the target subject following the first speech based on at least one of the first speech, the target subject's attributes, and the conversation context, thereby increasing the probability that the target subject will be interested in the first topic. A target reply related to the first topic is then generated based on the first topic, thereby increasing the probability that the target subject will be interested in the target reply.

[0202] See also Figure 3a , Figure 3a This is a schematic diagram of a virtual character dialogue implemented by a traditional method provided in an embodiment of the present application. Figure 3aAs shown, the traditional method continues the conversation with the target subject about Movie A after the target subject says, "I recently went to see Movie A." When the target subject says, "It's quite interesting to talk to you about this movie," the target subject's interest in continuing the conversation about Movie A has waned, indicating that the target subject's interest in the target conversation with the virtual character has decreased. However, the virtual character determined by the traditional method responds with, "It's nice to chat with you. Is there anything else you'd like to discuss about this movie?" This means that the virtual character is still engaging in a conversation about Movie A. This response further reduces the target subject's interest in the target conversation, further diminishing their conversational experience. As a result, the target subject responds, "After all this conversation, I'm getting a little bored."

[0203] See also Figure 3b , Figure 3b The embodiment of the present application provides a method based on Figure 2 Schematic diagram of virtual character dialogue implemented by the virtual character dialogue method. Figure 3b As shown, the virtual character dialogue device first determines the speech of the virtual character based on the preset question. Specifically, the initial speech of the virtual character is: "Have you seen any good movies recently?" The virtual character actively initiates a conversation through the initial speech. Then the target object's speech is: "Of course, I went to see movie A recently." After obtaining the speech, the virtual character dialogue device generates a prompt word based on the speech. The prompt word is used to instruct the language model to determine the intention of the target object based on the speech. In the case where the intention based on the target object is an explicit retrieval intention, the topic based on the target object's speech (i.e. Figure 3b The database is searched to obtain the search results (i.e., the at least one first search result mentioned above). Then, the at least one first search result is summarized to obtain the first summary content, i.e. Figure 3b "Movie A is a movie... Character B can destroy the entire universe by snapping his fingers..." Then, based on the first summary content, generate a reply to the target object's speech, that is, Figure 3b For example, in the sentence "When character B in movie A snapped his fingers, my heart was truly broken!", this allows for retrieval-augmented generation (RAG). Specifically, RAG can be used to search a database, obtain retrieval results, and generate responses based on the retrieval results.

[0204] The target object continues to speak in response to the virtual character: "Haha, it's really fun to talk to you about this movie!" Based on this speech, the virtual character dialogue device generates a prompt word, which is used to instruct the language model to determine the target object's intention based on this speech. In the case where the intention based on the target object is an implicit retrieval intention, the topic of the next conversation is determined to be: "Popular science fiction novels". Specifically, Figure 3b As shown, the target object's attributes include reading habits and movie-related topics. Reading habits include the target object's liking for science fiction novels, and movie-related topics include the target object's liking for movie A. Since the target object has decreased interest in the target conversation, and the topic of the target conversation is movie A, the virtual character conversation device determines the next topic of the conversation to be "popular science fiction novels" based on the target object's attributes and the target object's speech. Figure 3b As shown, the virtual character dialogue device can determine the target object's attributes based on the dialogue between the target object and the virtual character, wherein determining the target object's attributes includes updating the target object's attributes. This can achieve the goal of determining the next topic of the dialogue (i.e., the first topic) based on the target object's intention, wherein "popular science fiction novels" is the first topic.

[0205] After determining that the topic of the next conversation is "popular science fiction novels", the database is searched based on "popular science fiction novels" to obtain search results (i.e., the at least one first search result mentioned above). Then, the at least one first search result is summarized to obtain the first summary content, i.e., Figure 3b "Novel C is a very popular science fiction novel..." Then, based on the first summary content, generate a reply to the target object's speech, that is, Figure 3b For example, consider the following example: "Nice to chat with you. Besides movies, do you like science fiction novels? For example, Science Fiction Novel C?" This successfully switches the topic from Movie A to a popular science fiction novel. The target audience also expresses interest in continuing the conversation, so they respond with, "Of course, I really like this novel." This implements RAG. Specifically, RAG allows you to search a database, obtain search results, and generate responses based on these results.

[0206] contrast Figure 3a and Figure 3bIt can be seen that the virtual character dialogue method provided in the embodiment of the present application has the following differences compared to the traditional method: 1. In the traditional method, the virtual character's speech is passive, that is, the dialogue between the target object and the virtual character is initiated by the target object. In the virtual character dialogue method provided in the embodiment of the present application, the virtual character's speech can be active, that is, the dialogue between the target object and the virtual character can be initiated by the virtual character. 2. In the traditional method, the virtual character does not determine the intention of the target object. In the virtual character dialogue method provided in the embodiment of the present application, the virtual character dialogue device determines the intention of the target object, and when the intention of the target object is an implicit retrieval intention, the probability of the target object being interested in the reply of the virtual character is increased by switching topics. Based on the above two differences, the virtual character dialogue method provided in the embodiment of the present application can enhance the dialogue experience of the target object compared to the traditional method.

[0207] Those skilled in the art will understand that in the above method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0208] The above describes in detail the method of the embodiment of the present application, and the following provides an apparatus of the embodiment of the present application.

[0209] See also Figure 4 , Figure 4 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 determination unit 12, and a generation unit 13. Optionally, the dialogue device 1 also includes an update unit 14, wherein:

[0210] An acquisition unit 11 is configured to acquire a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a target character; the target dialogue includes a dialogue context before the first speech;

[0211] a determining unit 12, configured to determine a first topic based on at least one of the first speech, an attribute of the target object, and a conversation context;

[0212] The generating unit 13 is configured to generate a target reply of the target role to the first speech based on the first topic, where the target reply is related to the first topic.

[0213] In combination with any embodiment of the present application, the determining unit 12 is further configured to:

[0214] A first topic is determined based on the attributes of the target object and a conversation context, where the conversation context is related to a second topic, and the first topic is different from the second topic.

[0215] In combination with any embodiment of the present application, the determining unit 12 is further configured to:

[0216] A first topic is obtained based on the first speech of the target object.

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

[0218] Based on the first statement and / or the conversation context of the first statement, a target reply to the first statement is generated.

[0219] In combination with any embodiment of the present application, the determining unit 12 is further configured to:

[0220] Based on the first speech and / or the conversation context, the intention of the target object is determined, and the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, implicit retrieval intention; the intention of the target object is used to select one of the following to generate the target reply: based on the attributes of the target object and the conversation context, determine the first topic; based on the first speech of the target object, obtain the first topic; based on the first speech and / or the conversation context of the first speech, generate a target reply to the first speech.

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

[0222] Based on the first topic, retrieve at least one first search result from a database;

[0223] The target reply to the first statement is generated based on the at least one first search result and the first topic.

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

[0225] Obtaining first summary content based on content related to the first topic in the at least one first search result;

[0226] The target reply is obtained based on the first summary content and / or the conversation context of the first speech.

[0227] In combination with any embodiment of the present application, when the target activity of the target object is less than or equal to a first threshold, the initial speech of the target dialogue is sent by the target character, and the target activity is the activity of the target object in the dialogue between the target object and the target character.

[0228] In conjunction with any embodiment of the present application, the initial speech is obtained by the following steps: determining a third topic for conversation with the target object based on the attributes of the target object;

[0229] Based on the third topic, the initial speech is generated, where the initial speech is related to the third topic.

[0230] In combination with any embodiment of the present application, generating the initial speech based on the third topic includes:

[0231] Based on the third topic, retrieve at least one second search result from the database;

[0232] The initial speech is generated based on the at least one second search result and the third topic.

[0233] In combination with any embodiment of the present application, the target activity of the target object is determined based on at least one of the following: the frequency of conversations between the target object and the target character, and the duration of no conversation between the target object and the target character.

[0234] In combination with any embodiment of the present application, the dialogue device further includes: an updating unit 14, configured to update the attributes of the target object based on the target dialogue.

[0235] In combination with any embodiment of the present application, at least one of the first topic, the target reply, the intention of the target object, the third topic, and the initial speech is obtained by a language model based on corresponding instructions.

[0236] In an embodiment of the present application, the target conversation includes a conversation between a target object and a target character, wherein the target conversation includes a first speech and the conversation context preceding the first speech. After obtaining the target object's first speech in the target conversation, the conversation device determines a first topic for the target character to engage in conversation with the target object after the first speech based on at least one of the first speech, the target object's attributes, and the conversation context, thereby increasing the probability that the target object will be interested in the first topic. A target reply related to the first topic for the first speech is then generated based on the first topic, thereby increasing the probability that the target object will be interested in the target reply.

[0237] See also Figure 5 , Figure 5 This is a structural diagram of a virtual character dialogue device provided in an embodiment of the present application. The virtual character dialogue device 2 includes: an acquisition unit 21, a determination unit 22, and a generation unit 23, wherein:

[0238] An acquisition unit 21 is configured to acquire a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character; the target dialogue includes a dialogue context before the first speech;

[0239] a determining unit 22 configured to determine a first topic based on at least one of the first speech, the attributes of the target object, and the conversation context;

[0240] The generating unit 23 is configured to generate a target reply of the virtual character to the first speech based on the first topic, where the target reply is related to the first topic.

[0241] In combination with any embodiment of the present application, the generating unit 23 is further configured to:

[0242] The target reply is generated based on the first topic, the attributes and / or schedule of the virtual character.

[0243] In an embodiment of the present application, the target conversation includes a conversation between a target subject and a virtual character, wherein the target conversation includes a first speech and the conversation context preceding the first speech. After obtaining the target subject's first speech in the target conversation, the conversation device determines a first topic for the virtual character to engage in conversation with the target subject following the first speech based on at least one of the first speech, the target subject's attributes, and the conversation context, thereby increasing the probability that the target subject will be interested in the first topic. A target reply related to the first topic is then generated based on the first topic, thereby increasing the probability that the target subject will be interested in the target reply.

[0244] 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.

[0245] Figure 6 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, connection through various interfaces, transmission lines, buses, etc.

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

[0247] The memory 32 can be used to store computer program instructions and various computer program codes, including the program code for executing the solution 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 compact disc read-only memory (CD-ROM), which is used for related instructions and data.

[0248] 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.

[0249] 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. The embodiment of the present application does not limit the specific data stored in the memory.

[0250] It is understandable that Figure 6 Only a simplified design of an electronic device is shown. In actual applications, the electronic device may further 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 scope of protection of the present application.

[0251] Those skilled 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 beyond the scope of this application.

[0252] Those skilled in the art will 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 will also clearly understand that the descriptions of the various embodiments of this 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, reference can be made to the descriptions of other embodiments.

[0253] In the several embodiments provided in this 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 merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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.

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

[0255] 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.

[0256] 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 via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. 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)).

[0257] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by a computer program instructing related hardware to perform the processes. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A dialogue method, characterized in that: The dialogue method is applied to a dialogue device, and the method includes: Obtaining a first speech of a target object in a target dialogue, wherein the target dialogue includes a dialogue between the target object and a target character; the target dialogue includes a dialogue context before the first speech; Determining a first topic based on at least one of the first speech, the attribute of the target object, and the conversation context; A target reply of the target role to the first speech is generated based on the first topic, and the target reply is related to the first topic.

2. The method according to claim 1, characterized in that The determining of the first topic based on at least one of the first speech, the attribute of the target object, and the conversation context includes: A first topic is determined based on the attributes of the target object and a conversation context, where the conversation context is related to a second topic, and the first topic is different from the second topic.

3. The method according to claim 1, characterized in that The determining of the first topic based on at least one of the first speech, the attribute of the target object, and the conversation context includes: A first topic is obtained based on the first speech of the target object.

4. The method according to claim 1, wherein The method further comprises: Based on the first statement and / or the conversation context of the first statement, a target reply to the first statement is generated.

5. The method according to any one of claims 1 to 4, characterized in that After obtaining the first speech of the target object in the target dialogue, the method further includes: Based on the first speech and / or the conversation context, the intention of the target object is determined, and the intention of the target object includes one of the following: non-retrieval intention, explicit retrieval intention, implicit retrieval intention; the intention of the target object is used to select one of the following to generate the target reply: based on the attributes of the target object and the conversation context, determine the first topic; based on the first speech of the target object, obtain the first topic; based on the first speech and / or the conversation context of the first speech, generate a target reply to the first speech.

6. The method according to any one of claims 1 to 4, characterized in that Generating a target reply to the first speech based on the first topic includes: Based on the first topic, retrieve at least one first search result from a database; The target reply to the first statement is generated based on the at least one first search result and the first topic.

7. The method according to claim 6, characterized in that Generating the target reply to the first speech based on the at least one first search result and the first topic includes: Obtaining first summary content based on content related to the first topic in the at least one first search result; The target reply is obtained based on the first summary content and / or the conversation context of the first speech.

8. The method according to any one of claims 1 to 4, characterized in that The method further comprises: When the target activity of the target object is less than or equal to a first threshold, the initial speech of the target dialogue is sent by the target character, and the target activity is the activity of the target object in the dialogue between the target object and the target character.

9. The method according to claim 8, characterized in that The initial speech is obtained by the following steps: determining a third topic for dialogue with the target object based on the attributes of the target object; Based on the third topic, the initial speech is generated, and the initial speech is related to the third topic.

10. The method according to claim 9, characterized in that Generating the initial speech based on the third topic includes: Based on the third topic, retrieve at least one second search result from the database; The initial speech is generated based on the at least one second search result and the third topic.

11. The method according to claim 8, characterized in that The target activity of the target object is determined based on at least one of the following: a frequency of conversations between the target object and the target character, and a duration during which no conversation occurs between the target object and the target character.

12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: Based on the target conversation, attributes of the target object are updated.

13. The method according to any one of claims 1 to 12, characterized in that At least one of the first topic, the target reply, the intention of the target object, the third topic, and the initial speech is obtained by a language model based on corresponding instructions.

14. A virtual character dialogue method, characterized in that: The method comprises: Obtaining a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character; the target dialogue includes a dialogue context before the first speech; Determining a first topic based on at least one of the first speech, the attribute of the target object, and the conversation context; A target reply of the virtual character to the first speech is generated based on the first topic, where the target reply is related to the first topic.

15. The method according to claim 14, characterized in that Generating a target reply of the virtual character to the first speech based on the first topic includes: The target reply is generated based on the first topic, the attributes and / or schedule of the virtual character.

16. A conversation device, characterized in that: The dialogue device comprises: an acquisition unit, configured to acquire a first speech of a target object in a target dialogue, wherein the target dialogue includes a dialogue between the target object and a target character; and the target dialogue includes a dialogue context before the first speech; a determining unit, configured to determine a first topic based on at least one of the first speech, an attribute of the target object, and a conversation context; A generating unit is configured to generate a target reply of the target role to the first speech based on the first topic, wherein the target reply is related to the first topic.

17. A virtual character dialogue device, characterized in that: The virtual character dialogue device comprises: an acquisition unit, configured to acquire a first speech of a target subject in a target dialogue, wherein the target dialogue includes a dialogue between the target subject and a virtual character; and the target dialogue includes a dialogue context before the first speech; a determining unit, configured to determine a first topic based on at least one of the first speech, an attribute of the target object, and a conversation context; A generating unit is configured to generate a target reply of the virtual character to the first speech based on the first topic, wherein the target reply is related to the first topic.

18. An electronic device, characterized in that: include: 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 method according to any one of claims 1 to 13, or the electronic device executes the method according to claim 14 or 15.

19. 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 13, or the processor executes the method according to claim 14 or 15.

20. 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 caused to execute the method according to any one of claims 1 to 13, or the computer is caused to execute the method according to claim 14 or 15.

Citation Information

Patent Citations

  • Dialogue processing method and device, electronic equipment and readable storage medium

    CN112989014A

  • Knowledge enhancement dialogue recommendation method based on multi-level attention mechanism

    CN114065047A

  • Conversation generation method and device based on artificial intelligence, equipment and storage medium

    CN114756667A

  • Conversation method and device, equipment and medium

    CN115617968A