Dialogue generation method, electronic equipment and system

By adaptively adjusting the dialogue style based on dialogue data in the dialogue system, the problem of fixed dialogue style in the prior art is solved, and higher user satisfaction and experience are achieved.

CN119149678APending Publication Date: 2024-12-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310709511.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing dialogue system adopts a common language model, resulting in a fixed dialogue style, which cannot meet users' personalized needs for dialogue style and cannot be adjusted based on users' real-time feedback.

Method used

By inferring the conversation style that users like based on dialogue data during the conversation process, and adaptively adjust it, the style enhancement module and scoring model generate style scores based on user replies, and the conversation style is updated in real time to meet users' personalized needs.

Benefits of technology

The dialogue system is realized to better adapt to the needs of different users for different dialogue styles, improve users' user experience and satisfaction, and continuously optimize dialogue style through online model updates to meet the changing needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149678A_ABST
    Figure CN119149678A_ABST
Patent Text Reader

Abstract

The invention provides a dialogue generation method, electronic equipment and a dialogue generation system, and relates to the technical field of artificial intelligence. In the dialogue process, the dialogue style liked by the user can be speculated based on the dialogue data, and the dialogue style is adaptively adjusted to meet the personalized requirements of the user. The method comprises the steps that the electronic equipment responds to an obtained state vector, and a first dialogue style corresponding to the state vector is determined; and receiving a user reply, wherein the user reply corresponds to a reply of the first dialogue style output by the server. According to the user reply, a style score is generated, the first dialogue style is adjusted according to the style score, a second dialogue style is generated, and the style score is used for indicating the satisfaction degree of the user to the first dialogue style. The electronic device sends a style guidance to the server, the style guidance being used to instruct the server to output a reply to the second dialogue style.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a dialogue generation method, electronic device, and system. Background Art

[0002] With the development of artificial intelligence technology, dialogue systems are increasingly being used in daily life and business. For example, a dialogue system receives a math problem input by a user and can directly output the answer to the math problem.

[0003] However, because current dialogue systems usually use a general language model, the dialogue style of the dialogue system's responses is fixed and cannot meet the user's personalized needs for dialogue style. For example, in response to a math problem input by a user, the dialogue system can output a detailed answer to the math problem, but the user may need a simple and direct answer without detailed and redundant solution steps, and the current dialogue system cannot meet the user's personalized needs. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a dialogue generation method, electronic device and system. The technical solution provided by the present application, during the dialogue process, infers the dialogue style preferred by the user based on the dialogue data, and adaptively adjusts the dialogue style to meet the personalized needs of the user.

[0005] In order to achieve the above technical objectives, this application provides the following technical solutions:

[0006] In a first aspect, a method for generating a conversation is provided, which is applied to an electronic device. The method includes: in response to an acquired state vector, determining a first conversation style corresponding to the state vector. Receiving a user reply, the user reply corresponding to a reply of the first conversation style output by a server. Generating a style score based on the user reply, the style score is used to indicate the user's satisfaction with the first conversation style. Adjusting the first conversation style based on the style score to generate a second conversation style. Sending a style guide to the server, the style guide is used to instruct the server to output a reply of the second conversation style.

[0007] In this way, by analyzing and learning the current conversation style and user responses, the personalized output of the server-side conversation system can be achieved. This enables the conversation system to better adapt to the needs and preferences of different users for different conversation styles, thereby improving the user experience and satisfaction.

[0008] According to the first aspect, before determining the first conversation style corresponding to the state vector in response to the acquired state vector, the method further includes: receiving a conversation record sent by a server, and generating a state vector according to the conversation record, the state vector being used to indicate the current conversation state.

[0009] In some embodiments, the conversation record is a historical conversation record of the interaction between the server and the user. For example, the conversation record includes N conversation data before receiving the last reply from the user, or includes conversation data generated within a preset time period before the current time.

[0010] In this way, by analyzing and learning the user's conversation records, the current conversation style of the conversation system is determined, so that the conversation style of the conversation system can be improved based on the conversation style.

[0011] According to the first aspect, or any implementation of the first aspect above, in response to the acquired state vector, determining a first dialogue style corresponding to the state vector includes: in response to the state vector, selecting a first dialogue style word corresponding to the state vector in a preset action space, the first dialogue style word being used to represent the first dialogue style.

[0012] Optionally, the action space includes a plurality of dialogue style words for describing the dialogue style. The dialogue style words may be determined in a variety of ways, for example, the dialogue style words include dialogue style words corresponding to the user's commonly used dialogue style, dialogue style words that are all used to describe the dialogue style, dialogue style words corresponding to the dialogue style with a usage frequency higher than a preset threshold, etc., which is not limited in the embodiments of the present application.

[0013] According to the first aspect, or any implementation of the first aspect above, adjusting the first dialogue style according to the style score to generate the second dialogue style includes: selecting a second dialogue style word corresponding to the first dialogue style word in the action space according to the style score, the second dialogue style word being a synonym or antonym of the first dialogue style word, and the second dialogue style word being used to represent the second dialogue style.

[0014] According to the first aspect, or any implementation of the first aspect above, the style score belongs to the score range [-1,1], wherein the positive score is used to indicate the probability of the user's positive emotion for the first dialogue style, and the negative score is used to indicate the probability of the user's negative emotion for the first dialogue style.

[0015] Exemplarily, the dialogue system on the server side inputs the state vector into the style enhancement module in the electronic device. The agent determines the current dialogue state through the state vector, and selects dialogue style words in the action space in combination with the user preferences that it has learned. For example, the dialogue style words selected by the style enhancement module in the action space are emotional and long text. The dialogue system can obtain the user's reply and send the user's reply to the scoring model. The scoring model can construct a reply vector based on the user's reply and output a style score, for example, a style score of -1.

[0016] Afterwards, the scoring model can feed back the style score to the style enhancement module as a reward after the style enhancement module performs an action. The style enhancement module updates parameters based on the acquired style score to achieve learning, and then reselects dialogue style words in the action space based on the current state vector to trigger the creation of new style guidance to guide the dialogue system to perform actions. For example, if the style enhancement module determines that the user is dissatisfied with the current dialogue style based on the style score, it can reselect dialogue style words in the action space, such as rational and short text, to instruct the dialogue system to modify the current dialogue style accordingly.

[0017] In this way, the electronic device can adjust the current conversation style according to the user's reply, so that the adjusted conversation style can better meet the user's needs.

[0018] According to the first aspect, or any implementation of the first aspect above, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0019] In this way, during the conversation, based on the multimodal capabilities of the system, it is possible to process multimodal responses from users, such as simultaneously processing responses from users in multiple input modes, such as text and voice. This improves the accuracy of user response ratings and makes up for the shortcoming that it is difficult to judge user satisfaction based solely on text responses.

[0020] According to the first aspect, or any implementation of the first aspect above, the electronic device includes a style enhancement module, the style enhancement module includes a style guidance model and a style scoring model, the style guidance model is a reinforcement learning model, and is used to generate a second dialogue style. The style scoring model is used to generate a style score. The method also includes: updating the style guidance model according to the style score.

[0021] In this way, through online model updates, model training and optimization can be continuously performed as the dialogue system is used, and users' needs for changes in dialogue style can be met based on real-time feedback from users.

[0022] In a second aspect, a method for generating a conversation is provided, which is applied to a server. The method includes: sending a conversation record to an electronic device, the conversation record including a reply in a first conversation style output by the server. Receiving a style guide sent by the electronic device. In response to the style guide, outputting a reply in a second conversation style corresponding to the user's reply, the second conversation style being a conversation style determined by the electronic device after adjusting the first conversation style according to the user's reply.

