Method, device and terminal equipment for multi-turn dialogue generation based on sentiment determination

By combining an emotion classifier with an emotion transfer mathematical model, user emotions are determined based on dialogue time and turn number, solving the problem of inaccurate emotion recognition in existing technologies, generating dialogues that are more in line with user emotions, and improving user experience.

CN115481232BActive Publication Date: 2026-04-28HEBEI UNIV OF SCI & TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEBEI UNIV OF SCI & TECH
Filing Date
2022-10-08
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, emotion classifiers cannot accurately identify users' emotions when generating human-computer dialogues, resulting in poor emotional dialogue generation and affecting user experience.

Method used

After identifying the first emotional information through an emotion classifier, the second emotional information is determined based on the dialogue time and rounds by combining the emotion transfer mathematical model, and the dialogue generation model outputs a dialogue that matches the user's emotions.

Benefits of technology

The accuracy of the emotion classifier has been improved, ensuring that the generated dialogues are more in line with the user's emotions and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481232B_ABST
    Figure CN115481232B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of man-machine conversation, and provides a multi-round conversation generation method and device based on emotion judgment and terminal equipment, the method comprising: obtaining conversation information; identifying first emotion information in the conversation information through an emotion classifier, wherein the emotion classifier identifies and classifies emotions contained in the conversation information based on a classification model, and the first emotion information represents the emotion of the conversation information; determining second emotion information based on the first emotion information by using an emotion transfer mathematical model, wherein the second emotion information is one kind of emotion information in multiple first emotion information, and the emotion transfer mathematical model is used to determine the second emotion information based on conversation time and conversation round; and outputting the current round of conversation containing the second emotion information according to the second emotion information through a conversation generation model. The application can improve the recognition accuracy of the emotion classifier and improve the experience of users using the man-machine conversation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of human-computer dialogue technology, and in particular relates to multi-turn dialogue generation methods, devices and terminal equipment. Background Technology

[0002] Generative human-computer dialogue can automatically generate correct and fluent responses based on context, playing a vital role in human-computer interaction systems. As human-computer dialogue systems continue to develop and their application areas expand, people increasingly desire to engage in effective and in-depth dialogues with machines.

[0003] Existing technologies often employ emotion classifiers, combining emotion tags with various methods such as emotional memory, attention mechanisms, multi-task learning, and adversarial learning to generate emotional responses. However, the accuracy of emotion recognition is still insufficient, failing to generate dialogues that resonate with the user's emotions, thus impacting the effectiveness of emotional dialogue generation.

[0004] Therefore, there is an urgent need for a multi-turn dialogue generation method that can accurately grasp user emotions and provide effective responses, in order to improve the recognition accuracy of emotion classifiers and enhance user experience. Summary of the Invention

[0005] To overcome the problems existing in related technologies, embodiments of this application provide a method, apparatus and terminal device for generating multi-turn dialogues based on emotion determination, which can improve the recognition accuracy of emotion classifiers and enhance the user's experience of human-computer dialogue systems.

[0006] This application is achieved through the following technical solution:

[0007] Firstly, embodiments of this application provide a multi-turn dialogue generation method based on emotion determination, comprising: identifying first emotion information based on dialogue information using an emotion classifier, wherein the emotion classifier identifies and classifies the emotions contained in the dialogue information based on a classification model, and the first emotion information represents the emotion of the dialogue information; determining second emotion information based on the first emotion information using an emotion transfer mathematical model, wherein the second emotion information is one of several types of first emotion information, and the emotion transfer mathematical model is used to determine the second emotion information based on dialogue time and dialogue turn; and outputting the current turn dialogue containing the second emotion information using a dialogue generation model, wherein the dialogue generation model is used to generate a semantically correct dialogue that contains emotion.

[0008] In one possible implementation of the first aspect, based on the first emotional information, a mathematical model of emotional transfer is used to determine the second emotional information, including:

[0009] A mathematical model for emotion transfer is determined by combining the dialogue time determination model and the dialogue turn determination model. The expression of the mathematical model for emotion transfer is as follows:

[0010]

