Robot reply method, device, electronic device and storage medium

By obtaining the conversation data entered by the user and the personality data of the conversation object, and using the pre-constructed dialogue model to generate reply data that conforms to the personality, the problem of high human resources costs in the existing technology is solved, and logically reasonable and low-cost reply data generation is achieved.

CN114911904BActive Publication Date: 2025-08-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210501705.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2025-08-08
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

In the prior art, robotic responses with specific personalities require a large amount of human resource costs because a large number of replies that conform to their personalities need to be written in advance as a corpus, and a suitable reply cannot be given when the user input exceeds the corpus range.

Method used

By obtaining the conversation data entered by the user and the personality data of the conversation object, using the pre-constructed dialogue model, we generate reply data that conforms to the personality, including the processing of structured and unstructured role information and emotional recognition, reducing human resources costs.

Benefits of technology

It realizes the generation of reply data that conforms to the personality of the conversation object, reduces human resources costs, and improves the adaptability and logical rationality of reply data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911904B_ABST
    Figure CN114911904B_ABST
Patent Text Reader

Abstract

The present disclosure provides a robot reply method, device, electronic device, and storage medium. The method comprises: obtaining conversation data input by a user and determining the user's conversation partner; obtaining personality data of the conversation partner; processing the personality data based on the conversation data to obtain guidance data; and inputting the conversation data and the guidance data into a pre-built conversation model to obtain reply data output by the conversation model. The present disclosure processes the personality data of the conversation partner based on the conversation data input by the user to obtain guidance data for guiding the robot's reply. The guidance data and the conversation data are used together to generate reply data, ensuring that the reply data conforms to the personality of the conversation partner and reducing human resource costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of natural language processing technology, and in particular to a robot reply method, device, electronic device, and storage medium. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the present disclosure that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] In bot conversation scenarios, some scenarios require customized reply bots with specific personas. For example, a reply bot with a "celebrity" persona plays a well-known role. This type of character already has a fixed image in users' minds and a more comprehensive character set. Therefore, the responses of a bot with a persona must not only be logically sound but also consistent with its persona. Furthermore, this "persona" encompasses more than just the character's language style; it also encompasses all aspects of the character's information.

[0004] In existing technology, robots with specific personas typically require a large pre-written corpus of responses that match their personas. During a conversation, the robot selects a response from the corpus that matches the user's input. However, this approach relies on manually building a corpus, which requires high human resources. Summary of the Invention

[0005] In view of this, the purpose of the present disclosure is to provide a robot reply method, device, electronic device and storage medium.

[0006] Based on the above objectives, an exemplary embodiment of the present disclosure provides a robot reply method, including:

[0007] Acquire conversation data input by the user and determine the conversation partner of the user;

[0008] Obtaining the personality data of the conversation partner;

[0009] Processing the character data according to the conversation data to obtain guidance data;

[0010] The dialogue data and the guidance data are input into a pre-built dialogue model to obtain response data output by the dialogue model.

[0011] In some exemplary embodiments, the present invention further comprises:

[0012] The structured role information, unstructured role information and role language style information of the dialogue object are obtained as the character setting data.

[0013] In some exemplary embodiments, processing the persona data according to the conversation data to obtain guidance data includes:

[0014] Filling a pre-built role information template according to the structured role information to obtain basic role information;

[0015] Retrieving the structured role information and the unstructured role information according to the dialogue data to obtain dialogue-related role information;

[0016] Identifying the user's emotions based on the conversation data to obtain an emotion recognition result, and retrieving a prefix of the reply data corresponding to the emotion recognition result from the character language style information;

[0017] The basic role information, the dialogue-related role information, and a prefix of the reply data are used as the guide data.

[0018] In some exemplary embodiments, the role information template is a cloze template for filling in a text string;

[0019] Filling a pre-built role information template according to the structured role information to obtain basic role information includes:

[0020] Determine a task type corresponding to the dialogue data, and fill in the role information template corresponding to the task type according to the structured role information.

[0021] In some exemplary embodiments, before retrieving the structured role information and the unstructured role information according to the conversation data, the method further includes:

[0022] The structured role information is spliced according to a pre-built structured role information splicing template to obtain spliced structured role information.

