Human-computer interaction dialogue method and system based on role fusion

By combining a role-aware network, a general generation network, and a consistency matching network, the problem of generating personalized and diverse responses in open-domain dialogue systems is solved, achieving higher-quality dialogue generation and improving role consistency and dialogue coherence.

CN115563260BActive Publication Date: 2026-04-10SHANDONG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG NORMAL UNIV
Filing Date
2022-10-19
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing generative dialogue systems struggle to generate personalized and diverse responses in open domains, particularly in terms of role consistency and dialogue coherence. Furthermore, building personalized datasets is costly and prone to bias.

Method used

By employing a combination of a role-aware network, a general generative network, and a consistency matching network, fine-grained personalized features are captured through predefined role information and query statement design to generate a general response. The consistency matching network enhances the consistency of personalized responses, and the NLI dataset is used for training to minimize the probability of inconsistency.

Benefits of technology

It improves the personalization and diversity of generated responses, enhances the role consistency and coherence of the dialogue system, and reduces inconsistencies during model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563260B_ABST
    Figure CN115563260B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of natural language processing and deep learning, and proposes a role fusion-based human-computer interaction dialogue method and system. A role perception network is designed by using predefined role information and query sentences to capture fine-grained personalized features. A general generation network is established, which generates general replies from the mapping relationship in the role perception network. Finally, a consistency matching network is constructed to match between roles and general replies. Since the consistency matching network is independent of the query, NLI data is used to generate personalized responses. Non-likelihood training is also applied to minimize the inconsistency probability in the model, making the prediction closer to the relevant training target, and making the replies generated by the model more personalized and diverse.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of natural language processing and deep learning, in particular, to a role fusion-based human-computer interaction dialogue method and system. BACKGROUND

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute the prior art.

[0003] Dialogue systems have attracted a lot of attention from researchers and are applied in various industry scenarios, especially the improvement of artificial intelligence such as chat robots and intelligent assistants, which has pushed the research of dialogue systems to a climax. From the fields involved in previous research, the existing research can be divided into two main directions, namely specific task fields and open fields. The specific field model is committed to solving the vertical field business assistant system, which has a clear task target to be completed, such as restaurant reservation, commodity purchase, and other problems. The open field dialogue system involves unlimited topics and is suitable for casual conversation in various scenarios. At present, the explosive growth of available dialogue datasets has attracted more and more scholars to research the construction of open field dialogue systems.

[0004] At the same time, the lack of knowledge engineering also makes it more challenging to build an open field dialogue system. In the open field dialogue system, according to the different construction methods, it includes dialogue systems based on generation and dialogue systems based on retrieval methods. Among them, the method based on generation is to create a feasible response to the user's query, while the method based on retrieval is to match a best solution from the candidate response according to the score ranking. Although the sentence generated by the retrieval-based method is good in coherence, due to the limitation of the candidate response, the retrieved sentence style is single. In contrast, the dialogue system based on generation can generate answers with diversity and can flexibly respond to different dialogue scenarios. In the generative dialogue system, the role-based open domain dialogue system is a hot research problem, and its task is to make the generated reply consistent with the given role and coherent with the dialogue context.

[0005] Role-based dialogue systems fuse pre-defined persona information to generate more diverse and meaningful responses. Pre-defined persona information includes various personal identity characteristics or backgrounds. In recent years, research on persona-based dialogue systems has mainly focused on two aspects: mining implicit personas and extracting explicit personas. The model that mines implicit personas passes user ID embedding vectors to capture the implicit identity of the speaker; however, the personalized information is represented by a real-valued vector of the user, which results in the persona being uninterpretable. In addition, this method is also subject to noise interference. Therefore, more research has shifted to extracting explicit personas. In the explicit persona model, early researchers used a sequence-to-sequence method to encode personal personas. With the advent of personalized datasets, work on personalized dialogue has mainly focused on a data-driven approach to learning relevant features. Later, the Transformer demonstrated its advantages in text processing, which led to large-scale pre-training models being applied to persona-based dialogue systems.