[0011] In the formula, Indicates the emotional transfer value. Indicates the emotion transfer factor, , This represents the time determination value in the dialogue time determination model. This represents the turn determination value in the dialogue turn determination model. The dialogue time determination model is determined based on the principle that the user's emotional information is unlikely to change in a short period of time, while the dialogue turn determination model is determined based on the principle that two rounds of dialogue with the same emotional information are similar and therefore are less likely to experience emotional transfer.

[0012] The emotional transfer value is compared with a preset emotional transfer threshold. If the emotional transfer value is less than the preset emotional transfer threshold, the second emotional information determined by the emotional transfer mathematical model is the same as the emotional information in the user's previous conversation; if the emotional transfer value is greater than or equal to the preset emotional transfer threshold, the second emotional information determined by the emotional transfer mathematical model is the same as the emotional information in the user's current conversation.

[0013] In one possible implementation of the first aspect, the expression for the dialogue timing determination model is:

[0014]

[0015] In the formula, This indicates the dialogue time determination value. This indicates the turn in which the user initiated the current conversation. Indicates the moment when the user initiated the current conversation. This indicates the moment when the user initiated the previous conversation. The moment when a user establishes a dialogue with the human-computer interaction system. This represents the smoothing factor, which is a constant.

[0016] In one possible implementation of the first aspect, the expression for the dialogue turn determination model is:

[0017]

[0018] In the formula, This indicates the dialogue turn determination value. This indicates the turn in which the user initiated the current conversation. This indicates the most recent turn in the history of conversations that is consistent with the sentiment information in the user's current conversation. This represents the smoothing factor, which is a constant.

[0019] In one possible implementation of the first aspect, after identifying the emotional information in the dialogue information through an emotion classifier and before determining the second emotional information using an emotion transfer mathematical model, the method further includes: determining whether the emotional information in the user's current dialogue information is consistent with the emotional information in the user's previous dialogue information through an emotion classifier; if they are inconsistent, then calling the emotion transfer mathematical model to determine the second emotional information.

[0020] In one possible implementation of the first aspect, the emotional information in the dialogue information is identified by an emotional classifier, including: mapping the dialogue information to a word vector space and converting it into corresponding text word vectors; the emotional classifier identifies the emotional information in the dialogue information based on the text word vectors.

[0021] In one possible implementation of the first aspect, the dialogue generation model outputs the current dialogue containing the second emotional information based on the second emotional information, including: embedding the second emotional information into the emotional dialogue model, and then outputting the current dialogue containing the second emotional information through the dialogue generation model.

[0022] Secondly, embodiments of this application provide a multi-turn dialogue generation device based on emotion determination, including: a dialogue information acquisition module, used to acquire dialogue information;

[0023] The emotion transfer determination module identifies first emotion information based on dialogue information using an emotion classifier. The emotion classifier identifies and categorizes the emotions contained in the dialogue information based on a classification model. The first emotion information represents the emotion of the dialogue information. The emotion transfer determination module also determines second emotion information based on the first emotion information using an emotion transfer mathematical model. The second emotion information is one of several types of first emotion information. The emotion transfer mathematical model determines the second emotion information based on dialogue time and dialogue rounds. Finally, the emotion dialogue output module outputs the current round of dialogue containing the second emotion information using a dialogue generation model. The dialogue generation model generates semantically correct dialogue that also contains the emotion.

[0024] Thirdly, embodiments of this application provide a terminal device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the multi-turn dialogue generation method based on emotion determination as described in any of the first aspects.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-turn dialogue generation method based on emotion determination as described in any of the first aspects.

[0026] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the multi-turn dialogue generation method based on emotion determination as described in any of the first aspects.

[0027] The beneficial effects of the embodiments in this application compared with the prior art are:

[0028] This application's embodiments, after acquiring the user's dialogue information, identify first emotional information through an emotion classifier. Based on this first emotional information, a second emotional information is determined using an emotion transfer mathematical model. Finally, a dialogue generation model outputs an emotional dialogue containing the second emotional information. The technical solution provided in this application introduces an emotion transfer mathematical model on top of the emotional information identified by the emotion classifier. This model can more accurately identify the user's true emotions based on dialogue time and dialogue rounds. Therefore, it avoids the problem of low accuracy in user emotion recognition caused by the emotion classifier determining the user's emotions based solely on the current dialogue, resulting in an inability to accurately grasp user emotions and generate effective responses. This improves the recognition accuracy of the emotion classifier and enhances the user experience of the human-computer dialogue system.