[0023] In some exemplary embodiments, the retrieving the structured role information and the unstructured role information based on the conversation data to obtain conversation-related role information includes:

[0024] The unstructured role information and the spliced structured role information are retrieved according to the conversation data, and the unstructured role information and the spliced structured role information whose correlation with the conversation data exceeds a correlation threshold are used as the conversation-related role information.

[0025] In some exemplary embodiments, inputting the dialogue data and the guidance data into a pre-built dialogue model to obtain response data output by the dialogue model includes:

[0026] The dialogue data and the guide data are spliced to obtain spliced data, and the spliced data is input into the dialogue model to obtain the response data output by the dialogue model.

[0027] In some exemplary embodiments, inputting the dialogue data and the guidance data into a pre-built dialogue model to obtain response data output by the dialogue model includes:

[0028] Inputting the dialogue data and the guidance data into the dialogue model to obtain a response data set, wherein the response data set includes a plurality of candidate response data;

[0029] Whether the alternative reply data conflicts with the conversation data is determined in descending order of confidence until alternative reply data that does not conflict with the conversation data is obtained, and the alternative reply data is output as the reply data.

[0030] In some exemplary embodiments, the present invention further comprises:

[0031] Determine, based on the character's language style information, a decoding length parameter used by the dialogue model to generate the reply data.

[0032] Based on the same inventive concept, the exemplary embodiments of the present disclosure further provide a robot reply device, comprising:

[0033] A conversation data acquisition module is configured to acquire conversation data input by a user and determine a conversation partner of the user;

[0034] A personality data acquisition module, configured to acquire personality data of the conversation partner;

[0035] a guidance data acquisition module, configured to process the character data according to the conversation data to obtain guidance data;

[0036] The reply data acquisition module is configured to input the dialogue data and the guidance data into a pre-built dialogue model to obtain the reply data output by the dialogue model.

[0037] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods when executing the program.

[0038] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above methods.

[0039] As can be seen from the above, the robot reply method, device, electronic device, and storage medium provided by the embodiments of the present disclosure include: obtaining conversation data input by a user and determining the user's conversation partner; obtaining personality data of the conversation partner; processing the personality data based on the conversation data to obtain guidance data; inputting the conversation data and the guidance data into a pre-built conversation model to obtain reply data output by the conversation model. The present disclosure processes the personality data of the conversation partner based on the conversation data input by the user to obtain guidance data for guiding the robot's reply, and uses the guidance data together with the conversation data to generate reply data, so that the reply data conforms to the personality of the conversation partner, while reducing human resource costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 A schematic diagram of an application scenario of the robot reply method provided according to an embodiment of the present disclosure;

[0042] Figure 2 A flowchart of a robot reply method provided in an embodiment of the present disclosure;

[0043] Figure 3 A flowchart of a method for generating guidance data according to an embodiment of the present disclosure is provided;

[0044] Figure 4 A schematic diagram of the structure of a DPR retrieval model provided according to an embodiment of the present disclosure;

[0045] Figure 5 A schematic diagram of the structure of a robot recovery device provided in an embodiment of the present disclosure;

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

[0047] To make the objectives, technical solutions, and advantages of the present disclosure more clearly understood, the principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0048] According to an embodiment of the present disclosure, a robot reply method, device, electronic device, and storage medium are proposed.

[0049] It should be understood herein that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.

[0050] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.

[0051] The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0052] In the related art, the implementation of a dialogue response solution for a robot with a human setting requires relatively high human resource costs.

[0053] The inventors of the present disclosure have discovered that the reason for the high human resource costs in the above-mentioned related technologies is that the responses of robots with personality settings must not only be logically reasonable, but also be consistent with their personality settings. Therefore, for robots with personality settings, it is usually necessary to pre-write a large number of response sentences that are consistent with their personality settings as a corpus. During a conversation, based on the sentence input by the user, a response sentence corresponding to the user input is selected from the corpus for reply. In this solution, the response sentence can only come from the pre-built corpus. If the sentence input by the user exceeds the scope of the corpus, no appropriate response can be given. Therefore, in order to improve the user experience, a large amount of manpower and material resources can only be spent to enrich the corpus.