[0006] Pre-training models require the construction of personalized dialogue datasets, and Persona-Chat is an annotated dataset specifically designed to address the inconsistency of dialogue tasks. In such artificial datasets, annotators need to simulate conversations based on given personas. This results in three limitations of artificial datasets: first, the establishment of artificial datasets consumes huge costs and manpower, which undoubtedly leads to a shortage of artificial datasets. Second, a large amount of persona information is involved in the dialogue, and these data are referred to as dense personas. Models trained from such datasets will overemphasize personas, which deviates from reality. Finally, the dataset is intentionally labeled by annotators, which cannot fully reflect their personalities and will lead to dataset bias. For example, it is difficult for an annotator with a quiet personality to imitate the language style of a lively person. Therefore, training only on persona-dense datasets cannot enable the model to fully understand consistency. Although people have tried to obtain more personalized dialogue on social media, the data obtained also face the problem of not being able to well reflect the general user characteristics due to the fact that sentence retrieval is limited to heuristic rules.

[0007] It can be seen that if the consistency understanding ability of the model is to be improved, a dataset that can enable the model to generate high-quality responses and capture persona information is needed. However, it is currently very difficult to annotate such a dataset. SUMMARY

[0008] The present disclosure proposes a role fusion-based human-computer interaction dialogue method and system to solve the above problems, which can make the generated replies more personalized and diverse.

[0009] To achieve the above purpose, the present disclosure adopts the following technical solutions:

[0010] One or more embodiments provide a role fusion-based human-computer interaction dialogue method, comprising the following steps:

[0011] The obtained predefined role and the user's query are respectively input into an embedding layer, a self-attention mechanism and a multi-layer attention module of a role perception network, and a mapping relationship of multiple granularities between the role and the query information is obtained through a residual connection.

[0012] The output result of the role perception network is used to generate a general reply according to the mapping relationship in the role perception network through a conditional relationship between dialogues in a general generation network.

[0013] The generated general reply and the user's role information are input into a consistency matching network, and a personalized reply is obtained by matching between the role and the general reply through a multi-head attention mechanism and a feedforward neural network.

[0014] One or more embodiments provide a role fusion-based human-computer interaction dialogue system, comprising:

[0015] The role perception unit is configured to input the obtained predefined role and the user's query into an embedding layer, a self-attention mechanism and a multi-layer attention module of a role perception network, and obtain a mapping relationship of multiple granularities between the role and the query information through a residual connection.

[0016] The general reply unit is configured to generate a general reply according to the mapping relationship in the role perception network through a conditional relationship between dialogues in a general generation network using the output result of the role perception network.

[0017] The consistency reply unit is configured to input the generated general reply and the user's role information into a consistency matching network, and obtain a personalized reply by matching between the role and the general reply through a multi-head attention mechanism and a feedforward neural network.

[0018] An electronic device comprising a memory and a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the steps of the above method are completed.

[0019] A computer readable storage medium for storing computer instructions, when the computer instructions are executed by a processor, the steps of the above method are completed.

[0020] Compared with the prior art, the beneficial effects of the present disclosure are:

[0021] In the present disclosure, a role-aware network is designed using predefined role information and query statements to capture fine-grained personalized features; a general generation network is established, which generates general replies from the mapping relationship in the role-aware network; and finally a consistency matching network is constructed to match between roles and general replies. Since the consistency matching network is independent of the query, NLI data is used to generate personalized responses. Non-likelihood training is also applied to minimize the inconsistency probability in the model, making the prediction closer to the relevant training target, and making the replies generated by the model more personalized and diverse.

[0022] Advantages of the present disclosure and advantages additional aspects will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0023] The accompanying drawings, which form a part of the present disclosure, are intended to provide further understanding of the present disclosure, and the illustrative embodiments of the present disclosure and their descriptions serve the purpose of explaining the present disclosure. The present disclosure is not limited in scope by the illustrative embodiments that are described in the figures.