[0029] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a schematic diagram of a scene from the user terminal's perspective, provided in an embodiment of this application;

[0032] Figure 2 This is a flowchart illustrating a multi-turn dialogue method based on emotion determination provided in an embodiment of this application;

[0033] Figure 3 This is a schematic diagram of the structure of a multi-turn dialogue device based on emotion determination provided in an embodiment of this application;

[0034] Figure 4 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation

[0035] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0036] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0037] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0038] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0039] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0040] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0041] The human-computer dialogue system analyzes the user's current emotions through an emotion classifier, and then outputs an emotional dialogue that matches the user's emotions through a dialogue generation model, in order to calm the user's emotions and answer the user's questions.

[0042] While users experience emotional fluctuations when expressing emotions, their overall emotional state remains relatively stable. In real-world scenarios, during multi-turn conversations with human-computer dialogue systems, users often use rhetorical questions, interrogative sentences, double negatives, or even saying the opposite of what they mean to express their emotions. However, existing emotion classifiers rely solely on the current dialogue information to identify the user's emotions, inevitably leading to low accuracy in emotion recognition. In some cases, the recognition results may even contradict the user's expressed emotions, resulting in a poor user experience and difficulties in effective communication.

[0043] To address the aforementioned problems, this application provides a multi-turn dialogue method based on emotion determination. To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described below are merely illustrative of this application and are not intended to limit its scope.

[0044] For example, Figure 1 The diagram illustrates a scenario from the user terminal's perspective, which includes the user terminal 1, the user's previous dialogue 11, the user's current dialogue 12, and the current dialogue 12 that the human-computer dialogue system is about to send but has not yet sent.

[0045] It should be noted that, Figure 1 This is for illustrative purposes only; this application does not restrict the type of user terminal.

[0046] The following combination Figure 1 This application provides a detailed description of the multi-turn dialogue method based on emotion determination.

[0047] Figure 2 This is a flowchart illustrating a multi-turn dialogue method based on emotion determination provided in an embodiment of this application, with reference to... Figure 2 The method is described in detail below:

[0048] In step 101, dialogue information is obtained.

[0049] In some embodiments, dialogue information sent by the user is obtained through a human-computer dialogue system. This dialogue information can be at least one of text, voice, or image information.

[0050] Optionally, when the dialogue information is voice information, the human-computer dialogue system can convert it into text information using speech-to-text technology.

[0051] Optionally, when the dialogue information is image information, the human-computer dialogue system can obtain text information through image recognition technology.

[0052] In some embodiments, the acquired dialogue information may include current dialogue information sent by the user, as well as historical dialogue information sent by the user.

[0053] In step 102, the first emotional information in the dialogue information is identified by an emotion classifier.

[0054] The emotion classifier identifies and classifies the emotions contained in the dialogue information based on a classification model.

[0055] In some embodiments, the sentiment classifier maps dialogue information to a word vector space and converts it into corresponding text word vectors.

[0056] In some embodiments, the sentiment classifier identifies sentiment information in dialogue information based on text word vectors.

[0057] For example, primary emotional information can be categorized into emotions such as joy, anger, shock, sadness, and neutrality.

[0058] Since the emotion classifier technology is not the innovation of this application, the further explanation of how the emotion classifier identifies the first emotion information based on the dialogue information will not be provided.

[0059] In step 103, based on the first emotional information, the second emotional information is determined using an emotional transfer mathematical model.

[0060] While users experience emotional fluctuations when expressing emotions, their overall emotions remain stable or gradually develop. In real-world scenarios, during multi-turn conversations with human-computer dialogue systems, users typically use rhetorical questions, interrogative sentences, double negations, or irony to express their emotions. However, existing emotion classifiers rely solely on the current dialogue information to identify user emotions, inevitably leading to low accuracy in emotion recognition. In some cases, the recognition results may even contradict the user's expressed emotions, resulting in a poor user experience and hindering normal communication.

[0061] To address the aforementioned issues, the technical solution provided in this application, after the existing emotion classifier identifies the first emotion information, employs an emotion transfer mathematical model to further determine the identified user's first emotion information, thus avoiding the problems of low recognition accuracy and recognition errors in the emotion classifier.

[0062] It should be noted that the "current dialogue" mentioned below refers to the response that the human-computer dialogue system should provide to the user in the current dialogue.