[0054] To address the above-mentioned issues, the present disclosure provides a robot reply solution, specifically comprising: obtaining conversation data input by a user and determining the user's conversation partner; obtaining personality data of the conversation partner; processing the personality data based on the conversation data to obtain guidance data; and inputting the conversation data and the guidance data into a pre-built conversation model to obtain reply data output by the conversation model. The present disclosure processes the personality data of the conversation partner based on the conversation data input by the user to obtain guidance data for guiding the robot's reply. This guidance data is then used together with the conversation data to generate reply data, ensuring that the reply data conforms to the personality of the conversation partner, while also reducing human resource costs.

[0055] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0056] refer to Figure 1 , which is a schematic diagram of an application scenario of the robot reply method provided by an embodiment of the present disclosure. The application scenario includes a terminal device 101, a server 102 and a data storage system 103. Among them, the terminal device 101, the server 102 and the data storage system 103 can be connected through a wired or wireless communication network. The terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices that can realize the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0057] Server 102 is used to provide robot reply service to the user of terminal device 101. A client that communicates with server 102 is installed in terminal device 101. The user can input a piece of conversation data through the client. After clicking the send button, the client sends the conversation data to server 102. Server 102 determines the user's conversation partner; obtains the personality data of the conversation partner; processes the personality data according to the conversation data to obtain guidance data; inputs the conversation data and guidance data into a pre-built conversation model to obtain reply data output by the conversation model, sends the reply data to the client, and the client displays the reply data to the user.

[0058] Data storage system 103 stores a large amount of training data. Each training data set includes a conversation data set and a guide data set, as well as the corresponding response data. Server 102 can train the conversation model based on this large amount of training data. Sources of training data include, but are not limited to, existing databases, data crawled from the internet, or data uploaded by users when using the client. When the accuracy of the conversation model output meets certain requirements, server 102 can provide robot response services to users based on the conversation model. Furthermore, server 102 can continuously optimize the conversation model based on newly added training data.

[0059] The following combination Figure 1 The robot reply solution according to the exemplary embodiment of the present disclosure is described with reference to the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0060] refer to Figure 2 , which is a flow chart of the robot reply method provided in an embodiment of the present disclosure.

[0061] The robot reply method includes the following steps:

[0062] Step S210: Acquire the conversation data input by the user and determine the conversation partner of the user.

[0063] During specific implementation, the user may input conversation data through a client installed in the terminal device, and the client may send the conversation data to a server implementing this solution.

[0064] Step S220: Acquire the personality data of the dialogue partner.

[0065] In some exemplary embodiments, structured role information, unstructured role information, and role language style information of the dialogue object are obtained as the character setting data.

[0066] In specific implementation, for each dialogue object, the corresponding character data including structured role information, unstructured role information and role language style information is pre-built. The following will specifically describe the method for constructing character data according to an exemplary embodiment of the present disclosure.

[0067] The structured role information may be fields that can be stored in a structured manner, such as name, age, relationship with the user, favorite items, related places, and interpersonal relationships.

[0068] As an example, refer to Table 1, which is an example table of structured role information.

[0069] Table 1 Example of structured role information

[0070]

[0071] Among them, the unstructured character information can be in natural language form, and each piece of unstructured character information can describe an experience or a characteristic of the character, such as: "Wuqing is proficient in music and good at playing the flute", "Wuqing has disabled legs and cannot run".

[0072] In specific implementation, each piece of unstructured role information should not be too long, is optional, and generally does not exceed twenty words.

[0073] As an example, refer to Table 2, which is an example table of unstructured role information.

[0074] Table 2 Example of unstructured role information

[0075]

[0076] Among them, the character's language style information includes at least one of the following: reactions to different user emotions (for example, when the user is sad, the ruthless reaction is "soft words of comfort"; when the user has no special tone, the ruthless reaction is "calm and calm"), character catchphrases, character banned words, and character speech length (i.e., whether the character talks a lot or a little).

[0077] As an example, refer to Table 3, which is an example table of unstructured role information.

[0078] Table 3 Example of character language style information

[0079]