[0023] According to the second aspect, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0024] The technical effects corresponding to the second aspect and any implementation method of the second aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.

[0025] In a third aspect, a conversation generation device is provided. The device includes: a style enhancement module and a feedback module. The style enhancement module is used to determine a first conversation style corresponding to the state vector in response to the acquired state vector. The feedback module is used to receive a user reply, and the user reply corresponds to a reply of the first conversation style output by the server. The style enhancement module is used to generate a style score based on the user reply, and the style score is used to indicate the user's satisfaction with the first conversation style. The style enhancement module is used to adjust the first conversation style according to the style score to generate a second conversation style. The style enhancement module is used to send style guidance to the server, and the style guidance is used to instruct the server to output a reply of the second conversation style.

[0026] Optionally, the server comprises a dialog system.

[0027] According to the third aspect, the style enhancement module is further used to receive the conversation record sent by the server and to generate a state vector according to the conversation record, the state vector being used to indicate the current conversation state.

[0028] According to the third aspect, or any implementation of the third aspect above, the style enhancement module is used to select a first dialogue style word corresponding to the state vector in a preset action space in response to the state vector, and the first dialogue style word is used to represent the first dialogue style.

[0029] According to the third aspect, or any implementation of the third aspect above, the style enhancement module is used to select a second dialogue style word corresponding to the first dialogue style word in the action space according to the style score, the second dialogue style word is a synonym or antonym of the first dialogue style word, and the second dialogue style word is used to represent a second dialogue style.

[0030] According to the third aspect, or any implementation of the third aspect above, the style score belongs to the score range [-1,1], where the positive score is used to indicate the probability of the user's positive emotion for the first dialogue style, and the negative score is used to indicate the probability of the user's negative emotion for the first dialogue style.

[0031] According to the third aspect, or any implementation of the third aspect, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0032] According to the third aspect, or any implementation of the third aspect, the style enhancement module includes a style guidance model and a style scoring model, the style guidance model is a reinforcement learning model, and is used to generate the second dialogue style, and the style scoring model is used to generate a style score. The style enhancement module is further used to update the style guidance model according to the style score.

[0033] In a fourth aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device executes: in response to the acquired state vector, determine the first dialogue style corresponding to the state vector. Receive a user reply, the user reply corresponds to the reply of the first dialogue style output by the server. Generate a style score based on the user reply, the style score is used to indicate the user's satisfaction with the first dialogue style. Adjust the first dialogue style based on the style score to generate a second dialogue style. Send style guidance to the server, the style guidance is used to instruct the server to output a reply of the second dialogue style.

[0034] According to the fourth aspect, when the processor reads the computer instruction from the memory, the electronic device is also caused to execute: receiving the conversation record sent by the server, and generating a state vector according to the conversation record, the state vector being used to indicate the current conversation state.

[0035] According to the fourth aspect, or any implementation of the fourth aspect above, in response to the acquired state vector, determining a first dialogue style corresponding to the state vector includes: in response to the state vector, selecting a first dialogue style word corresponding to the state vector in a preset action space, the first dialogue style word being used to represent the first dialogue style.

[0036] According to the fourth aspect, or any implementation of the fourth aspect above, adjusting the first dialogue style according to the style score to generate the second dialogue style includes: selecting a second dialogue style word corresponding to the first dialogue style word in the action space according to the style score, the second dialogue style word being a synonym or antonym of the first dialogue style word, and the second dialogue style word being used to represent the second dialogue style.

[0037] According to the fourth aspect, or any implementation of the fourth aspect above, the style score belongs to the score range [-1,1], where the positive score is used to indicate the probability of the user's positive emotion for the first dialogue style, and the negative score is used to indicate the probability of the user's negative emotion for the first dialogue style.

[0038] According to the fourth aspect, or any implementation of the fourth aspect, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0039] According to the fourth aspect, or any implementation of the fourth aspect above, the electronic device includes a style enhancement module, the style enhancement module includes a style guidance model and a style scoring model, the style guidance model is a reinforcement learning model, used to generate a second dialogue style, and the style scoring model is used to generate a style score. When the processor reads computer instructions from the memory, it also enables the electronic device to execute: updating the style guidance model according to the style score.

[0040] The technical effects corresponding to the fourth aspect and any one of the implementation methods of the fourth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0041] In a fifth aspect, a server is provided. The server includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the server executes: sending a conversation record to an electronic device, the conversation record includes a reply in a first conversation style output by the server. Receive style guidance sent by the electronic device. In response to the style guidance, output a reply in a second conversation style corresponding to the user's reply, the second conversation style being a conversation style determined by the electronic device after adjusting the first conversation style according to the user's reply.

[0042] According to the fifth aspect, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0043] The technical effects corresponding to the fifth aspect and any one of the implementation methods of the fifth aspect can be found in the technical effects corresponding to the above-mentioned second aspect and any one of the implementation methods of the second aspect, and will not be repeated here.

[0044] In a sixth aspect, a dialogue generation system is provided, the system comprising an electronic device and a server. The electronic device is used to: determine a first dialogue style corresponding to the state vector in response to the acquired state vector. Receive a user reply, the user reply corresponds to the reply of the first dialogue style output by the server. Generate a style score based on the user reply, the style score is used to indicate the user's satisfaction with the first dialogue style. Adjust the first dialogue style based on the style score to generate a second dialogue style. Send style guidance to the server. The server is used to: receive the style guidance sent by the electronic device. In response to the style guidance, output a reply of the second dialogue style corresponding to the user reply.

[0045] According to the sixth aspect, the server is further used to send the conversation record to the electronic device. The electronic device is further used to: receive the conversation record sent by the server. According to the conversation record, generate a state vector, the state vector is used to indicate the current conversation state.

[0046] According to the sixth aspect, or any implementation of the sixth aspect above, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0047] According to the sixth aspect, or any implementation of the sixth aspect above, in response to the acquired state vector, determining a first dialogue style corresponding to the state vector includes: in response to the state vector, selecting a first dialogue style word corresponding to the state vector in a preset action space, the first dialogue style word being used to represent the first dialogue style.

[0048] According to the sixth aspect, or any implementation of the sixth aspect above, the electronic device is also used to: select a second dialogue style word corresponding to the first dialogue style word in the action space according to the style score, the second dialogue style word is a synonym or antonym of the first dialogue style word, and the second dialogue style word is used to represent a second dialogue style.

[0049] According to the sixth aspect, or any implementation of the sixth aspect above, the style score belongs to the score range [-1,1], where the positive score is used to indicate the probability of the user's positive emotion for the first dialogue style, and the negative score is used to indicate the probability of the user's negative emotion for the first dialogue style.

[0050] According to the sixth aspect, or any implementation of the sixth aspect, the electronic device includes a style enhancement module, the style enhancement module includes a style guidance model and a style scoring model, the style guidance model is a reinforcement learning model, and is used to generate a second dialogue style, and the style scoring model is used to generate a style score. The electronic device is further used to: update the style guidance model according to the style score.

[0051] The technical effects corresponding to the sixth aspect and any one of the implementation methods of the sixth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0052] In a seventh aspect, an electronic device is provided, which has the function of implementing the dialog generation method described in the first aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0053] The technical effects corresponding to the seventh aspect and any one of the implementation methods of the seventh aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0054] In an eighth aspect, a server is provided, which has the function of implementing the dialog generation method described in the second aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0055] The technical effects corresponding to the eighth aspect and any one of the implementation methods of the eighth aspect can be found in the technical effects corresponding to the above-mentioned second aspect and any one of the implementation methods of the second aspect, and will not be repeated here.

[0056] In a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by an electronic device, the electronic device executes the method of the first aspect or any one of the implementations of the first aspect.