[0063] In some embodiments, the process of determining the second emotional information based on the first emotional information using an emotional transfer mathematical model can be performed by the following steps:

[0064] Optionally, the mathematical model of sentiment transfer can be determined by combining the dialogue time determination model and the dialogue turn determination model. The expression of the sentiment transfer mathematical model can be:

[0065]

[0066] In the formula, Indicates the emotional transfer value. Indicates the emotion transfer factor, , This represents the time determination value in the dialogue time determination model. This represents the turn determination value in the dialogue turn determination model.

[0067] Among them, the dialogue time determination model is determined based on the principle that the user's emotional information is unlikely to change in a short period of time, while the dialogue round determination model is determined based on the principle that two rounds of dialogue with the same emotional information are not likely to experience emotional transfer.

[0068] Optionally, a preset emotional transfer threshold can be set, and the emotional transfer value can be compared with the preset emotional transfer threshold.

[0069] Furthermore, if the emotion transfer value is less than the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the emotion information in the user's previous round of dialogue.

[0070] Furthermore, if the emotion transfer value is greater than or equal to the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the emotion information in the user's current conversation.

[0071] The dialogue time determination model and the dialogue turn determination model will be explained in detail below.

[0072] In some embodiments, the dialogue time determination model is determined based on the principle that user emotional information is unlikely to change within a short period of time. The expression of the dialogue time determination model can be:

[0073]

[0074] In the formula, This indicates the dialogue time determination value. This indicates the turn in which the user initiated the current conversation. Indicates the moment when the user initiated the current conversation. This indicates the moment when the user initiated the previous conversation. The moment when a user establishes a dialogue with the human-computer interaction system. This represents the smoothing factor, which is a very small constant.

[0075] In some embodiments, the dialogue turn determination model is determined based on the principle that two rounds of dialogue with similar emotional information are less likely to experience emotional transfer. The expression of the dialogue turn determination model can be:

[0076]

[0077] In the formula, This indicates the dialogue turn determination value. This indicates the turn in which the user initiated the current conversation. This indicates the most recent turn in the history of conversations that is consistent with the sentiment information in the user's current conversation. This represents the smoothing factor, which is a very small constant.

[0078] The emotional transfer mathematical model provided in this application determines whether to perform emotional transfer by judging the time interval between the current dialogue initiated by the user and the previous dialogue round; it also determines whether to perform emotional transfer by judging the most recent round in the historical dialogue that is consistent with the emotional information of the user's current dialogue. This can make the current dialogue initiated by the human-computer dialogue system more in line with people's emotional logic, thereby generating high-quality emotional dialogue.

[0079] In step 104, the dialogue generation model outputs the current dialogue containing the second emotional information based on the second emotional information.

[0080] In some embodiments, the second emotional information determined in step 103 is embedded into the speech generation model to output the current round of dialogue containing the second emotional information.

[0081] It should be noted that the dialogue generation model is used to generate semantically correct dialogues that contain emotions, and is existing technology. This application will not provide further explanation of the dialogue generation model.

[0082] In some embodiments, based on Figure 2 In the embodiments shown, the above-described multi-turn dialogue method based on emotion determination may further include:

[0083] After identifying the first emotional information using an emotional classifier based on the dialogue information, and before determining the second emotional information using an emotional transfer mathematical model, the following actions can be performed:

[0084] Optionally, an emotion classifier can be used to determine whether the emotion information in the user's current conversation is consistent with the emotion information in the user's previous conversation.

[0085] Optionally, if there is a discrepancy, the emotional transfer mathematical model is invoked to determine the second emotional information.

[0086] Optionally, if they are consistent, it indicates that the user's emotions have not changed. In this case, there is no need to call the emotion transfer mathematical model. Instead, the emotion information identified by the emotion classifier is embedded into the emotion dialogue model, and the dialogue generation model outputs the current round of dialogue.

[0087] The technical solution provided in this application introduces an emotion transfer mathematical model based on the emotion information identified by the emotion classifier. This avoids the problem that the emotion classifier determines the user's emotion based solely on the current dialogue, resulting in low accuracy in user emotion recognition and an inability to accurately grasp user emotions and generate effective responses. This improves the recognition accuracy of the emotion classifier and enhances the user experience of using the human-computer dialogue system.