[0024] Figure 1 is a schematic diagram of the overall network structure of embodiment 1 of the present disclosure;

[0025] Figure 2 is a flowchart of the human-computer interaction dialogue method of embodiment 1 of the present disclosure. DETAILED DESCRIPTION

[0026] The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments.

[0027] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present disclosure. Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs.

[0028] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit exemplary embodiments according to the present disclosure. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should be further understood that when the terms "comprise" and / or "include" are used in the specification, they indicate the presence of the features, steps, operations, devices, components and / or combinations thereof. It should be noted that the various embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The embodiments will be described in detail below with reference to the accompanying drawings.

[0029] Technical term explanation:

[0030] NLI (Natural Language Inference) is a classification task that determines the relationship between a given pair of sentences. In this task, there are many auxiliary datasets such as SNLI (Stanford Natural Language Inference) and MNLI (Multi-Genre Natural Language Inference) that are labeled with three types of implicit relationships: implicit, contradictory, and neutral.

[0031] Embodiment 1

[0032] In the technical solutions disclosed in one or more embodiments, as shown in Figures 1-2 The role-based fusion human-computer interaction dialogue method includes the following steps:

[0033] Step 1: The pre-defined roles and user questions obtained are respectively transmitted into the embedding layer, self-attention mechanism module and multi-layer attention module of the role perception network to obtain the mapping relationship of the role and query information multi-granularity as the personalized feature encoding into the hidden state.

[0034] Step 2: The hidden state is transmitted into the general generation network in the encoder-decoder mode, and the general reply is generated according to the mapping relationship in the role perception network through the conditional relationship between the dialogues in the general generation network, that is, the candidate rough response is generated.

[0035] Step 3: The generated general reply and the user's role information are input into the consistency matching network, and the personalized reply is obtained by matching between the role and the general reply through the multi-head attention mechanism matching and the feedforward neural network.

[0036] The consistency matching network adopts NLI data for training, and adopts a non-likelihood training target in the training process to minimize the inconsistency probability in the model.

[0037] In this embodiment, a role perception network is designed using pre-defined role information and query sentences to capture fine-grained personalized features; a general generation network is established, which generates a general reply from the mapping relationship in the role perception network; and finally a consistency matching network is constructed to match between the role and the general reply. Since the consistency matching network is independent of the query, the NLI data is used to generate personalized responses. The NLI dataset is a dataset reflecting sentence relationships, and the NLI dataset and the Persona-Chat artificial dataset are used, and the non-likelihood training is also applied to minimize the inconsistency probability in the model, so that the prediction is closer to the relevant training target, and the reply generated by the model is more personalized and diverse.

[0038] In order to understand the characters more deeply and generate more consistent responses in limited personalized data, the matching relationship between sentences is obtained by using the NLI dataset, and the obtained general reply is trained.

[0039] Specifically, in the embodiment, BERT (Bidirectional Encoder Representation from Transformers) and RoBERTA (Robustly Optimized BERT Pretraining Approach) are used as the main pre-training model. BERT uses the encoder part of the Transformer as the main architecture, and the multi-head attention mechanism in it enables the model to learn relevant information in different representation subspaces. In addition, BERT uses two tasks, MLM (Masked Language Model) and NSP (Next Sentence Prediction), to pre-train the model. RoBERTA is an improved model based on the BERT model, which uses a larger batch-size and longer sentence sequences, and its effect is improved by 5%-20% compared with BERT in many tasks.

[0040] In the embodiment, multi-granularity role relationships are used, and how to generate more consistent responses from limited personalized data is studied. The generation framework of BERT and RoBERTA is used to train a role-based dialogue model from limited data, so that the replies generated by the model are more personalized.

[0041] In the embodiment, the role chat dataset and the NLI dataset are fused to generate responses and enhance consistency, respectively.