[0057] The technical effects corresponding to the ninth aspect and any one of the implementation methods of the ninth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0058] In a tenth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or codes), and when the computer program is executed by a server, the server executes the method of the second aspect or any one of the implementations of the second aspect.

[0059] The technical effects corresponding to the tenth aspect and any one of the implementation methods of the tenth aspect can be found in the technical effects corresponding to the above-mentioned second aspect and any one of the implementation methods of the second aspect, and will not be repeated here.

[0060] In an eleventh aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the method in the first aspect or any one of the embodiments of the first aspect.

[0061] The technical effects corresponding to the eleventh aspect and any one of the implementation methods in the eleventh aspect can be referred to the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods in the first aspect, and will not be repeated here.

[0062] In a twelfth aspect, a computer program product is provided. When the computer program product runs on a server, the server executes the method in the second aspect or any one of the implementations of the second aspect.

[0063] The technical effects corresponding to the twelfth aspect and any one of the implementation methods of the twelfth aspect can be found in the technical effects corresponding to the above-mentioned second aspect and any one of the implementation methods of the second aspect, and will not be repeated here.

[0064] In the thirteenth aspect, a circuit system is provided, the circuit system includes a processing circuit, the processing circuit is configured to execute the method of the first aspect or any one of the embodiments of the first aspect; or, the processing circuit is configured to execute the method of the second aspect or any one of the embodiments of the second aspect.

[0065] The technical effects corresponding to the thirteenth aspect and any one of the implementation methods of the thirteenth aspect can be referred to the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0066] In the fourteenth aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any one of the embodiments of the first aspect; or, the at least one processor executes the method of the second aspect or any one of the embodiments of the second aspect.

[0067] The technical effects corresponding to the fourteenth aspect and any one of the implementation methods of the fourteenth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 A flowchart of a method for generating a dialogue based on a reinforcement learning network provided in an embodiment of the present application;

[0069] Figure 2 A flowchart of a method for generating a dialogue based on a user personality code provided in an embodiment of the present application;

[0070] Figure 3 A schematic diagram of a communication system to which the conversation generation method provided in an embodiment of the present application is applied;

[0071] Figure 4 A schematic diagram of the hardware structure of a server provided in an embodiment of the present application;

[0072] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0073] Figure 6 A schematic diagram of the overall flow of the conversation generation method provided in an embodiment of the present application;

[0074] Figure 7 A schematic diagram of system deployment for the application of the dialogue generation method provided in an embodiment of the present application;

[0075] Figure 8 A schematic diagram of a process for generating and updating a dialogue style provided in an embodiment of the present application;

[0076] Fig. 9 A schematic diagram of the reinforcement learning process in the process of implementing the dialogue generation method provided in the embodiment of the present application;

[0077] Fig.10 A flow chart of a method for generating a dialogue according to an embodiment of the present application;

[0078] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0079] Fig.12 A schematic diagram of the server structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two).

[0081] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0082] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0083] In some embodiments, the dialogue system is increasingly widely used in daily life and business fields, and users can obtain answers to questions through the dialogue system.

[0084] For example, a user inputs a math problem into the dialogue system: There are chickens and rabbits in the same cage, with 40 heads on top and 100 feet on the bottom. How many chickens and rabbits are there? The dialogue system outputs the following answer: Assuming the number of chickens is x and the number of rabbits is y, the question can be listed as the following two equations: x+y=40 (40 heads on top), 2x+4y=100 (100 feet on the bottom); by solving these two equations, the number of chickens and rabbits can be found. Multiply both sides of the first equation by 2 to get 2x+2y=80, subtract it from the second equation, eliminate the coefficient of x, and get 2y=20. Therefore, y=10, substitute it into the first equation, and get x+10=40, so x=30. Therefore, the number of chickens is 30 and the number of rabbits is 10.

[0085] It can be seen that, because the current dialogue system usually adopts a general language model, the dialogue style of the dialogue system's response is fixed and cannot meet the user's personalized needs for dialogue style. For example, in the above example, for the math problem input by the user, the dialogue system can output a detailed answer to the math problem, but the user may need a simple and direct answer without detailed and redundant solution steps, and the current dialogue system cannot meet the user's personalized needs.

[0086] In this regard, the user needs to clearly set the personality and response style of the dialogue system. For example, if the user sets the personality and response style of the dialogue system to be simple and direct, and avoid redundancy, then the user enters the math problem in the above example again, and the answer output by the dialogue system is: the number of chickens is 30, and the number of rabbits is 10. It can be seen that the answer output this time meets the user's personalized needs.

[0087] However, if the user is not familiar with how to set up the dialogue system, or cannot clearly identify the personality and response style he or she desires, he or she will not be able to obtain satisfactory personalized services.

[0088] Some examples include Figure 1 As shown in the figure, reinforcement learning is applied to the dialogue system. By obtaining the user's historical dialogue data, the historical dialogue data is used as a simulated user dialogue sample to perform the dialogue system training process and obtain the iteratively trained reinforcement learning network. Afterwards, in the application process of the dialogue system, the actual user dialogue information is input into the trained reinforcement learning network to output a response that meets the user's personalized needs.

[0089] In the above method, although the dialogue system can output a response that matches the style of the user's historical dialogue data based on the user's actual input to meet the user's personalized needs. However, the training process of the dialogue system depends on the user's historical dialogue data and does not model the user's current dialogue data. Therefore, it is impossible to understand and parse the user's real-time reply, and lacks understanding of the user's response. Moreover, the fixed dialogue system can no longer be improved based on the user's real-time reply. If the user's style changes, it cannot meet the user's personalized needs in real time. In addition, the training process of the dialogue system is generally executed on the cloud side and depends on the user's historical dialogue data, which poses a risk of exposing the user's relevant information and portrait.

[0090] In other examples, such as Figure 2 As shown in the figure, the user personality encoding module encodes the user personality according to the dialogue context and the user personality triple description information, and outputs the user personality code. Combined with the user's historical responses, the candidate response set for the dialogue context is retrieved from the training data. Afterwards, the personalized matching module scores the candidate responses in the candidate response set according to the user personality code, and selects the response with a higher score as the prediction result of this response. In this way, the dialogue system can achieve personalized responses without stereotyped responses.

[0091] In the above method, the dialogue system ensures the consistency of the personality of the responses before and after the dialogue based on the historical dialogue information. However, the personality of the dialogue system is not flexible enough. For example, if the personality described by the initialized user personality triplet is not the personality preferred by the user, even if the dialogue system replies with the same personality before and after, it still does not meet the user's personalized needs. In addition, the dialogue system needs to obtain the user's personality triplet description information from other channels in advance, which increases the technical cost and makes the subsequent response style of the dialogue system limited to the obtained user personality triplet description information, which is no longer applicable to other scenarios. In addition, the response output by the dialogue system meets the user's personality, but the user's personality and the personality of the dialogue system response that the user expects to obtain may be inconsistent, and thus cannot meet the user's personalized response needs.

[0092] In this regard, an embodiment of the present application provides a conversation generation method, which, during a conversation, infers the conversation style preferred by the user based on the conversation data, and adaptively adjusts the conversation style to meet the user's personalized needs.

[0093] For example, Figure 3 A schematic diagram of a communication system to which the conversation generation method provided in the embodiment of the present application is applied. Figure 3 As shown, the communication system includes a server 100 and an electronic device 200.

[0094] Optionally, the server 100 may be a device or server with computing functions such as a cloud server or a network server. The server may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.