[0088] To better understand the emotion-based multi-turn dialogue method disclosed in this application, this application also provides a specific embodiment. The specific embodiment is described below:

[0089] Obtain information about the user's current conversation and multiple rounds of conversation, and record the emotional information of each round of conversation.

[0090] When the sentiment of the fourth round of conversation initiated by the user (the user's previous conversation) is neutral, and the sentiment of the fifth round of conversation (the user's current conversation) is joyful.

[0091] The dialogue time determination value and the dialogue turn determination value are calculated respectively based on the dialogue time determination model and the dialogue turn determination model:

[0092] Assumptions: When a user initiates the 5th conversation, the current conversation started at 28 minutes, the previous conversation started at 27 minutes, and the user started establishing a conversation with the system at 18 minutes. Smoothness factor... If the value is 0.001, then the dialogue time determination value is:

[0093]

[0094] Assumption: When a user initiates the 5th conversation, and the emotion of this conversation is joy, if the most recent conversation with the same emotion as this one is found to have 3 rounds of dialogue, then the smoothing factor... If the value is 0.001, then the dialogue turn determination value is:

[0095]

[0096] Hypothesis: Emotional transfer factor If the value is 0.5, then the emotional transfer value is:

[0097]

[0098] Based on the actual situation, the preset emotion transfer threshold is 0.5. If the emotion transfer value is greater than the preset emotion transfer threshold, emotion transfer is required. The user's emotion in the 5th round of dialogue changes and is determined to be joy.

[0099] Finally, the joy value of the current dialogue initiated by the user, obtained through the above process, is embedded into the emotional dialogue model. The dialogue generation model is then used to realize the emotional dialogue and generate a response containing joy.

[0100] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0101] Corresponding to the emotion-based multi-turn dialogue method described in the above embodiments, Figure 3 A structural block diagram of a multi-turn dialogue device based on emotion determination provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0102] See Figure 3 The multi-turn dialogue device based on emotion determination in this application embodiment may include a dialogue information acquisition module 201, an emotion transfer determination module 202, and an emotion dialogue output module 203.

[0103] The dialogue information acquisition module 201 is used to acquire dialogue information.

[0104] The emotion transfer determination module 202 is used to identify first emotion information based on the dialogue information through an emotion classifier, wherein the emotion classifier identifies and classifies the emotions contained in the dialogue information based on a classification model, and the first emotion information represents the emotion of the dialogue information.

[0105] Optionally, the emotional information in the dialogue information is identified by an emotional classifier, including: mapping the dialogue information to a word vector space and converting it into corresponding text word vectors; the emotional classifier identifies the emotional information in the dialogue information based on the text word vectors.

[0106] The emotion transfer determination module 202 is also used to identify the emotion information in the dialogue information through the emotion classifier, and then determine whether the emotion information in the user's current dialogue information is consistent with the emotion information in the user's previous dialogue information. If they are inconsistent, the emotion transfer mathematical model is called to determine the second emotion information.

[0107] The emotion transfer determination module 202 is also used to determine the second emotion information based on the first emotion information using an emotion transfer mathematical model.

[0108] The second emotional information is one type of emotional information among various first emotional information. The emotional transfer mathematical model is used to determine the second emotional information based on the dialogue time and dialogue rounds.

[0109] Optionally, based on the first emotional information, a mathematical model of emotional transfer is used to determine the second emotional information, including:

[0110] A mathematical model for emotion transfer is determined by combining the dialogue time determination model and the dialogue turn determination model. The expression of the mathematical model for emotion transfer is as follows:

[0111]

[0112] In the formula, Indicates the emotional transfer value. Indicates the emotion transfer factor, , This represents the time determination value in the dialogue time determination model. This represents the turn determination value in the dialogue turn determination model. The dialogue time determination model is determined based on the principle that the user's emotional information is unlikely to change in a short period of time, while the dialogue turn determination model is determined based on the principle that two rounds of dialogue with the same emotional information are similar and therefore are less likely to experience emotional transfer.

[0113] The emotional transfer value is compared with the preset emotional transfer threshold. If the emotional transfer value is less than the preset emotional transfer threshold, the second emotional information determined by the emotional transfer mathematical model is the same as the emotional information in the user's previous dialogue. If the emotional transfer value is greater than or equal to the preset emotional transfer threshold, the second emotional information determined by the emotional transfer mathematical model is the same as the emotional information in the user's current dialogue.