[0080] Compared with the related art of manually writing reply sentences that are consistent with the character's personality, the present disclosure only needs to define the fields required for the character's personality, and the character's personality can be set by filling in knowledge. The cost of customizing the personality is low and the threshold is also low.

[0081] Step S230: Process the character data according to the dialogue data to obtain guidance data.

[0082] refer to Figure 3 , the method for generating guided data includes the following steps:

[0083] Step S310: Fill in a pre-built role information template according to the structured role information to obtain basic role information.

[0084] In some exemplary embodiments, the role information template is a cloze template for filling in a text string.

[0085] As an example, the template is:

[0086] "${robot_name}, ${robot_age_stage}, ${robot_gender}, is of the same lineage as ${robot_profession} and ${robot_affiliation}, is the player's ${robot_relationship["player"]}, and likes ${robot_hobbies}";

[0087] The templated role information is:

[0088] "Wuqing, a young man, is the leader of the Four Famous Constables, a descendant of the Shenhou Mansion, the player's senior brother, and likes to grow flowers and drink tea."

[0089] In some exemplary embodiments, a task type corresponding to the conversation data is determined, and the role information template corresponding to the task type is filled in according to the structured role information.

[0090] In specific implementation, at least one role information template is pre-built for each type of task. When implementing this solution, the structured role information is filled into the role information template corresponding to the current task type to realize the templating of the structured role information and obtain the templated basic role information.

[0091] In some exemplary embodiments, a method for constructing a template includes:

[0092] Obtain some training dialogue data, classify it by task type, and construct a corresponding template for each task type. Sources of training dialogue data include, but are not limited to, existing databases, data scraped from the internet, or data uploaded by customers using the client.

[0093] Templated basic role information is used to represent the basic personality information of the role and is used in the process of generating response data every time.

[0094] Step S320: Retrieve the structured role information and the unstructured role information according to the dialogue data to obtain dialogue-related role information.

[0095] In some exemplary embodiments, before the structured role information is retrieved, the structured role information is spliced.

[0096] During specific implementation, the structured role information may be spliced according to a pre-built structured role information splicing template to obtain spliced structured role information.

[0097] As an example, the splicing template is:

[0098] "${robot_name} is proficient in ${robot_expert}";

[0099] The splicing result is:

[0100] "Wuqing is proficient in mechanical devices and hidden weapons."

[0101] The concatenation result is natural language, which is in the same form as the unstructured role information.

[0102] In some exemplary embodiments, the structured role information and the unstructured role information are retrieved using a DPR retrieval model.

[0103] refer to Figure 4 ,Among them, the DPR retrieval model is a retrieval model based on semantic relevance,,which uses two Bert as the basic model.

[0104] During a search, the conversation data is fed into one BERT and the unstructured role information or the concatenated structured role information (both in natural language) is fed into another BERT. BERT then encodes each of these data elements, generating two representation vectors. The inner product of these two representation vectors is then calculated and used as a relevance score. The relevance scores are then used to sort the data, identifying the unstructured role information or the concatenated structured role information that is most relevant to the conversation data.

[0105] In specific implementation, if all relevance scores do not reach the preset relevance score threshold, it is determined that the conversation data does not involve personality information.

[0106] Compared to templated character information that represents the character's basic personality information, dialogue-related character information is more closely linked to the dialogue data currently input by the user and is more focused.

[0107] Step S330: Identify the user's emotions based on the conversation data to obtain an emotion recognition result, and retrieve the prefix of the reply data corresponding to the emotion recognition result from the character language style information.

[0108] In some exemplary embodiments, a Bert classifier is used to perform user emotion recognition.

[0109] In a specific implementation, after the conversation data is input into the Bert classifier, the Bert classifier outputs at least one of the emotion recognition results such as sadness, happiness, anger, etc.

[0110] According to the obtained emotion recognition result, the prefix of the reply data corresponding to the emotion recognition result is retrieved in the character language style information. For example, if Wuqing's reaction word when feeling "sad" is "gentle words of comfort", then the default prefix of the reply data "Wuqing said:" is replaced with "Wuqing said gentle words of comfort:" and used as the prefix of the determined reply data.

[0111] Step S340: Use the templated role information, the dialogue-related role information, and the prefix of the reply data as the guide data.