[0095] Optionally, the electronic device 200 may be, for example, a mobile phone, a tablet computer, a laptop computer, a smart screen, a wearable device, a vehicle terminal, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device or other terminal device, and the operating system installed in the electronic device 200 includes but is not limited to: Or other operating systems. This application does not limit the specific type of the electronic device 200 or the installed operating system.

[0096] In some embodiments, the above communication system is applied in dialogue scenarios such as intelligent customer service, intelligent voice assistant, chat robot, etc. In these scenarios, the user interacts with the robot or dialogue system, and the robot or dialogue system usually needs to generate a response to the user.

[0097] In some embodiments, while retaining the dialogue system of the cloud-side server 100, a style enhancement module is deployed in the terminal-side electronic device 200. The electronic device 200 uses the style enhancement module to guide the dialogue system to change the dialogue style according to the next reply input by the user on the electronic device 200 to the reply output by the dialogue system. In this way, while meeting the user's personalized dialogue style needs, the dialogue style of the dialogue system is updated in real time according to the user's reply, and the user's privacy is protected by collecting user information on the terminal side.

[0098] For example, Figure 4 1 shows the structure of the server 100. Figure 4 As shown, the server 100 includes at least one processor 401 , a communication line 402 , a memory 403 and at least one communication interface 404 . The memory 403 may also be included in the processor 401 .

[0099] The processor 401 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0100] The communication link 402 may include a pathway to transmit information between the above-mentioned components.

[0101] Communication interface 404, used to communicate with other devices. In the embodiment of the present application, the communication interface can be a module, a circuit, a bus, an interface, a transceiver or other device capable of realizing a communication function, used to communicate with other devices. Optionally, when the communication interface is a transceiver, the transceiver can be an independently arranged transmitter, which can be used to send information to other devices, and the transceiver can also be an independently arranged receiver, which is used to receive information from other devices. The transceiver can also be a component that integrates the functions of sending and receiving information, and the embodiment of the present application does not limit the specific implementation of the transceiver.

[0102] The memory 403 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage, magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a communication line 402. The memory may also be integrated with the processor.

[0103] The memory 403 is used to store computer-executable instructions for implementing the solution of the present application, and the execution is controlled by the processor 401. The processor 401 is used to execute the computer-executable instructions stored in the memory 403, thereby implementing the dialogue generation method provided in the following embodiment of the present application.

[0104] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, instructions, computer program or other names, which are not specifically limited in the embodiments of the present application.

[0105] In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 in.

[0106] In a specific implementation, as an embodiment, the server 100 may include multiple processors, such as Figure 4 401 and processor 407 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0107] It is understandable that the embodiments of the present application are as follows Figure 4The structure does not constitute the only limitation on the implementation of the structure of the server 100. In other embodiments of the present application, the server 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0108] For example, Figure 5 FIG. 2 shows a schematic diagram of the structure of the electronic device 200. Figure 5 As shown, the electronic device 200 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0109] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0110] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0111] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0112] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0113] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0114] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor, charger, flash, camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor through the I2C interface, so that the processor 110 communicates with the touch sensor through the I2C bus interface to realize the touch function of the electronic device 200.

[0115] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the electronic device 200. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the electronic device 200.

[0116] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 200, and can also be used to transfer data between the electronic device 200 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0117] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0118] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 200. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0119] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0120] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0121] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0122] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 200. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0123] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0124] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0125] In some embodiments, the antenna 1 of the electronic device 200 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0126] The electronic device 200 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0127] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-led, Micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device 200 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0128] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 200 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0129] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0130] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 200 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0131] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The electronic device 200 can use the audio module 170, such as music playing, recording, etc. The audio module 170 can include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.

[0132] In some embodiments, the electronic device 200 displays the reply sent by the dialogue system in the server 100 to the user's question through the display screen 194. Afterwards, the electronic device 200 can receive the reply input by the user. Optionally, the electronic device 200 can detect the reply input by the user on the display screen 194 through the touch sensor, receive the user's voice reply through the audio module, and other multiple replies. Afterwards, the electronic device generates a state vector according to the dialogue record sent by the server 100, and adjusts the dialogue style of the dialogue system according to the state vector and the user's reply. In this way, the dialogue style is adaptively adjusted according to the user's reply to meet the user's personalized needs for the dialogue style.

[0133] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0134] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 200 may receive key input and generate key signal input related to user settings and function control of the electronic device 200.

[0135] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of display screen 194. Different application scenarios (for example: time reminder, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects.

[0136] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0137] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 200 by inserting or removing the SIM card interface 195. The electronic device 200 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0138] In some embodiments, different users may have different requirements for the dialogue style of the dialogue system; the same user may have different requirements for the dialogue style of the dialogue system during dialogues at different times or of different dialogue types.

[0139] For example, user A's demand for the dialogue style of the dialogue system is humorous and interesting. User B's demand for the dialogue style of the dialogue system is serious and formal. For another example, as the user's age and experience increase, the user's demand for the dialogue style of the dialogue system changes. For another example, the user's demand for the dialogue style of mathematics, physics and other subject-related dialogues is simple and direct, avoiding redundancy; the demand for the dialogue style of life-related dialogues is vivid and vivid.

[0140] Based on this, the embodiments of the present application provide Figure 6 The process of a dialogue generation method shown in the figure, during the dialogue process, the style enhancement module updates the dialogue style used by the generated dialogue system according to the user's multi-modal response and the context of the input dialogue. Afterwards, the generated dialogue system generates a dialogue output according to the updated dialogue style, that is, outputs a reply. Afterwards, the user can make a multi-modal reply based on the output reply. In this way, through multiple rounds of the above process, the dialogue system outputs a reply that meets the updated dialogue style according to the real-time update of the dialogue style, so that the dialogue system outputs a reply that better meets the user's wishes, providing the user with a higher quality and personalized dialogue experience.

[0141] It should be noted that, for the sake of distinction, the embodiment of the present application describes the answer output by the dialogue system to the user's question as the reply of the dialogue system, and describes the user's answer or evaluation to the answer output by the dialogue system, or the next question input by the user alone as the user reply. It should be understood that the reply of the dialogue system can also be described as the reply, output, feedback, etc. of the dialogue system, and the user reply can also be described as the user reply, user feedback, user response, etc., which will not be described in detail below.

[0142] Optionally, the multimodal reply is used to indicate the reply of the user obtained by the dialogue system in multiple ways such as text and voice, or the multimodal reply obtained after the dialogue system converts the user's voice reply into a text reply, that is, the multimodal reply includes user reply information corresponding to multiple ways. Optionally, the style enhancement module can determine whether the user is satisfied with the reply of the previous round of dialogue system based on the emotional state, tone, speaking speed and other information of the user's reply. Optionally, during multiple rounds of dialogue, the user may also reply in a single way, and the style enhancement module can also adaptively adjust the dialogue style according to the user's reply, that is, the embodiment of the present application does not limit the user's reply to a multimodal reply. In some examples, multimodal replies can also be described as multimodal replies, and multimodality refers to information in multiple modes, including: text, audio, image, video, etc.

[0143] For example, in Figure 6 In the dialog box content shown by reference numeral 61, during the first round of dialogue, the dialogue input module receives the question input by the user and generates a reply according to the preset dialogue style, and then receives the reply input by the user again according to the reply. Afterwards, the dialogue system constructs the state according to the dialogue record and outputs a state vector, which is used to indicate the current dialogue style.

[0144] Afterwards, the style enhancement module generates a style guide based on the state vector and the user reply to adjust the dialogue style. Then, the generated dialogue system can generate a reply corresponding to the user reply and meeting the current dialogue style requirements based on the style guide and the user reply, and output the reply in the dialog box content as shown by reference numeral 62 through the dialogue output module.