[0114] Optionally, the expression for the dialogue timing determination model is:

[0115]

[0116] In the formula, This indicates the dialogue time determination value. This indicates the turn in which the user initiated the current conversation. Indicates the moment when the user initiated the current conversation. This indicates the moment when the user initiated the previous conversation. The moment when a user establishes a dialogue with the human-computer interaction system. This represents the smoothing factor, which is a constant.

[0117] Optionally, the expression for the dialogue turn determination model is:

[0118]

[0119] In the formula, This indicates the dialogue turn determination value. This indicates the turn in which the user initiated the current conversation. This indicates the most recent turn in the history of conversations that is consistent with the sentiment information in the user's current conversation. This represents the smoothing factor, which is a constant.

[0120] The emotional dialogue output module 203 is used to output the current round of dialogue containing the second emotional information based on the second emotional information through the dialogue generation model.

[0121] Among them, the dialogue generation model is used to generate semantically correct dialogues that also convey emotions.

[0122] Optionally, the dialogue generation model outputs the current dialogue containing the second emotional information based on the second emotional information, including: embedding the second emotional information into the emotional dialogue model, and then outputting the current dialogue containing the second emotional information through the dialogue generation model.

[0123] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0125] This application also provides a terminal device, see [link to relevant documentation] Figure 4 The terminal device 300 may include at least one processor 310 and a memory 320. The memory 320 stores a computer program 321 that can run on the at least one processor 310. When the processor 310 executes the computer program 321, it implements the steps in any of the above-described method embodiments, for example... Figure 2Steps 101 to 104 in the illustrated embodiment. Alternatively, when processor 310 executes computer program 321, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 3 The functions of modules 201 to 203 are shown.

[0126] For example, computer program 321 may be divided into one or more modules / units, one or more of which are stored in memory 320 and executed by processor 310 to complete this application. One or more modules / units may be a series of computer program segments capable of performing specific functions, which describe the execution process of the computer program in terminal device 300.

[0127] Those skilled in the art will understand that Figure 4 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.

[0128] The processor 310 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0129] The memory 320 can be an internal storage unit of the terminal device 300 or an external storage device of the terminal device 300, such as a plug-in hard disk, a smart media card (SMC), a secure digital card (SD), or a flash card. The memory 320 is used to store the computer program 321 and other programs and data required by the terminal device 300. The memory 320 can also be used to temporarily store data that has been output or will be output.

[0130] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0131] The emotion-based multi-turn dialogue method provided in this application can be applied to terminal devices such as computers, wearable devices, in-vehicle devices, tablets, laptops, netbooks, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, and mobile phones. This application does not impose any restrictions on the specific type of terminal device.

[0132] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various embodiments of the emotion-based multi-turn dialogue method.

[0133] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the various embodiments of the emotion-based multi-turn dialogue method.

[0134] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0135] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

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

[0137] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

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

[0139] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A multi-turn dialogue generation method based on emotion determination, characterized in that, include: Obtain dialogue information; The first emotional information in the dialogue information is identified by an emotional classifier, wherein the emotional classifier identifies and classifies the emotions contained in the dialogue information based on a classification model, and the first emotional information represents the emotion of the dialogue information. Based on the first emotional information, the second emotional information is determined using an emotional transfer mathematical model, including: combining a dialogue time determination model and a dialogue turn determination model to determine the emotional transfer mathematical model, the expression of which is: In the formula, Indicates the emotional transfer value. Indicates the emotion transfer factor, , This represents the dialogue timing determination value in the dialogue timing determination model. The dialogue turn determination value is represented in the dialogue turn determination model; the emotion transfer value is compared with a preset emotion transfer threshold; if the emotion transfer value is less than the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the first emotion information in the user's previous dialogue; if the emotion transfer value is greater than or equal to the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the first emotion information in the user's current dialogue; wherein, the second emotion information is one of multiple first emotion information, and the emotion transfer mathematical model is used to determine the second emotion information based on dialogue time and dialogue turn; The dialogue generation model outputs the current dialogue containing the second emotional information based on the second emotional information. The dialogue generation model is used to generate a dialogue that is semantically correct and contains emotion. The expression for the dialogue timing determination model is: In the formula, This indicates the dialogue time determination value. This indicates the turn in which the user initiated the current conversation. Indicates the moment when the user initiated the current conversation. This indicates the moment when the user initiated the previous conversation. The moment when a user establishes a dialogue with the human-computer interaction system. This represents the smoothing factor, which is a constant. The expression for the dialogue turn determination model is: In the formula, This indicates the dialogue turn determination value. This indicates the turn in which the user initiated the current conversation. This indicates the most recent turn in the history of conversations that is consistent with the sentiment information in the user's current conversation. This represents the smoothing factor, which is a constant.