[0112] In some exemplary embodiments, the guide data is obtained by concatenating the templated role information, the dialogue-related role information, and a prefix of the reply data.

[0113] As an example, the templated role information is:

[0114] "Wuqing, a young man, is the leader of the Four Great Constables, a descendant of the Divine Marquisate, and the player's senior brother. He enjoys gardening and drinking tea."

[0115] The relevant character information for the dialogue is:

[0116] "Iron Hand is Wuqing's second apprentice brother, with extraordinary internal strength";

[0117] The reply data is prefixed with:

[0118] "Wuqing nodded gently and said:"

[0119] Then, the bootstrap data is:

[0120] "Wuqing, a young man, is the leader of the Four Famous Constables, a descendant of the Shenhou Mansion, the player's senior brother, who likes to grow flowers and drink tea; Tieshou is Wuqing's second junior brother, who has extraordinary internal strength; Wuqing nodded gently and said:".

[0121] Step S240: Input the dialogue data and the guidance data into a pre-built dialogue model to obtain response data output by the dialogue model.

[0122] In some exemplary embodiments, the conversation data and the guidance data are concatenated to obtain concatenated data, and the concatenated data is input into a pre-built conversation model.

[0123] As an example, the conversation data is:

[0124] "The player said: "Brother Tieshou is so handsome!""

[0125] The bootstrap data is:

[0126] "Wuqing, a young man, is the leader of the Four Great Constables, a descendant of the Divine Marquisate, and the player's senior brother. He enjoys gardening and drinking tea. Tieshou is Wuqing's second junior brother, possessing exceptional internal strength. Wuqing nodded gently and said, "

[0127] The spliced data is:

[0128] "Wuqing, a young man, is the leader of the Four Famous Constables, a descendant of the Shenhou Mansion, the player's senior brother, who likes to grow flowers and drink tea. The player said, "Senior Brother Tieshou is so handsome!"; Tieshou is Wuqing's second junior brother, with extraordinary internal strength; Wuqing nodded gently and said:".

[0129] In some exemplary embodiments, a method for constructing a dialogue model includes:

[0130] Constructing a sample set including a plurality of samples; wherein the samples include: sample data and label data; the sample data includes training dialogue data and guidance data; the label data includes training response data corresponding to the training dialogue data and guidance data;

[0131] Based on the sample set, the dialogue model is constructed and trained using a predetermined machine learning algorithm.

[0132] Among them, the predetermined machine learning algorithm can be selected from one or more of GPT2, naive Bayes algorithm, decision tree algorithm, support vector machine algorithm, kNN algorithm, neural network algorithm, deep learning algorithm and logistic regression algorithm.

[0133] In some exemplary embodiments, the present invention further comprises:

[0134] Inputting the dialogue data and the guidance data into the dialogue model to obtain a response data set, wherein the response data set includes a plurality of candidate response data;

[0135] Whether the alternative reply data conflicts with the conversation data is determined in descending order of confidence until alternative reply data that does not conflict with the conversation data is obtained, and the alternative reply data is output as the reply data.

[0136] During specific implementation, the guide data and the reply data are input into a pre-built conflict detection model to obtain a conflict detection result. In response to determining that the conflict detection result is that there is a conflict between the guide data and the reply data, the alternative reply data with the next confidence order in the reply data set is continued to be detected until alternative reply data that does not conflict with the guide data is obtained, and the alternative reply data is used as the determined reply data.

[0137] As an example, the bootstrap data is:

[0138] "Ruthless and Iron Hand are good brothers";

[0139] The reply data is:

[0140] "Wuqingdao: I have long heard of the name of Iron Hand Hero, but unfortunately I have never met him";

[0141] Then, there is a conflict between the guidance data and the response data.

[0142] In some exemplary embodiments, a decoding length parameter used by the dialogue model to generate the reply data is determined based on the character's language style information.

[0143] For example, the decoding length parameter corresponding to "few words" is smaller than the default decoding length parameter.

[0144] In some exemplary embodiments, for self-proclaimed names, catchphrases, and banned words in the character's language style information:

[0145] For replies containing banned words, filter them directly and use them in the future; for common expressions such as self-introduction and catchphrases, perform regular expression matching and replacement, for example: replace "I" with "Zaixia" and "Oh" with "Haha".

[0146] As can be seen from the above, the robot reply method provided by the embodiment of the present disclosure includes: obtaining conversation data input by a user and determining the user's conversation partner; obtaining personality data of the conversation partner; processing the personality data based on the conversation data to obtain guidance data; inputting the conversation data and the guidance data into a pre-built conversation model to obtain reply data output by the conversation model. The present disclosure processes the personality data of the conversation partner based on the conversation data input by the user to obtain guidance data for guiding the robot's reply, and uses this guidance data together with the conversation data to generate reply data, so that the reply data conforms to the personality of the conversation partner, while reducing human resource costs.

[0147] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0148] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0149] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a robot reply device.

[0150] refer to Figure 5 , the robot reply device comprises:

[0151] The conversation data acquisition module 510 is configured to acquire conversation data input by the user and determine the conversation partner of the user.

[0152] The personality data acquisition module 520 is configured to acquire the personality data of the dialogue partner.

[0153] In some exemplary embodiments, structured role information, unstructured role information, and role language style information of the dialogue object are obtained as the character setting data.

[0154] The guidance data acquisition module 530 is configured to process the character data according to the conversation data to obtain guidance data.

[0155] In some exemplary embodiments, the guidance data acquisition module 530 is specifically configured to:

[0156] Filling a pre-built role information template according to the structured role information to obtain basic role information;

[0157] Retrieving the structured role information and the unstructured role information according to the dialogue data to obtain dialogue-related role information;

[0158] Identifying the user's emotions based on the conversation data to obtain an emotion recognition result, and retrieving a prefix of the reply data corresponding to the emotion recognition result from the character language style information;

[0159] The basic role information, the dialogue-related role information, and a prefix of the reply data are used as the guide data.

[0160] In some exemplary embodiments, the role information template is a cloze template for filling in a text string; the guiding data acquisition module 530 is specifically configured to:

[0161] Determine a task type corresponding to the dialogue data, and fill in the role information template corresponding to the task type according to the structured role information.

[0162] In some exemplary embodiments, the guidance data acquisition module 530 is specifically configured to:

[0163] The structured role information is spliced according to a pre-built structured role information splicing template to obtain spliced structured role information.

[0164] In some exemplary embodiments, the guidance data acquisition module 530 is specifically configured to:

[0165] The unstructured role information and the spliced structured role information are retrieved according to the conversation data, and the unstructured role information and the spliced structured role information whose correlation with the conversation data exceeds a correlation threshold are used as the conversation-related role information.

[0166] The reply data acquisition module 540 is configured to input the dialogue data and the guidance data into a pre-built dialogue model to obtain reply data output by the dialogue model.

[0167] In some exemplary embodiments, the reply data acquisition module 540 is specifically configured to:

[0168] The dialogue data and the guide data are spliced to obtain spliced data, and the spliced data is input into the dialogue model to obtain the response data output by the dialogue model.

[0169] In some exemplary embodiments, the reply data acquisition module 540 is specifically configured to:

[0170] Inputting the dialogue data and the guidance data into the dialogue model to obtain a response data set, wherein the response data set includes a plurality of candidate response data;

[0171] Whether the alternative reply data conflicts with the conversation data is determined in descending order of confidence until alternative reply data that does not conflict with the conversation data is obtained, and the alternative reply data is output as the reply data.

[0172] In some exemplary embodiments, the reply data acquisition module 540 is specifically configured to:

[0173] Determine, based on the character's language style information, a decoding length parameter used by the dialogue model to generate the reply data.

[0174] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0175] The device of the above embodiment is used to implement the corresponding robot reply method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0176] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the robot reply method described in any of the above embodiments is implemented.

[0177] Figure 6 10 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.

[0178] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0179] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0180] The input / output interface 1030 is used to connect an input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0181] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).

[0182] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0183] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0184] The electronic device of the above embodiment is used to implement the corresponding robot reply method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0185] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the robot reply method described in any of the above embodiments.

[0186] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid-state drives (SSDs)), etc.