[0145] Afterwards, the feedback module can also receive user replies for this round of replies, such as "The answer is too simple and not vivid." The feedback module feeds back the user's reply to the style enhancement module, so that the style enhancement module can adaptively adjust the conversation style according to the user's reply and generate corresponding style guidance. For example, the style enhancement module determines whether the user is satisfied with the conversation style corresponding to the state vector generated according to the current conversation record based on the style score corresponding to the user's reply, so as to determine the direction of adjusting the conversation style.

[0146] Through multiple rounds of user feedback, such as the dialog content shown by reference numeral 63, after the dialogue input module receives the user's reply "Tell me what Newton's first law is" in the Nth round, the state vector generated for the first N rounds of dialogue can be sent to the style enhancement module. The style enhancement module generates a reply in the dialog content shown by reference numeral 64 based on the user's reply and the state vector, and the reply meets the user's detailed and vivid dialogue style requirements.

[0147] In this way, after multiple rounds of update learning, the style enhancement module can learn the current user's conversation style preferences, thereby guiding the dialogue system to output responses that meet the user's conversation style requirements. This allows the dialogue style of responses to be adjusted according to user preferences, thereby improving user satisfaction.

[0148] In some embodiments, in order to save computing power of electronic devices, the dialogue system is generally deployed in a cloud server, and in order to protect user privacy, the style enhancement module used to adjust the dialogue style can be deployed in the end-side electronic device. In this way, by deploying the style enhancement module on the end side, the multimodal capability is used to ensure the accuracy of the answers output by the dialogue system and the flexible change of the dialogue style, and to protect user privacy. In addition, the style enhancement module deployed on the end side simplifies the access method and realizes plug-and-play without changing the original cloud-side dialogue system.

[0149] For example, Figure 7 As shown in FIG. 1 , the dialogue system deployed on the cloud side includes a dialogue input module, a generated dialogue system, and a dialogue output module. The style enhancement module deployed on the client side includes a style guidance model and a style scoring model.

[0150] When a conversation begins, the conversation input module constructs a state based on the current conversation record and sends the generated state vector to the style guidance model. The style guidance model determines the conversation style for the next reply based on the state vector and the user preferences that have been learned, and generates style guidance based on the conversation style.

[0151] Among them, the style guidance for large-scale pre-trained language models such as dialogue systems is, for example, a dialogue style prompt, which is a descriptive phrase used to guide large-scale pre-trained language models to complete tasks, and can activate specific tasks or capabilities. For example, the style guidance model sends the style guidance to the generated dialogue system in the cloud, and the generated dialogue system generates a dialogue response that meets the style guidance instructions based on the dialogue input sent by the dialogue input module and the acquired style guidance, and sends the dialogue response to the dialogue output module to output the response for this round of dialogue.

[0152] Afterwards, the dialogue system can receive the user's reply to the output answer, that is, obtain user feedback. Figure 7As shown, a feedback module is also deployed on the terminal side, which is used to receive user replies obtained by the dialogue system. The user reply can be a single-mode reply in pure text, or a multi-mode reply after converting the received voice into text.

[0153] Afterwards, the feedback module sends the obtained user replies to the style scoring model, which is used to analyze the user replies and determine the user's satisfaction with the current dialogue system's replies. For example, the style scoring model analyzes the user's emotions based on the text, voice, etc. in the user's multi-modal replies, and determines that the user is satisfied with the dialogue system's reply based on positive emotions, and determines that the user is dissatisfied with the dialogue system's reply based on negative emotions.

[0154] Afterwards, the style scoring model sends the determined user satisfaction to the style guidance model. The style guidance model generates a new style guidance based on the state vector obtained this time and the user satisfaction corresponding to the state vector, and sends the style guidance to the generative dialogue system in the cloud to update the generative dialogue system, so that the generative dialogue system outputs a response to the input of this round of dialogue according to the new style guidance, and the response matches the dialogue style indicated by the new style guidance, thereby completing another round of the dialogue system operation cycle.

[0155] In this way, the user responses are evaluated for satisfaction through the style scoring model deployed on the client side, so that the dialogue system can be updated online based on the satisfaction. After multiple rounds of iterative learning, the dialogue system can achieve an adaptive optimization of the dialogue style of the dialogue system.

[0156] In other embodiments, some end-side electronic devices with strong computing power can also deploy the dialogue system and the style enhancement module at the same time, so as to realize local operation and update of the dialogue system. Alternatively, the dialogue system and the style enhancement module can also be deployed on the cloud server at the same time, which is not limited in the embodiments of the present application.

[0157] In some embodiments, the style enhancement module may be implemented by a multimodal scoring model and a reinforcement learning model. For example, the multimodal model corresponds to Figure 7 The style scoring model in , the reinforcement learning model corresponds to Figure 7 The style guidance model in .

[0158] The multimodal scoring model is, for example, a bidirectional encoder representation from transformers (BERT), XLNet, etc. The multimodal scoring model is trained with a pre-labeled training set so that the multimodal scoring model can output a user satisfaction score based on the input user response to generate a style score.

[0159] The reinforcement learning model is, for example, an advantage actor-critic (A2C) model, a soft actor-critic (SAC) model, etc. The reinforcement learning model can determine the user's preferred dialogue style based on the acquired state vector and style score to generate style guidance, and in the process, update the reinforcement learning model, thereby updating the dialogue style of the dialogue system.

[0160] Optionally, the style score is obtained by, for example, scoring a binary classification problem. The multimodal scoring model outputs a style score in the interval [-1,1] based on the user's response. The style score can be used to describe the probability of a user's positive emotion and the probability of a user's negative emotion, so that the subsequent reinforcement learning model can determine the user's preferences based on the style score, such as whether the user is satisfied with the current conversation style, and the degree of satisfaction or dissatisfaction.

[0161] For example, Figure 8 As shown, the dialogue process includes a dialogue style generation process and a dialogue style update process. In the dialogue style update process, the multimodal scoring model outputs a corresponding style score according to the user's response and sends the style score to the agent. The agent is, for example, a reinforcement learning model. In addition, the agent determines the current dialogue style in the action space according to the state vector to generate the dialogue style of the historical dialogue, that is, to perform the dialogue style generation process. Afterwards, the agent adaptively adjusts the current dialogue style according to the acquired style score, determines a new dialogue style, and generates style guidance, that is, to complete the dialogue style update process.

[0162] Optionally, the action space includes a plurality of dialogue style words for describing the dialogue style. The dialogue style words may be determined in a variety of ways, for example, the dialogue style words include dialogue style words corresponding to the user's commonly used dialogue style, dialogue style words that are all used to describe the dialogue style, dialogue style words corresponding to the dialogue style with a usage frequency higher than a preset threshold, etc., which is not limited in the embodiments of the present application.

[0163] Alternatively, if Figure 8 As shown in the figure, during the conversation, after the dialogue system outputs the dialogue reply, it can also obtain the user's reply, thereby updating the dialogue record. After that, the dialogue system can send the updated dialogue record to the agent, and the agent can obtain the state vector corresponding to the dialogue record. For example, the agent constructs the state vector through the BERT language encoding model. Alternatively, after the dialogue system generates the state vector according to the updated dialogue record, it sends the state vector to the agent.

[0164] Optionally, the user reply is generally a response by the user to the reply output by the dialogue system in the form of text or voice. The user reply includes objective reply information and may also include the user's subjective emotions. For example, the multimodal scoring model can analyze and learn the user's emotional state, tone, speaking speed and other information corresponding to the user reply, and output a more accurate style score for the user's reply to the dialogue system in the current context, thereby achieving more accurate dialogue style adjustment.