[0042] The role-aware network, the general generation network, and the consistency matching network will be described in detail as follows:

[0043] (1) The role-aware network is initialized as a RoBERTa encoder to convert daily sentences into vector representations, which is conducive to understanding and perfecting the characters.

[0044] As shown in Figure 1 The role-aware network includes an input layer, an embedding layer, a self-attention module, a concatenation module, and a multi-head attention module connected in sequence.

[0045] Specifically, the character P and the query Q are transmitted to the role-aware network model.

[0046] In some embodiments, the role P includes the sum of the internal and external characteristics of a person, which can include identity characteristics, personality characteristics; identity characteristics include name, age, personality characteristics such as hobbies, etc.

[0047] In step 1, the mapping relationship of the role and the query information multi-granularity is obtained, including the following steps:

[0048] Step 11, the character role and the query information are segmented respectively and input into the embedding layer of the role perception network;

[0049] The query Q is one of the key elements of the dialogue system. In order to make the generated response correspond to the query, and it should also be consistent with the character role, in this embodiment, the character role and the query are segmented respectively, and the segmented information is input into the embedding layer, so that the input can be converted into a better semantic representation. The input embedding of the word is the sum of the corresponding word embedding, segment embedding and position embedding. The embedding is shown as:

[0050]

[0051]

[0052]

[0053] Wherein, E t , E s and E p represent word embedding, segment embedding and position embedding respectively. t is the total length of the query and the character role vector. The three matrices are added to obtain the vector E.

[0054] In order to capture the long-distance dependence relationship of each role and each query sentence, the embedding output is applied to the self-attention mechanism.

[0055] Step 12, in order to capture the long-distance dependence relationship of each role and each query sentence, the embedding output is processed by self-attention to obtain the self-attention result of the role and the query, and the definition of the calculation is:

[0056]

[0057] Wherein, Q, K and V are the query, key and value vectors concerned, d k is the dimension of K, and T represents transposition.

[0058] Step 13, the self-attention results of the role and the query are spliced together to obtain the sum of the semantic representation;

[0059] The self-attention results of the role and the query are marked as m and n, then the self-attention results of the role and the query are spliced together, and the result is introduced into the multi-head attention to obtain the correlation between the features.

[0060] Step 14, the scaled dot-product attention of the spliced self-attention result is performed on the query, key and value to obtain the word vector after multi-head attention processing, and the word vectors are spliced into a matrix and input into a feedforward neural network (FNN) layer to obtain a result H, i.e., the role and query information multi-granularity mapping relationship is obtained.

[0061] In this embodiment, the multi-head attention can be represented as MultiHead(query, key, value), wherein the scaled dot-product attention of the query, key and value is performed.

[0062] In the multi-head attention, the three matrices are linearly transformed to obtain the dependency relationship for all word vectors. Next, the three vectors are spliced into a matrix to cause attention, and a hidden state W1 of the result is obtained.

[0063] The role perception network has N identical layers, and each layer of the multi-head attention is calculated as follows:

[0064] M = W r ·Q, W N ·K, W i ·V)

[0065] h Q = Attention(W K ·Q, W V ·K, W r ·V)

[0066] Wherein, W Q , W K , W V are trainable parameters. M is the output of the multi-head attention. The M is input into a feedforward neural network (FNN) layer to obtain a result H, and the result H is the obtained role and query information multi-granularity mapping relationship. The output word vector is connected with a residual connection to obtain a final hidden state P1.

[0067] (II) General generation network

[0068] Unlike the role perception network, the Bert pre-training model is initialized in this embodiment to construct the general generation network, which works in the manner of an autoregressive decoder.

[0069] Specifically, the hidden state is passed into a multi-head encoder-decoder attention mechanism (cross attention). The commonality of the cross attention and the self-attention is that they both need similarity to calculate the weight of the weighted average. The difference is that the cross attention can be calculated on the attribute level of the answer, and then the output is linearly transformed by the FNN layer.