2. The multi-turn dialogue generation method based on emotion determination as described in claim 1, characterized in that, After identifying the first emotional information in the dialogue information using an emotional classifier and before determining the second emotional information using an emotional transfer mathematical model, the method further includes: The emotion classifier determines whether the first emotion information in the user's current dialogue is consistent with the first emotion information in the user's previous dialogue. If they are inconsistent, the emotion transfer mathematical model is invoked to determine the second emotion information.

3. The multi-turn dialogue generation method based on emotion determination as described in claim 1 or 2, characterized in that, The step of identifying the first emotional information in the dialogue information using an emotional classifier includes: The dialogue information is mapped to a word vector space and converted into corresponding text word vectors. The text word vectors are input into the sentiment classifier to identify the first sentiment information in the dialogue information.

4. The multi-turn dialogue generation method based on emotion determination as described in claim 1 or 2, characterized in that, The step of outputting the current dialogue containing the second emotional information based on the second emotional information through the dialogue generation model includes: embedding the second emotional information into the dialogue generation model and outputting the current dialogue containing the second emotional information.

5. A multi-turn dialogue generation device based on emotion determination, characterized in that, For implementing the multi-turn dialogue generation method based on emotion determination as described in any one of claims 1-4, the multi-turn dialogue generation device based on emotion determination comprises: The dialogue information acquisition module is used to acquire dialogue information; The emotion transfer determination module is used to identify first emotion information based on the dialogue information through an emotion classifier, wherein the emotion classifier identifies and classifies the emotions contained in the dialogue information based on a classification model, and the first emotion information represents the emotion of the dialogue information. The emotion transfer determination module is further configured to determine the second emotion information based on the first emotion information using an emotion transfer mathematical model, including: determining the emotion transfer mathematical model by combining a dialogue time determination model and a dialogue turn determination model, wherein the expression of the emotion transfer mathematical model is: In the formula, Indicates the emotional transfer value. Indicates the emotion transfer factor, , This represents the dialogue timing determination value in the dialogue timing determination model. The dialogue turn determination value is represented in the dialogue turn determination model; the emotion transfer value is compared with a preset emotion transfer threshold; if the emotion transfer value is less than the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the first emotion information in the user's previous dialogue; if the emotion transfer value is greater than or equal to the preset emotion transfer threshold, then the second emotion information determined by the emotion transfer mathematical model is the same as the first emotion information in the user's current dialogue; wherein, the second emotion information is one of multiple first emotion information, and the emotion transfer mathematical model is used to determine the second emotion information based on dialogue time and dialogue turn; as well as, The emotional dialogue output module is used to output the current dialogue containing the second emotional information based on the second emotional information through the dialogue generation model, wherein the dialogue generation model is used to generate a dialogue that is semantically correct and contains emotion. The expression for the dialogue timing determination model is: In the formula, This indicates the dialogue time determination value. This indicates the turn in which the user initiated the current conversation. Indicates the moment when the user initiated the current conversation. This indicates the moment when the user initiated the previous conversation. The moment when a user establishes a dialogue with the human-computer interaction system. This represents the smoothing factor, which is a constant. The expression for the dialogue turn determination model is: In the formula, This indicates the dialogue turn determination value. This indicates the turn in which the user initiated the current conversation. This indicates the most recent turn in the history of conversations that is consistent with the sentiment information in the user's current conversation. This represents the smoothing factor, which is a constant.

6. A terminal device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Generative multi-round chat dialogue method and system and computer-readable storage medium

    CN108681610A

  • Multi-round dialogue method and system integrating knowledge graph and emotion supervision

    CN111651609A