[0165] Optionally, users may have different conversation style requirements for different conversation types. Therefore, during the conversation process, the state vector corresponding to the current conversation record is first generated through the conversation style generation process to determine the current conversation style. Afterwards, the agent can perform a conversation style update process on the current conversation style based on the style score to achieve adaptive dynamic adjustment of the conversation style, so that the subsequent answers output by the conversation system are more in line with the user's needs and preferences.

[0166] Optionally, in the above Figure 8 In the example conversation process, the agent uses a reinforcement learning algorithm to analyze and learn based on the style scores of the user's immediate feedback, thereby achieving online learning and personalized style adjustment of the agent.

[0167] In some embodiments, the process of determining what dialogue style the dialogue system needs to use to respond to the user during the dialogue process can be regarded as a sequential decision task. Optionally, the execution process of the sequential decision task can follow a Markov decision process (MDP), for example.

[0168] Among them, the Markov decision process is a mathematical model that simulates the random strategy (policy) and reward of an intelligent agent in an environment, and the state of the environment has the Markov property. Among them, the intelligent agent is, for example, an agent. When a random process, given the current state and all past states, has a conditional probability distribution of its future state that depends only on the current state; in other words, given the current state, it is conditionally independent of the past state (that is, the historical path of the process), then this random process has the Markov property. For example, in the dialogue style update process, the agent updates the dialogue style corresponding to the state vector according to the style score. The dialogue style update process is to update the current dialogue style, which is independent of the historical dialogue style, and therefore has the Markov property.

[0169] Optionally, the problem environment of the Markov decision process is composed of a dialogue system, which mainly realizes functions such as generating dialogues, receiving user replies, and updating dialogue records. Each reinforcement learning module obtains required information from the environment and influences the environment.

[0170] Alternatively, if Fig. 9 As shown in the figure, the Markov decision process is built based on a set of interacting objects, namely the agent and the environment, and its elements include state, action, state transition function and reward. In the simulation of the Markov decision process, the agent can perceive the current system state, take actions on the environment according to the state transition function, thereby changing the state of the environment and obtaining rewards to update the agent and execute the next round of the Markov decision process.

[0171] Among them, state s∈S. The state is generated by encoding the conversation record of the current conversation. The conversation record text uses the pre-trained BERT language encoding model to encode the state vector to obtain the state vector s.

[0172] Action a∈A. The action vector output by the agent according to the current state vector s is a={α1,α2,…,α N}∈{0,1} N is an N-dimensional 01 vector, where N is the number of optional dialogue style words in the action space A. For example, Fig. 9 The 16 dialogue style words in the action space shown in the figure correspond to a 0 / 1 selection mode for each dialogue style word. That is, the agent determines whether each dialogue style word in the action space can be selected or not according to the state vector. Optionally, the output of the action vector a is limited by the type of dialogue style words. For example, among the dialogue style words of the same type, the action vector a can only select one of the dialogue style words. For example, if an emotional dialogue style word is selected, a rational dialogue style word cannot be selected.

[0173] The state transfer function f(s,a) is a dialogue style prompt for guiding the dialogue system generated according to the action vector a corresponding to the state vector s. For example, if the agent selects the action vector a: {concise, plain}, the corresponding prompt can be constructed, that is, the corresponding style guidance is generated, such as instructing the dialogue system to reply in a concise and plain dialogue style. Optionally, the dialogue system receives the dialogue record and the dialogue style prompt to generate a new reply, and receives the user's reply, constructs a new dialogue record and passes it to the agent for constructing the state vector of the next dialogue.

[0174] Reward r∈,-1,1], where the reward r is generated, for example, by a scoring model. Optionally, the scoring model is a multimodal BERT model that has been trained with annotations. The scoring model determines the user's satisfaction based on the multimodal response input by the user to generate a style score, i.e., a reward, where 1 is the most satisfied and -1 is the least satisfied.

[0175] Some examples include Fig. 9As shown in the figure, in the agent online update process, the reinforcement learning model in which the agent is an A2C model is taken as an example. The agent can perform Bernoulli sampling from the predicted probability distribution p to obtain the executed action vector a. Afterwards, the agent learns according to the reward r fed back by the scoring model. For this purpose, a multilayer perceptron (MLP) can be used to define a Critic network for calculating the state value: v = Critic (h). Where h is a hidden vector generated by the state vector s obtained by the long short term memory network (LSTM) encoder. In this way, the loss function of the reinforcement learning update process can be obtained as shown in the following formula (1).