[0070] In step 2, a general reply is generated according to the mapping relationship in the role perception network by the conditional relationship between dialogues in the general generation network, and the conditional relationship is specifically:

[0071] R1: F U (R1|P1)

[0072] Wherein, P1 is the output of the role perception network, R1 is the output of the general generation network, and FU is the conditional relationship P1 in the network generating R1.

[0073] As an autoregressive decoder, the general generation network will extract the most likely word from the vocabulary at each step, that is, the generated response depends on the word generated in the previous step and the context vector calculated in the current step by the attention mechanism, and the context vector is the result of attention. Each layer i in the general generation network is defined as:

[0074] FNN = MAX(0, x·W1 + b1)·W2 + b2

[0075] D = MultiHead(y i , H, H)

[0076] H2 = FFN(D)

[0077] Wherein, W1, W2, b1 and b2 are trainable parameters. As can be seen from the above formula, in each layer i calculation, D is the result of multi-head attention, and after full connection of D, the final result R1 of multi-head attention calculation is obtained.

[0078] (Three) consistency matching network

[0079] Although R1 can be generated as a result, R1 is only a rough reply and does not have role consistency. In order to make R1 more personalized, in addition to the dialog query, the personal role information will also affect the generation. For example, when a person who likes sports is asked about hobbies, they are more likely to answer fitness activities. But if the answer is reading, there will be inconsistency. Therefore, how to correctly use the character role to enhance the consistency of generation is very important.

[0080] The consistency matching network depends on two features: the role P and the rough reply R1 obtained by the general generation network. In order to make the model have consistent understanding ability, the personalized preference of the user is modeled from the NLI data set in this embodiment. In detail, the matching mechanism is used to strengthen the consistency between the role and the general reply. The consistency matching network still calculates in multiple layers, and each layer is defined as:

[0081]

[0082] Y i = MultiHead(p i , R1, R1)

[0083]

[0084] y i = FNN(Y i )

[0085] where W Y , r i , b3, b4 are trainable parameters, represents the target response, p i is the multi-head attention output of the character and the target response, Y i is the result of the multi-head attention of the coarse response and p i , y i is the output of the consistency matching network, which is also the output of the feed-forward neural network Y i , which can be sent to the vocabulary to obtain the most likely generated word. Then, the final response can be obtained after the loop iteration.

[0086] Further technical solutions, in order to realize the consistency enhancement of the response, the non-likelihood loss and the log-likelihood loss in the general generation network and the consistency matching network are combined in the training process of the above network, and the weighted sum of the non-likelihood loss and the log-likelihood loss is taken as the overall training loss function.

[0087] Many generation models use the maximum likelihood principle to train the model. The difference between different models is how to express the likelihood function. In this embodiment, the log-likelihood is used as the objective function of the likelihood training. The log-likelihood loss is very effective for multi-classification and unbalanced data sets. For general response and final consistent response, using the log-likelihood method can improve the fluency and accuracy of generation.

[0088] The semantic information of the query Q and the character P is calculated in the general generation network. Therefore, the general generation network loss function is defined as:

[0089]

[0090] where P, Q represent the query and character information respectively, P θ is a trainable parameter, and R <I represents the generated vector of the previous I steps.

[0091] The generation part of the consistency matching network is also trained by NLL. The character embedding vector and the coarse response R1 obtained by the general generation network are read to predict the target response:

[0092]

[0093] Consistency matching network uses NLI dataset to enhance consistency. The label in the dataset maps the relationship between premise and hypothesis. In this embodiment, the data labels of relevant and contradictory relationship are collected respectively: relevant data is E + , contradictory data is C - . In order to facilitate application, P * is used instead of premise, and H * is used instead of hypothesis. For data from E + , the log-likelihood loss is applied to increase the accompanying probability.

[0094]

[0095] For data from C - , we apply non-likelihood training to suppress irrelevant probability.