[0187] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the robot reply method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0188] Those skilled in the art will appreciate that embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media containing computer-readable program code.

[0189] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive examples) of computer-readable storage media can include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0190] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0191] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0192] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0193] It should be understood that each block in the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine. These computer program instructions are executed by the computer or other programmable data processing device to produce a device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0194] These computer program instructions can also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner. In this way, the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0195] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0196] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the operations shown must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.

[0197] The use of the verbs "comprise", "include" and their conjugations in the application documents does not exclude the presence of elements or steps other than those stated in the application documents. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.

[0198] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined to benefit. Such division is merely for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims

1. A robot reply method, characterized in that: include: Acquire conversation data input by the user and determine the conversation partner of the user; Acquire structured role information, unstructured role information, and role language style information of the dialogue partner as personality data of the dialogue partner; Filling a pre-built role information template according to the structured role information to obtain basic role information; Retrieving the structured role information and the unstructured role information according to the dialogue data to obtain dialogue-related role information; Identifying the user's emotions based on the conversation data to obtain an emotion recognition result, and retrieving a prefix of the reply data corresponding to the emotion recognition result from the character language style information; Using the basic role information, the dialogue-related role information, and the prefix of the reply data as guide data; The dialogue data and the guidance data are input into a pre-built dialogue model to obtain response data output by the dialogue model.

2. The method according to claim 1, characterized in that The role information template is a cloze template for filling in text strings; Filling a pre-built role information template according to the structured role information to obtain basic role information includes: Determine a task type corresponding to the dialogue data, and fill in the role information template corresponding to the task type according to the structured role information.

3. The method according to claim 1, characterized in that Before retrieving the structured role information and the unstructured role information according to the conversation data, the method further includes: The structured role information is spliced according to a pre-built structured role information splicing template to obtain spliced structured role information.

4. The method according to claim 3, characterized in that The step of retrieving the structured role information and the unstructured role information based on the dialogue data to obtain dialogue-related role information includes: The unstructured role information and the spliced structured role information are retrieved according to the conversation data, and the unstructured role information and the spliced structured role information whose correlation with the conversation data exceeds a correlation threshold are used as the conversation-related role information.

5. The method according to claim 1, wherein The step of inputting the dialogue data and the guidance data into a pre-built dialogue model to obtain response data output by the dialogue model includes: The dialogue data and the guide data are spliced to obtain spliced data, and the spliced data is input into the dialogue model to obtain the response data output by the dialogue model.

6. The method according to claim 1, characterized in that The step of inputting the dialogue data and the guidance data into a pre-built dialogue model to obtain response data output by the dialogue model includes: Inputting the dialogue data and the guidance data into the dialogue model to obtain a response data set, wherein the response data set includes a plurality of candidate response data; Whether the alternative reply data conflicts with the conversation data is determined in descending order of confidence until alternative reply data that does not conflict with the conversation data is obtained, and the alternative reply data is output as the reply data.

7. The method according to claim 1, characterized in that Also includes: Determine, based on the character's language style information, a decoding length parameter used by the dialogue model to generate the reply data.

8. A robot recovery device, characterized in that: include: A conversation data acquisition module is configured to acquire conversation data input by a user and determine a conversation partner of the user; a character data acquisition module configured to acquire structured character information, unstructured character information, and character language style information of the dialogue partner as character data of the dialogue partner; A guide data acquisition module is configured to fill a pre-built role information template according to the structured role information to obtain basic role information; Retrieving the structured role information and the unstructured role information according to the dialogue data to obtain dialogue-related role information; Identifying the user's emotions based on the conversation data to obtain an emotion recognition result, and retrieving a prefix of the reply data corresponding to the emotion recognition result from the character language style information; Using the basic role information, the dialogue-related role information, and the prefix of the reply data as guide data; The reply data acquisition module is configured to input the dialogue data and the guidance data into a pre-built dialogue model to obtain the reply data output by the dialogue model.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Man-machine conversation method and device, electronic equipment and storage medium

    CN112948565A

  • Question and answer data processing method and device, computer device and storage medium

    CN113157863A

  • Dialogue reply method and device, dialogue model training method and device, and storage medium

    CN113378583A