[0176] L=∑((r+v ′ -v) 2 -ln(p(a))×(r+v′) / (1)

[0177] Where p(a) represents the probability of executing action vector a under probability distribution p, v ′ It is the hidden vector obtained for the next state after state transfer.

[0178] Then, during the agent update process, by reducing the loss function, it is possible to ensure that the future reward after the dialogue style update is as large as possible. In this way, through the learning and updating of the agent, the style guidance generated by the agent can improve the user's satisfaction with the dialogue system's response, thereby achieving the purpose of matching the dialogue style selected by the agent with the user's dialogue style requirements.

[0179] The following combination Fig. 9 , the dialogue generation process provided in the embodiment of the present application is introduced.

[0180] For example, Fig. 9 As shown in the figure, the dialogue system constitutes the environment of the dialogue process, and the adaptive update of the dialogue style is realized through the interaction between the agent and the dialogue system. Specifically, the dialogue system obtains the dialogue record and constructs the state vector through the BERT language encoding model. After that, the dialogue system inputs the state vector into the agent. The agent judges the current dialogue state through the state vector, and selects the dialogue style words in the action space in combination with the user preferences that it has learned. For example, the dialogue style words selected by the agent in the action space are emotional and long text. After that, the agent creates a dialogue style prompt based on the selected dialogue style words to guide the dialogue system to perform the corresponding action according to the dialogue style prompt for the current dialogue input, that is, output a reply.

[0181] Afterwards, the dialogue system can obtain the user's reply and send the user's reply to the scoring model. The scoring model can construct a reply vector based on the user's reply and output a style score, such as a style score of -1. Afterwards, the scoring model can feed back the style score to the agent as a reward after the agent performs an action. The agent updates parameters based on the obtained style score to achieve learning, and then reselects dialogue style words in the action space based on the current state vector to trigger the creation of a new dialogue style prompt to guide the dialogue system to perform actions. For example, based on the style score, the agent determines that the user is not satisfied with the current dialogue style, and can reselect dialogue style words in the action space, such as rationality and short text, to instruct the dialogue system to modify the current dialogue style accordingly.

[0182] In this way, the dialogue generation method provided in the embodiment of the present application analyzes and learns the user's dialogue records through a reinforcement learning algorithm to achieve personalized output of the dialogue system. Thus, the dialogue system can better adapt to the needs and preferences of different users for different dialogue styles, and improve the user experience and satisfaction.

[0183] In addition, through online model updates, model training and optimization can be continuously performed as the dialogue system is used, and users' needs for changes in dialogue style can be met based on real-time feedback from users.

[0184] In addition, during the conversation, based on the system's multimodal capabilities, it is possible to process multimodal responses from users, such as text and voice responses, to improve the accuracy of user response ratings and make up for the shortcoming that it is difficult to judge user satisfaction based solely on text responses.

[0185] For example, Fig.10 The flowchart of a method for generating a dialogue provided by an embodiment of the present application is shown in FIG. Fig.10 The specific sequence described below is not limited, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. Fig.10 As shown, the method comprises the following steps:

[0186] S1001. The server sends the conversation record to the electronic device.

[0187] In some embodiments, the conversation record is a historical conversation record of the interaction between the server and the user. For example, the conversation record includes N conversation data before receiving the last reply from the user, or includes conversation data generated within a preset time period before the current time.

[0188] Optionally, step S1001 is an optional step, and the electronic device receives the user's reply and displays the reply sent by the server, so the electronic device side may also save the conversation record. Therefore, the electronic device can directly perform the following step S1002 according to the locally saved conversation record.

[0189] S1002: The electronic device obtains a state vector corresponding to the conversation record, and determines a first conversation style corresponding to the state vector.

[0190] In the process of user conversation, as time goes by or the conversation type changes, the conversation style required by the user may change. Therefore, the electronic device can first determine the current conversation style, and then generate a new conversation style required by the user based on the current conversation style.

[0191] For example, as users grow older and gain more experience, their demands for the conversation style of the conversation system change. For another example, users demand a simple and direct conversation style that avoids redundancy in conversations about subjects such as mathematics and physics, while they demand a vivid and vivid conversation style for conversations about life issues.

[0192] In some embodiments, after acquiring the conversation record, the electronic device may generate a state vector according to the conversation record, wherein the state vector is used to indicate the current conversation state.

[0193] In some other embodiments, the server generates a state vector corresponding to the conversation record based on the conversation record, and then sends the generated state vector to the electronic device.

[0194] Optionally, the electronic device or server constructs a state vector through a BERT language encoding model.

[0195] For example, Figure 7 As shown, the cloud-side server is deployed with a dialogue system that outputs dialogue replies based on user replies, including a dialogue input module, a generation dialogue system, and a dialogue output module. The end-side electronic device is deployed with a style enhancement module for updating the dialogue style of the dialogue system, including a style guidance model and a style scoring model. Among them, when a round of dialogue is started, the dialogue input module sends the generated dialogue record to the style enhancement module, and the style enhancement module constructs a state vector corresponding to the dialogue record based on the acquired dialogue record through the style guidance model; alternatively, the dialogue input module performs state construction based on the current dialogue record and sends the generated state vector to the style guidance model.

[0196] In some embodiments, in response to the state vector, the electronic device selects a first dialogue style word corresponding to the state vector in a preset action space, where the first dialogue style word is used to represent a first dialogue style.

[0197] Optionally, the action space includes a plurality of dialogue style words for describing the dialogue style. The dialogue style words may be determined in a variety of ways, for example, the dialogue style words include dialogue style words corresponding to the user's commonly used dialogue style, dialogue style words that are all used to describe the dialogue style, dialogue style words corresponding to the dialogue style with a usage frequency higher than a preset threshold, etc., which is not limited in the embodiments of the present application.

[0198] For example, Fig. 9 As shown in the figure, the dialogue system constitutes the environment of the dialogue process. Through the interaction between the agent and the dialogue system, the adaptive update of the dialogue style is realized. Specifically, the dialogue system obtains the dialogue record and constructs the state vector through the BERT language encoding model. After that, the dialogue system inputs the state vector into the agent. The agent judges the current dialogue state through the state vector, and selects the dialogue style words in the action space based on the user preferences it has learned. For example, the dialogue style words selected by the agent in the action space are emotional and long text.

[0199] S1003. The electronic device receives a user reply, where the user reply corresponds to a first conversation-style reply output by the server.

[0200] Among them, the user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

[0201] In some embodiments, the electronic device receives the user's reply through a display screen, an audio module, etc. For example, after the electronic device displays the reply sent by the server, it receives the user's voice reply. Afterwards, the electronic device converts the user's voice reply into a text message, thereby obtaining the user's multi-modal reply.

[0202] In some examples, the user response may also be a single-mode response.

[0203] S1004: The electronic device generates a style score based on the user's response.

[0204] In some embodiments, the electronic device can determine whether the user is satisfied with the response of the previous round of dialogue system based on the emotional state, tone, speaking speed and other information of the user's reply, and output a style score.

[0205] In some embodiments, the style score belongs to a score range of [-1, 1], wherein a positive score is used to indicate a probability of a user having a positive emotion toward the first conversation style, and a negative score is used to indicate a probability of a user having a negative emotion toward the first conversation style.

[0206] For example, Figure 7As shown, the feedback module sends the acquired user replies to the style scoring model, which is used to analyze the user replies and determine the user's satisfaction with the replies of the current dialogue system. For example, the style scoring model analyzes the user's emotions based on the text, voice, etc. in the user's multi-modal replies, determines that the user is satisfied with the reply of the dialogue system based on positive emotions, and determines that the user is dissatisfied with the reply of the dialogue system based on negative emotions. Afterwards, the style scoring model sends the determined user satisfaction to the style guidance model, so that the style guidance model adjusts the first dialogue style according to the style score.

[0207] S1005: The electronic device adjusts the first dialogue style according to the style score to generate a second dialogue style.

[0208] In some embodiments, the electronic device selects a second dialogue style word corresponding to the first dialogue style word in the action space based on the style score, the second dialogue style word is a synonym or antonym of the first dialogue style word, and the second dialogue style word is used to represent a second dialogue style.

[0209] Alternatively, if Fig. 9 As shown, the dialogue system can obtain the user's reply and send the user's reply to the scoring model. The scoring model can construct a reply vector based on the user's reply and output a style score, for example, a style score of -1. Afterwards, the scoring model can feed back the style score to the agent as a reward after the agent performs an action. The agent updates parameters based on the obtained style score to achieve learning, and then reselects dialogue style words in the action space based on the current state vector to trigger the creation of a new dialogue style prompt to guide the dialogue system to perform actions. For example, based on the style score, the agent determines that the user is not satisfied with the current dialogue style, and can reselect dialogue style words in the action space, such as rationality and short text, to instruct the dialogue system to modify the current dialogue style accordingly.

[0210] In some embodiments, the electronic device includes a style enhancement module, which includes a style guidance model and a style scoring model, wherein the style guidance model is a reinforcement learning model for generating the second dialogue style, and the style scoring model is for generating a style score. The electronic device may update the style guidance model according to the style score.

[0211] For example, the agent updates parameters based on the acquired style scores to achieve learning, thereby reselecting dialogue style words in the action space.

[0212] In other embodiments, the electronic device may determine the current conversation style based on the conversation record, thereby determining a new conversation style based on the current conversation style and the user's reply. Alternatively, the electronic device may determine the current conversation style based on the style guidance previously sent to the server in the previous round of conversation, thereby determining a new conversation style based on the current conversation style and the user's reply. Alternatively, the electronic device may determine the new conversation style based on the conversation record, which includes the current user's reply.

[0213] S1006. The electronic device sends the style guide to the server.

[0214] In some embodiments, after determining the second conversation style, the electronic device generates a style guide based on the second conversation style and sends the style guide to the server to instruct the server to modify the current conversation style. Correspondingly, the server receives the style guide sent by the electronic device.

[0215] S1007. In response to the style guidance, the server outputs a reply in the second conversation style corresponding to the user's reply.

[0216] In some embodiments, after receiving the style guide, the server may obtain the second conversation style carried therein, and then the server may generate a reply corresponding to the second conversation style of the user's reply, the conversation style of the reply meeting the user's needs.

[0217] For example, Figure 7 As shown, the style guidance model generates new style guidance based on the state vector obtained this time and the user satisfaction corresponding to the state vector, and sends the style guidance to the generative dialogue system in the cloud to update the generative dialogue system, so that the generative dialogue system outputs a response to the input of this round of dialogue according to the new style guidance, and the response matches the dialogue style indicated by the new style guidance, thereby completing another round of operation cycle of the dialogue system.

[0218] Optionally, the above steps S1001 to S1007 are loop steps. After obtaining the user's reply, the electronic device can adjust the current conversation style according to the conversation record and the user's reply, so that the conversation style changes adaptively to meet the user's needs.

[0219] In this way, the dialogue generation method provided in the embodiment of the present application analyzes and learns the user's dialogue records through a reinforcement learning algorithm to achieve personalized output of the dialogue system. Thus, the dialogue system can better adapt to the needs and preferences of different users for different dialogue styles, and improve the user experience and satisfaction.

[0220] In addition, through online model updates, model training and optimization can be continuously performed as the dialogue system is used, and users' needs for changes in dialogue style can be met based on real-time feedback from users.

[0221] In addition, during the conversation, based on the system's multimodal capabilities, it is possible to process multimodal responses from users, such as text and voice responses, to improve the accuracy of user response ratings and make up for the shortcoming that it is difficult to judge user satisfaction based solely on text responses.

[0222] Combination of the above Figure 6-Figure 10 The following describes in detail the method for generating a dialogue provided by the embodiment of the present application. Fig.11 and Fig.12 The electronic device and server provided in the embodiments of the present application are described in detail.

[0223] It should be noted that all or part of any features of any embodiment in this application can be freely combined, and the combined technical solutions also fall within the scope of this application.

[0224] In one possible design, Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 1100 may include: a transceiver unit 1101 and a processing unit 1102. The electronic device 1100 may be used to implement the functions of the electronic device involved in the above method embodiment.

[0225] Optionally, the transceiver unit 1101 is used to support the electronic device 1100 to execute Fig.10 S1001 and S1006 in.

[0226] Optionally, the processing unit 1102 is used to support the electronic device 1100 to execute Fig.10 S1002, S1003, S1004, and S1005 in.

[0227] The transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the electronic device 1100 are respectively to implement the corresponding process of the dialogue generation method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they will not be repeated here.

[0228] Optionally, Fig.11 The electronic device 1100 shown may also include a storage unit ( Fig.11(not shown), the storage unit stores a program or instruction. When the transceiver unit 1101 and the processing unit 1102 execute the program or instruction, Fig.11 The electronic device 1100 shown can execute the conversation generation method described in the above method embodiment.

[0229] Fig.11 The technical effects of the electronic device 1100 shown can refer to the technical effects of the dialogue generation method described in the above method embodiment, and will not be repeated here.

[0230] In addition to being in the form of electronic device 1100, the technical solution provided in the present application may also be a functional unit or chip in the electronic device, or a device used in conjunction with the electronic device.

[0231] In one possible design, Fig.12 This is a schematic diagram of the structure of the server provided in the embodiment of the present application. Fig.12 As shown, the server 1200 may include: a transceiver unit 1201 and a processing unit 1202. The server 1200 may be used to implement the functions of the server involved in the above method embodiment.

[0232] Optionally, the transceiver unit 1201 is used to support the server 1200 to execute Fig.10 S1001 and S1006 in.

[0233] Optionally, the processing unit 1202 is used to support the server 1200 to execute Fig.10 S1007 in.

[0234] The transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the server 1200 are respectively to implement the corresponding process of the dialogue generation method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they will not be repeated here.

[0235] Optionally, Fig.12 The server 1200 shown may also include a storage unit ( Fig.12 (not shown), the storage unit stores a program or instruction. When the transceiver unit 1201 and the processing unit 1202 execute the program or instruction, Fig.12 The server 1200 shown can execute the dialog generation method described in the above method embodiment.

[0236] Fig.12The technical effects of the server 1200 shown can refer to the technical effects of the dialogue generation method described in the above method embodiment, and will not be repeated here.

[0237] In addition to being in the form of server 1200, the technical solution provided in the present application may also be a functional unit or chip in the server, or a device used in conjunction with the server.

[0238] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0239] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0240] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0241] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0242] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0243] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the above-mentioned related steps to implement the dialogue generation method in the above-mentioned embodiment.