[0096]

[0097] In this embodiment, the steps of training role-aware network, general generation network and consistency matching network include the following:

[0098] Step S1, the pre-defined roles in the obtained role chat dataset and the user's query are respectively transmitted into the embedding layer, the self-attention mechanism and the multi-layer attention module of the role-aware network, and the mapping relationship of the roles and the query information multi-granularity is obtained through the residual connection to obtain the personalized feature coding as the hidden state;

[0099] Step S2, the output result of the role-aware network is input into the general generation network through the conditional relationship between dialogues to generate a general reply, that is, to generate a candidate rough response;

[0100] Step S3, the generated general reply and the user's role information are input into the consistency matching network, and the personalized reply is obtained through the multi-head attention mechanism and the feedforward neural network;

[0101] The consistency matching network adopts NLI data for training, and adopts a non-likelihood training target in the training process to minimize the inconsistency probability in the model;

[0102] Step S4, the non-likelihood loss and the log-likelihood loss in the general generation network and the consistency matching network are combined, and the weighted sum of the non-likelihood loss and the log-likelihood loss is used as the overall training loss function, and the parameters are trained using back propagation.

[0103] In this embodiment, the losses of the general generation network and the consistency matching network are combined to improve the quality of the generated

[0104] To reduce the possibility of generating inconsistencies, E + and C - The implementation of encouragement and inhibition operations, the calculation of non-likelihood training loss:

[0105] The above two losses are added, and the parameters are updated using back propagation. This embodiment initializes our model from the public BERT and RoBERTA base model, which has 12 layers and a hidden layer size of 768. The learning rate of the Adam optimizer varies from 5e-6 to 5e-5. According to experience, set α to 5e-3 and β to 0.1.

[0106] Embodiment 2

[0107] Based on embodiment 1, the role fusion-based human-computer interaction dialogue system provided in this embodiment includes:

[0108] The role perception unit is configured to transmit the acquired predefined role and the user's query to the attention mechanism and the multi-layer attention module of the role perception network, respectively, to obtain the mapping relationship of the role and the query information at multiple granularities as personalized feature encoding into hidden states.

[0109] The general reply unit is configured to pass the hidden state to the general generation network in the encoder-decoder mode, and generate a general reply according to the mapping relationship in the role perception network through the conditional relationship between dialogues in the general generation network, that is, to generate a candidate rough response.

[0110] The consistency reply unit is configured to input the generated general reply and the user's role information into the consistency matching network, and match between the role and the general reply to obtain a personalized reply.

[0111] It should be noted that each module in this embodiment corresponds to each step in embodiment 1, and the specific implementation process is the same, which will not be repeated here.

[0112] Embodiment 3

[0113] The embodiment provides an electronic device, which includes a memory and a processor, and computer instructions stored in the memory and running on the processor, when the computer instructions are run by the processor, the steps of the method of embodiment 1 are completed.

[0114] Embodiment 4

[0115] The embodiment provides a computer readable storage medium for storing computer instructions, when the computer instructions are executed by the processor, the steps of the method of embodiment 1 are completed.

[0116] The above merely describes preferred embodiments of the present disclosure and is not intended to limit the present disclosure. The present disclosure can have various modifications and changes for those skilled in the art. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0117] Although the specific embodiments of the present disclosure are described above with reference to the accompanying drawings, the present disclosure is not limited thereto, and those skilled in the art should understand that various modifications or changes made on the basis of the technical solutions of the present disclosure without creative labor are still within the protection scope of the present disclosure.

Claims