[0244] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the dialogue generation method in the above-mentioned embodiment.

[0245] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device performs the dialog generation method in the above-mentioned method embodiments.

[0246] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0247] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0248] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

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

[0250] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0251] Computer-readable storage media include, but are not limited to, any of the following: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.

[0252] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a dialogue, characterized in that: Applied to electronic equipment, the method comprises: In response to the acquired state vector, determining a first dialogue style corresponding to the state vector; receiving a user reply, wherein the user reply corresponds to a reply in the first conversation style output by the server; generating a style score according to the user response, wherein the style score indicates user satisfaction with the first conversation style; adjusting the first dialogue style according to the style score to generate a second dialogue style; A style guide is sent to the server, wherein the style guide instructs the server to output a response in the second conversation style.

2. The method according to claim 1, characterized in that Before determining the first dialogue style corresponding to the state vector in response to the acquired state vector, the method further includes: Receiving the conversation record sent by the server; The state vector is generated according to the conversation record, and the state vector indicates the current conversation state.

3. The method according to claim 1 or 2, characterized in that: The step of determining, in response to the acquired state vector, a first dialogue style corresponding to the state vector includes: In response to the state vector, a first dialogue style word corresponding to the state vector is selected in a preset action space, where the first dialogue style word represents the first dialogue style.

4. The method according to claim 3, characterized in that The step of adjusting the first dialogue style according to the style score to generate a second dialogue style includes: According to the style score, a second dialogue style word corresponding to the first dialogue style word is selected in the action space, the second dialogue style word is a synonym or antonym of the first dialogue style word, and the second dialogue style word represents the second dialogue style.

5. The method according to any one of claims 1 to 4, characterized in that: The style score belongs to a score range of [-1, 1], wherein a positive score indicates a probability of a user having a positive emotion toward the first conversation style, and a negative score indicates a probability of a user having a negative emotion toward the first conversation style.

6. The method according to any one of claims 1 to 5, characterized in that: The user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

7. The method according to any one of claims 1 to 6, characterized in that: The electronic device includes a style enhancement module, the style enhancement module includes a style guidance model and a style scoring model, the style guidance model is a reinforcement learning model, and is used to generate the second dialogue style, and the style scoring model is used to generate the style score, and the method further includes: The style guidance model is updated according to the style score.

8. A method for generating a dialogue, characterized in that: Applied to a server, the method comprises: Sending a conversation record to an electronic device, the conversation record including a reply in the first conversation style output by the server; receiving style guidance sent by the electronic device; In response to the style guidance, a reply in a second dialogue style corresponding to the user's reply is output, where the second dialogue style is a dialogue style determined by the electronic device after adjusting the first dialogue style according to the user's reply.

9. The method according to claim 8, characterized in that The user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

10. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 1-7.

11. A server, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the server executes the method according to claim 8 or 9.

12. A dialogue generation system, characterized in that: The system includes an electronic device and a server; The electronic device is configured as follows: In response to the acquired state vector, determining a first dialogue style corresponding to the state vector; receiving a user reply, wherein the user reply corresponds to a reply in the first conversation style output by the server; generating a style score according to the user response, wherein the style score indicates user satisfaction with the first conversation style; adjusting the first dialogue style according to the style score to generate a second dialogue style; sending style guidance to the server; The server is configured to: receiving style guidance sent by the electronic device; In response to the style guidance, a reply in the second conversation style corresponding to the user's reply is output.

13. The system according to claim 12, characterized in that The server is further configured to: Sending the conversation record to the electronic device; The electronic device is further configured as: Receiving the conversation record sent by the server; The state vector is generated according to the conversation record, and the state vector indicates the current conversation state.

14. The system according to claim 12 or 13, characterized in that The user reply is a multimodal reply, and the user reply includes one or more of a text reply, a voice reply, a text message converted from a voice reply, and an image reply.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, and when the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, which, when executed on a server, causes the server to execute the method according to claim 8 or 9.

17. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7; or the computer is enabled to execute the method according to claim 8 or 9.