1. A human-computer interaction dialogue method based on role fusion, characterized in that, Includes the following steps: The predefined roles and user queries are fed into the embedding layer, self-attention mechanism and multi-layer attention module of the role-aware network, respectively, and then the residual connections are used to obtain the multi-granular mapping relationship between roles and query information. The output of the role-aware network is used to generate a general response based on the conditional relationships between dialogues in the general generator network and the mapping relationships in the role-aware network; the conditional relationships are the relationships between the input and output of the general generator network. The generated generic response and the user's role information are input into a consistency matching network. After matching through a multi-head attention mechanism and a feedforward neural network, a personalized response is obtained by matching between the role and the generic response. Obtaining a multi-granular mapping relationship between roles and query information includes the following steps: The character roles and query information are segmented into words and then fed into the embedding layer of the character perception network. The embedding output of the embedding layer is subjected to self-attention processing to obtain the self-attention results for the role and the query; By concatenating the self-attention results of the roles and queries, we obtain the sum of the semantic representations of the roles and queries; The concatenated self-attention results are scaled by dot product attention on the query, key, and value to obtain word vectors after multi-head attention processing. The word vectors are then concatenated into a matrix and fed into a feedforward neural network to obtain a multi-granular mapping relationship between roles and query information.

2. The human-computer interaction dialogue method based on role fusion as described in claim 1, characterized in that: The non-likelihood loss and log-likelihood loss from the general generative network and the consistency matching network are combined, and the weighted sum of the non-likelihood loss and the log-likelihood loss is used as the overall training loss function. Backpropagation is used to train the parameters.

3. The human-computer interaction dialogue method based on role fusion as described in claim 1, characterized in that: The character chat dataset and the NLI dataset are merged to generate responses and enhance consistency. The consistency matching network is trained using NLI data and employs a non-likelihood training objective during training to minimize the inconsistency probability in the model.

4. The human-computer interaction dialogue method based on role fusion as described in claim 1, characterized in that: The character awareness network consists of an input layer, an embedding layer, a self-attention module, a splicing module, and a multi-head attention module, which are connected in sequence.

5. The human-computer interaction dialogue method based on role fusion as described in claim 1, characterized in that: The general generative network employs a cross-attention mechanism between a multi-head encoder and decoder; the consistency matching network utilizes a matching mechanism to enhance consistency between roles and general responses.

6. The human-computer interaction dialogue method based on role fusion as described in claim 1, characterized in that: The training steps for the role-aware network, the general generative network, and the consistency matching network include the following: Step S1: Input the predefined roles and user queries from the acquired role chat dataset into the embedding layer, self-attention mechanism and multi-layer attention module of the role-aware network, respectively. After residual connection, obtain the multi-granular mapping relationship between roles and query information, as personalized feature encoding. Step S2: The output of the role perception network is processed through the conditional relationships between dialogues in the general generation network, and a general response is generated based on the mapping relationship in the role perception network. Step S3: Input the generated general response and the user's role information into the consistency matching network, match between the role and the general response, and obtain a personalized response; The consistency matching network is trained using NLI data and employs a non-likelihood training objective during training to minimize the inconsistency probability in the model. Step S4: Combine the non-likelihood loss and log-likelihood loss in the general generator network and the consistency matching network, use the weighted sum of the non-likelihood loss and log-likelihood loss as the overall training loss function, and use backpropagation to train the parameters.

7. A human-computer interaction dialogue system based on role fusion, according to the method of claim 1, characterized in that, include: The role-aware unit is configured to input the acquired predefined roles and user queries into the embedding layer, self-attention mechanism and multi-layer attention module of the role-aware network, respectively, and obtain the multi-granular mapping relationship between roles and query information through residual connections. The general response unit is configured to generate a general response based on the mapping relationship in the character perception network, by passing the output of the character perception network through the conditional relationship between dialogues in the general generation network. The consistency response unit is configured to input the generated generic response and the user's role information into the consistency matching network. After matching through a multi-head attention mechanism and a feedforward neural network, a personalized response is obtained by matching between the role and the generic response.

8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the steps of any one of claims 1-6.

Citation Information

Patent Citations

  • Theme-enhanced chat robot reply generation method and device

    CN110069611A

  • Dialogue generation method based on personalized open field

    CN112199485A