A method for open domain dialogue generation based on multi-granularity feature decoupling

By introducing multi-granularity feature decoupling and golden Gaussian distribution into the human-computer dialogue model and optimizing the latent space, it solves the problems of uninterpretability and insufficient semantic capture of dialogue generation in existing models, and achieves high-quality and diverse dialogue generation.

CN114398904BActive Publication Date: 2024-08-23CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111386005.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2024-08-23
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

Existing human-computer dialogue models lack interpretability during dialogue generation and cannot effectively capture the category semantics of the dialogue, resulting in inaccurate topics and content of the generated dialogue and poor user experience.

Method used

An open-domain dialogue generation method based on multi-granularity feature decoupling is adopted to optimize the latent space by introducing prior knowledge to make the latent space interpretable. The golden Gaussian distribution containing category information is used to map different categories of dialogues to different latent spaces. At the position, conditional variational autoencoder (CVAE) and advanced conditional variational autoencoder (A-CVAE) models are used for training to generate dialogue replies.

Benefits of technology

Improved interpretability and quality of dialogue generation, enabling models to better capture semantics and thereby generate high-quality, diverse responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398904B
    Figure CN114398904B
Patent Text Reader

Abstract

The present invention discloses an open domain dialogue generation method based on multi-granularity feature decoupling, including: obtaining a data set and a dialogue category; randomly selecting a number of first training pairs in the data set to input a conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category; inputting a second training pair in the data set into an advanced conditional variational autoencoder A-CVAE model to obtain a reconstruction expected loss and a KL divergence; obtaining a total loss according to the reconstruction expected loss, the KL divergence, and the priori Gaussian distribution corresponding to the first training pair; performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a training A-CVAE model; obtaining a dialogue question to be answered; inputting the dialogue question to be answered into the training A-CVAE model to generate a dialogue reply. The present invention can solve the technical problem that the existing model cannot capture the category semantics of the dialogue well and the generated dialogue is not highly interpretable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of human-computer dialogue, and in particular to an open domain dialogue generation method based on multi-granularity feature decoupling. Background Art

[0002] Human-computer dialogue is mainly divided into task-oriented and non-task dialogue application systems. Although the two deep learning black box models of human-computer dialogue have made continuous progress in dialogue quality, the end-to-end model still lacks interpretability, which means that the model is programmatically unverifiable and incomprehensible. In response to the above problems, the prior art proposes to use a deep latent variable model to improve the interpretability of dialogue generation by decoupling latent variables into different feature representations. However, since the above dialogue model is unsupervised training, it cannot effectively capture the specific semantic information of the dialogue. Therefore, the topic and content of the generated dialogue are not very accurate, resulting in users being unable to obtain effective responses and having a poor experience. Summary of the invention

[0003] The main purpose of this invention is to propose an open domain dialogue generation method based on multi-granularity feature decoupling, aiming to solve the technical problems that the existing models cannot capture the category semantics of the dialogue well and the generated dialogue is not highly interpretable.

[0004] To achieve the above object, the present invention provides an open domain dialogue generation method based on multi-granularity feature decoupling, and the open domain dialogue generation method based on multi-granularity feature decoupling comprises the following steps:

[0005] Acquire a data set and a dialogue category; wherein the data set includes M training pairs, one training pair includes a dialogue reference response and a dialogue question corresponding to the dialogue reference response, and the dialogue category is category information of the training pair;

[0006] Randomly select a number of first training pairs from the data set and input them into a conditional variational autoencoder (CVAE) model to obtain a priori Gaussian distribution corresponding to the dialog category; wherein the first training pair is the training pair randomly selected from the data set;

[0007] Inputting the second training pair in the data set into the advanced conditional variational autoencoder A-CVAE model to obtain the reconstruction expected loss and KL divergence; wherein the second training pair is the training pair randomly selected from the data set;

[0008] Obtaining a total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair;

[0009] Perform reverse gradient optimization on the A-CVAE model according to the total loss to obtain a trained A-CVAE model;

[0010] Get the conversation questions to be answered;

[0011] The dialogue question to be answered is input into the trained A-CVAE model to generate a dialogue reply.

[0012] Optionally, the step of randomly selecting a number of training pairs from the data set and inputting the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category includes:

[0013] Dividing the data set into k sub-data sets according to the dialogue categories;

[0014] A plurality of pairs of training pairs are randomly selected from the first sub-dataset to train the conditional variational autoencoder CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the first class class; wherein the CVAE model includes: a first input encoder, a first output encoder, a first priori network, a first approximate posterior network and a first decoder; wherein the first input encoder, the first output encoder and the first decoder are LSTM network models, and the first priori network and the first approximate posterior network are MLP network models;

[0015] Randomly select a number of training pairs from the second sub-dataset to train the CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the second dialogue category;

[0016] By analogy, after obtaining the prior Gaussian distribution corresponding to the k-1th dialogue category, several training pairs are randomly selected from the kth sub-dataset to train the CVAE model in sequence to obtain the prior Gaussian distribution of the kth dialogue category.

[0017] Optionally, the step of randomly selecting a number of pairs of training pairs from the kth sub-dataset to train the conditional variational autoencoder CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the kth dialogue category includes:

[0018] Randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-dataset;

[0019] Inputting the first dialogue question into the first input encoder to obtain a first question vector;

[0020] Inputting the first dialogue reference reply into the output encoder to obtain a first reply vector;

[0021] Inputting the first problem vector into the first prior network to obtain a first prior distribution expectation and a first prior distribution standard deviation;

[0022] Concatenate the first reply vector and the first question vector to obtain a first concatenated vector;

[0023] Inputting the first concatenated vector into the first approximate posterior network to obtain a first latent variable;

[0024] Processing the first latent variable according to the reparameterization technique to obtain a first posterior distribution expectation and a first posterior distribution standard deviation;

[0025] Inputting the first latent variable z into the first decoder to obtain a first generated response;

[0026] Obtain a variational evidence lower bound ELBO according to the first generated response, the first reference response, the first latent variable, and the first dialogue question;

[0027] Perform reverse gradient optimization on the CVAE model according to the ELBO to obtain a first CVAE model;

[0028] Detecting whether the model parameters of the first CVAE model converge;

[0029] If the model parameters of the first CVAE model have not converged, executing: randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-dataset;

[0030] If the model parameters of the first CVAE model converge, a prior Gaussian distribution corresponding to the first dialogue category is obtained according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation and the first posterior distribution standard deviation.

[0031] Optionally, the step of obtaining a priori Gaussian distribution corresponding to the kth dialogue category according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation comprises:

[0032] Prior Gaussian distribution corresponding to the k-th dialogue category Among them, k is the dialogue category, j is the dimension of the first latent variable z; d z is the highest dimension of the first latent variable, μ k is the first posterior distribution expectation in the k-th dialogue category, σ k The standard deviation of the first approximate posterior distribution within the k-th dialogue class.

[0033] Optionally, the step of inputting the second training pair in the data set into the A-CVAE model to obtain the reconstructed expected loss and KL divergence includes:

[0034] Reading a second dialogue reference response and a second dialogue question corresponding to the second dialogue reference response in the second training pair;

[0035] Inputting a second dialogue question in the second training pair into a second input encoder to obtain a second question vector;

[0036] Inputting the second dialogue reference reply in the second training pair into a second output encoder to obtain a second reply vector;

[0037] Inputting the second question vector into a second prior network to obtain a second prior distribution expectation and a second prior distribution standard deviation;

[0038] Concatenate the second reply vector and the second question vector to obtain a second concatenated vector;

[0039] Inputting the second concatenated vector into a second approximate posterior network to obtain a second latent variable;

[0040] Processing the second latent variable according to the reparameterization technique to obtain a second approximate posterior distribution expectation and a second approximate posterior distribution standard deviation;

[0041] Inputting the second latent variable into a second decoder to obtain a second generated response;

[0042] Processing the second generated response and the second reference response according to a Monte Carlo sampling method to obtain a reconstruction expected loss;

[0043] A KL divergence is obtained according to the second prior distribution expectation, the second prior distribution standard deviation and the second latent variable.

[0044] Optionally, the step of obtaining the reconstructed expected loss according to the second generated response and the second reference response includes:

[0045] q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable; p θ (X|z,C) is the probability of inputting the second latent variable into the second decoder to obtain the second generated response; E is the mathematical expectation;

[0046] The step of obtaining the KL divergence according to the second prior distribution expectation, the second prior distribution standard deviation, the second approximate posterior distribution expectation and the second approximate posterior distribution standard deviation comprises:

[0047] The second prior latent variable is obtained according to the second prior distribution expectation and the second prior distribution standard deviation:

[0048] According to the second prior latent variable and the second latent variable z, the KL divergence is obtained; wherein the KL divergence is in, The probability of inputting the second priori network into the second problem vector to obtain the second priori latent variable; q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable.

[0049] Optionally, the step of obtaining the total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair includes:

[0050]

[0051] Among them, X is the dialogue reference response, C is the dialogue question, z is the first latent variable, β is the first coefficient, λ is the second coefficient, φ is the first probability distribution parameter, is the second probability distribution parameter, θ is the third probability distribution parameter, μ is the second posterior distribution expectation, and σ is the second approximate posterior distribution standard deviation. θ The probability distribution of generating a dialogue reference response by inputting the latent variable z into the decoder, q φ The probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable, The probability of the second problem vector being input into the second prior network to obtain the second prior latent variable. N is Gaussian distribution, I is the identity matrix, and E is the mathematical expectation.

[0052] Optionally, the step of performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a step of training the A-CVAE model includes:

[0053] Perform reverse gradient optimization on the A-CVAE model according to the total loss to obtain a first A-CVAE model;

[0054] Detecting whether the model parameters of the first A-CVAE model converge;

[0055] If the model parameters of the first A-CVAE model converge, using the first A-CVAE model as a training A-CVAE model;

[0056] If the model parameters of the first A-CVAE model have not converged, executing: inputting the first training pair in the data set into the A-CVAE model to obtain the step of reconstructing the expected loss and the KL divergence.

[0057] The present invention provides an open domain dialogue generation method based on multi-granularity feature decoupling, which comprises the following steps: obtaining a data set and a dialogue category; randomly selecting a number of first training pairs in the data set and inputting them into a conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category; inputting a second training pair in the data set into an advanced conditional variational autoencoder A-CVAE model to obtain a reconstruction expected loss and a KL divergence; obtaining a total loss according to the reconstruction expected loss, the KL divergence, and the priori Gaussian distribution corresponding to the first training pair; performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a training A-CVAE model; obtaining a dialogue question to be answered; inputting the dialogue question to be answered into the training A-CVAE model to generate a dialogue reply. The present invention can solve the technical problem that the existing model cannot capture the category semantics of the dialogue well and the generated dialogue is not highly interpretable.

[0058] The present invention optimizes the latent space by introducing prior knowledge, so that the latent space is interpretable and easy to distinguish, thereby better guessing the semantic category of the sentence.

[0059] The present invention approximates the latent space distribution by introducing a golden Gaussian distribution containing category information, so that the model can map conversations of different categories to different positions in the latent space, thereby allowing the model to generate high-quality and diverse responses while being interpretable.

[0060] This paper proposes a new measurement indicator (the prior Gaussian distribution corresponding to the dialogue category), which can more objectively evaluate the interpretability of the latent space. The golden category Gaussian (the prior Gaussian distribution) obtained by pre-training the semantic dialogue category labels is used to supervisely decouple the latent space of the deep latent variable generation model into subspaces of different semantic categories, so that dialogues of different semantic categories can be mapped to different positions in the latent space. This enables the model to better capture the semantics of the dialogue, thereby improving the interpretability of the dialogue generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a flow chart of a first embodiment of an open domain dialogue generation method based on multi-granularity feature decoupling according to the present invention;

[0062] Figure 2 It is a schematic diagram of the process of the CVAE model of the present invention;

[0063] Figure 3 This is a schematic diagram of the visual results of the hidden variable z of the present invention;

[0064] Figure 4 Schematic diagram of the process of the A-CVAE model of the present invention;

[0065] Figure 5Schematic diagram of the process of the VAE model of the present invention;

[0066] Figure 6 This is an evaluation index table for comparing the effects of multiple models of the present invention.

[0067] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0068] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0069] Reference Figure 1 , Figure 1 It is a flowchart diagram of the first embodiment of the open domain dialogue generation method based on multi-granularity feature decoupling of the present invention.

[0070] In an embodiment of the present invention, the open domain dialogue generation method based on multi-granularity feature decoupling is applied to a dialogue generation device. The open domain dialogue generation method based on multi-granularity feature decoupling includes:

[0071] Step S10, obtaining a data set and a dialogue category; wherein the data set includes M training pairs, one training pair includes a dialogue reference response and a dialogue question corresponding to the dialogue reference response, and the dialogue category is the category information of the training pair;

[0072] In this embodiment, in order to solve the technical problem that the existing model cannot capture the category semantics of the dialogue well and the generated dialogue is not highly interpretable. The dialogue generation device obtains a data set and a dialogue category; wherein the data set includes M training pairs, a training pair includes a dialogue reference response and a dialogue question corresponding to the dialogue reference response, and the dialogue category is the category information of the training pair; wherein M is a positive integer. Among them, the dialogue category is 4 categories

[0073] Step S20, randomly selecting a number of first training pairs in the data set and inputting them into the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category; wherein the first training pairs are training pairs randomly selected from the data set;

[0074] In this embodiment, after obtaining the dataset and the dialogue category, the dialogue generation device randomly selects several first training pairs from the dataset and inputs them into the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category; wherein the first training pairs are training pairs randomly selected from the dataset.

[0075] Step S20 randomly selects several training pairs in the data set and inputs them into the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category, which may include:

[0076] Step S21, dividing the data set into k sub-data sets according to the dialogue categories;

[0077] In this embodiment, after acquiring the data set and the dialogue category, the dialogue generation device divides the data set into k sub-data sets according to the dialogue category, where k is a positive integer and is less than or equal to M.

[0078] Step S22, randomly select several pairs of training pairs from the first sub-dataset to train the conditional variational autoencoder CVAE model in sequence to obtain the prior Gaussian distribution corresponding to the first class class; Figure 2 As shown, the CVAE model includes: the first input encoder Encoder in 、First output encoder Encoder out , the first prior network First approximate posterior network PriorNet q φ (z|C) and the first decoder Decoder p θ (X|z,C); wherein the first input encoder, the first output encoder and the first decoder are LSTM network models, and the first prior network and the first approximate posterior network are MLP network models;

[0079] In this embodiment, after dividing the data set into k sub-data sets according to the dialogue category, the dialogue generation device randomly selects several pairs of training pairs from the first sub-data set to train the conditional variational autoencoder CVAE model in sequence to obtain the prior Gaussian distribution corresponding to the first category of dialogue.

[0080] Step S221, randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-data set;

[0081] In this embodiment, after dividing the data set into k sub-data sets according to the dialogue categories, the dialogue generation device randomly selects a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-data set.

[0082] Step S222, inputting the first dialogue question into the first input encoder to obtain a first question vector;

[0083] In this embodiment, after randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-data set, the dialogue generation device inputs the first dialogue question into a first input encoder to obtain a first question vector.

[0084] Step S223, inputting the first dialogue reference reply into the first output encoder to obtain a first reply vector;

[0085] In this embodiment, after randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-data set, the dialogue generation device inputs the first dialogue reference response into a first output encoder to obtain a first response vector.

[0086] Step S224, inputting the first problem vector into the first prior network to obtain a first prior distribution expectation and a first prior distribution standard deviation;

[0087] In this embodiment, after obtaining the first question vector, the dialogue generation device inputs the first question vector into the first prior network (PriorNet (Encoder in (C))) obtain the first prior distribution expectation μ' and the first prior distribution standard deviation σ';

[0088] Step S224 inputs the first problem vector into the first prior network to obtain the first prior distribution expectation and the first prior distribution standard deviation, which may include:

[0089] Step S2241, inputting the first problem vector into the first priori network to obtain a first priori latent variable;

[0090] Step S2242, processing the first prior latent variable according to the reparameterization technique to obtain the first prior distribution expectation and the first prior distribution standard deviation.

[0091] In this embodiment, after obtaining the first question vector, the dialogue generation device inputs the first question vector into the first prior network to obtain the first prior latent variable z'; processes the first prior latent variable according to the reparameterization technique to obtain the first prior distribution expectation and the first prior distribution standard deviation, and obtains the first prior distribution expectation μ' and the first prior distribution standard deviation σ'.

[0092] Among them, the first prior latent variable z'=μ'+σ'*ε,ε~N(0,I).

[0093] Step S225, concatenating the first reply vector and the first question vector to obtain a first concatenated vector;

[0094] In this embodiment, after obtaining the first question vector and the first reply vector, the dialogue generation device concatenates the first reply vector and the first question vector to obtain a first concatenated vector.

[0095] Step S226, inputting the first concatenated vector into a first approximate posterior network to obtain a first latent variable;

[0096] In this embodiment, after obtaining the first splicing vector, the dialogue generation device inputs the first splicing vector into a first approximate posterior network to obtain a first latent variable z.

[0097] Input the first concatenated vector into the first approximate posterior network In the equation, we get the first posterior distribution expectation μ and the first posterior distribution standard deviation σ.

[0098] Step S227, processing the first latent variable according to the reparameterization technique to obtain a first posterior distribution expectation and a first posterior distribution standard deviation;

[0099] In this embodiment, after obtaining the first latent variable z, the dialog generation device processes the first latent variable according to the reparameterization technique to obtain the first approximate posterior distribution expectation μ and the first approximate posterior distribution standard deviation σ. Wherein, the first latent variable z=μ+σ*ε,ε~N(0,I). Figure 3 It is the visual result of the latent variable (it can be the first latent variable or the second latent variable). The figure records the distribution of the latent variables encoded by the model in the latent space, indicating that our model can encode the conversation into different positions in the latent space according to the conversation category.

[0100] Step S228, inputting the first latent variable z into the first decoder to obtain a first generated response;

[0101] In this embodiment, after obtaining the first latent variable z, the dialogue generation device inputs the first latent variable z into the first decoder to obtain a first generated response.

[0102] Step S229, obtaining a variational evidence lower bound ELBO according to the first generated response, the first reference response, the first latent variable and the first dialogue question;

[0103] In this embodiment, after obtaining the first generated response, the dialogue generation device obtains the variational evidence lower bound ELBO according to the first generated response, the first reference response, the first latent variable and the first dialogue question; wherein,

[0104] Step S2210, performing reverse gradient optimization on the CVAE model according to ELBO to obtain a first CVAE model;

[0105] In this embodiment, after obtaining ELBO, the dialogue generation device performs reverse gradient optimization on the CVAE model according to ELBO to obtain a first CVAE model.

[0106] Step S2211, detecting whether the model parameters of the first CVAE model converge;

[0107] In this embodiment, after obtaining the first CVAE model, the dialogue generation device detects whether the model parameters of the pre-trained CVAE model have converged.

[0108] Step S2212, if the model parameters of the first CVAE model have not converged, executing: randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-dataset;

[0109] In this embodiment, when the model parameters of the first CVAE model have not converged, step S221 is executed.

[0110] Step S2213, if the model parameters of the first CVAE model converge, the prior Gaussian distribution corresponding to the first dialogue category is obtained according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation and the first posterior distribution standard deviation.

[0111] In this embodiment, when the model parameters of the first CVAE model have not converged, the prior Gaussian distribution corresponding to the first dialogue category is obtained according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation. Among them, the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation can be multiple, and the number of the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation is determined according to the dimension of the first latent variable z.

[0112] Step S2213 obtains the prior Gaussian distribution corresponding to the kth dialogue category according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation, which may include:

[0113] Prior Gaussian distribution corresponding to the k-th dialogue category Among them, k is the dialogue category, j is the dimension of the first latent variable z; d z is the highest dimension of the first latent variable, μ k is the first posterior distribution expectation in the k-th dialogue category, σ k The standard deviation of the first approximate posterior distribution within the k-th dialogue class.

[0114] Step S23, randomly selecting a number of training pairs from the second sub-dataset to train the CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the second dialogue category;

[0115] In this embodiment, after obtaining the prior Gaussian distribution corresponding to the first type of dialogue, the dialogue generation device randomly selects a number of training pairs from the second sub-dataset to train the CVAE model in sequence to obtain the prior Gaussian distribution corresponding to the second dialogue category. Referring to steps S221 to S2213, the prior Gaussian distribution corresponding to the second dialogue category can be obtained.

[0116] Step S24, and so on, after obtaining the prior Gaussian distribution corresponding to the k-1th dialogue category, several training pairs are randomly selected from the kth sub-dataset to train the CVAE model in sequence to obtain the prior Gaussian distribution of the kth dialogue category.

[0117] In this embodiment, by analogy, after obtaining the prior Gaussian distribution corresponding to the k-1th dialogue category, the dialogue generation device randomly selects a number of training pairs from the kth sub-data set to train the CVAE model in sequence to obtain the prior Gaussian distribution of the kth dialogue category. Referring to steps S221 to S2213, the prior Gaussian distribution corresponding to the k-1th dialogue category can be obtained. Referring to steps S221 to S2213, the prior Gaussian distribution corresponding to the k-1th dialogue category can be obtained.

[0118] Step S30, inputting the second training pair in the data set into the advanced conditional variational autoencoder A-CVAE model to obtain the reconstruction expected loss and KL divergence;

[0119] In this embodiment, after obtaining the prior Gaussian distribution corresponding to the dialogue category, the dialogue generation device inputs the second training pair in the data set into the advanced conditional variational autoencoder A-CVAE model to obtain the reconstruction expected loss and KL divergence; wherein the second training pair is a training pair randomly selected from the data set; wherein, Figure 4 As shown, the A-CVAE model includes: the second input encoder Encoder in , the second output encoder Encoder out , the second prior network Second approximate posterior network PriorNet q φ (z|C) and the second decoder Decoder p θ (X|z,C); wherein the second input encoder, the second output encoder and the second decoder are LSTM network models, and the second prior network and the second approximate posterior network are MLP network models.

[0120] Step S30 inputs the second training pair in the data set into the A-CVAE model to obtain the reconstruction expected loss and KL divergence, which may include:

[0121] Step S31, reading the second dialogue reference response in the second training pair and the first dialogue question corresponding to the first dialogue reference response;

[0122] In this embodiment, after obtaining the prior Gaussian distribution corresponding to the dialogue category, the dialogue generation device reads the second dialogue reference response in the second training pair and the first dialogue question corresponding to the first dialogue reference response.

[0123] Step S32, inputting the second dialogue question in the second training pair into the second input encoder to obtain a second question vector;

[0124] In this embodiment, after reading the second dialogue question, the dialogue generation device inputs the second dialogue question in the second training pair into the second input encoder to obtain a second question vector.

[0125] Step S33, inputting the second dialogue reference reply in the second training pair into the second output encoder to obtain a second reply vector;

[0126] In this embodiment, after reading the second dialogue reference response, the dialogue generation device inputs the second dialogue reference response in the second training pair into the second output encoder to obtain a second response vector.

[0127] Step S34, inputting the second question vector into the second prior network to obtain a second prior distribution expectation and a second prior distribution standard deviation;

[0128] In this embodiment, after obtaining the second question vector, the dialogue generation device inputs the second question vector into the second prior network (PriorNet (Encoder in (C))), we obtain the second prior distribution expectation μ' and the second prior distribution standard deviation σ'.

[0129] Step S34 inputs the second problem vector into the second prior network to obtain a second prior distribution expectation and a second prior distribution standard deviation, which may include:

[0130] Step S341, inputting the second problem vector into the second priori network to obtain a second priori latent variable z';

[0131] Step S342, processing the second prior latent variable z' according to the reparameterization technique to obtain the second prior distribution expectation μ' and the second prior distribution standard deviation σ'.

[0132] Among them, the second prior latent variable z'=μ'+σ'*ε,ε~N(0,I).

[0133] Step S35, concatenating the second reply vector and the second question vector to obtain a second concatenated vector;

[0134] In this embodiment, after obtaining the second reply vector and the second question vector, the dialogue generation device concatenates the second reply vector and the second question vector to obtain a second concatenated vector.

[0135] Step S36, inputting the second concatenated vector into a second approximate posterior network to obtain a second latent variable;

[0136] In this embodiment, after obtaining the second splicing vector, the dialog generation device inputs the second splicing vector into the second approximate posterior network. In the equation, we get the second latent variable z.

[0137] Step S37, processing the second latent variable according to the reparameterization technique to obtain the second approximate posterior distribution expectation and the second approximate posterior distribution standard deviation;

[0138] In this embodiment, after obtaining the second latent variable z, the dialogue generation device processes the second latent variable z according to the reparameterization technique to obtain the second approximate posterior distribution expectation μ and the second approximate posterior distribution standard deviation σ. Figure 3 It is the visual result of the latent variable (it can be the first latent variable or the second latent variable). The figure records the distribution of the latent variables encoded by the model in the latent space, indicating that our model can encode the conversation into different positions in the latent space according to the conversation category.

[0139] Step S38, inputting the second latent variable into the second decoder to obtain a second generated response;

[0140] In this embodiment, after obtaining the second latent variable z, the dialogue generation device inputs the second latent variable z into the second decoder to obtain a second generated response.

[0141] Step S39, processing the second generated response and the second reference response according to the Monte Carlo sampling method to obtain a reconstructed expected loss;

[0142] In this embodiment, after obtaining the second generated response, the dialogue generation device processes the second generated response and the second reference response according to the Monte Carlo sampling method to obtain the reconstructed expected loss.

[0143] Step S39 obtains the reconstructed expected loss according to the second generated response and the second reference response, which may include:

[0144] q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable; p θ (X|z,C) is the probability of inputting the second latent variable into the second decoder to obtain the second generated response; E is the mathematical expectation;

[0145] Step S310, according to the second prior distribution expectation, the second prior distribution standard deviation, and the second latent variable z, obtain the KL divergence

[0146] In this embodiment, after obtaining the second prior distribution expectation, the second prior distribution standard deviation and the second latent variable z, the dialogue generation device obtains the KL divergence according to the second prior distribution expectation, the second prior distribution standard deviation and the second latent variable z.

[0147] Step S310 obtains the KL divergence according to the second prior distribution expectation, the second prior distribution standard deviation, and the second latent variable, which may include:

[0148] Step S3101, obtain the second priori latent variable z' according to the second priori distribution expectation and the second priori distribution standard deviation:

[0149] In this embodiment, after obtaining the second prior distribution expectation and the second prior distribution standard deviation, the dialogue generation device obtains the second prior latent variable z' according to the second prior distribution expectation and the second prior distribution standard deviation: wherein the second prior latent variable z'=μ'+σ'*ε,ε~N(0,I).

[0150] Step S3102, according to the second prior latent variable and the second latent variable z, obtain the KL divergence; wherein the KL divergence is in, The probability of inputting the second prior network into the second problem vector to obtain the second prior hidden variable; q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable.

[0151] In this embodiment, after obtaining the second a priori latent variable z', the dialogue generation device obtains the KL divergence according to the second a priori latent variable and the second latent variable z.

[0152] Among them, KL divergence is in, The probability of inputting the second prior network into the second problem vector to obtain the second prior hidden variable; q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable.

[0153] Step S40, obtaining a total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair;

[0154] In this embodiment, after obtaining the reconstruction expected loss and the KL divergence, the dialogue generation device obtains the total loss according to the reconstruction expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair.

[0155] Step S40 obtains the total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair, which may include:

[0156]

[0157] Among them, X is the dialogue reference response, C is the dialogue question, z is the first latent variable, β is the first coefficient, λ is the second coefficient, φ is the first probability distribution parameter, is the second probability distribution parameter, θ is the third probability distribution parameter, μ is the second posterior distribution expectation, and σ is the second approximate posterior distribution standard deviation. θ The probability distribution of generating a dialogue reference response by inputting the latent variable z into the decoder, q φ The probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable, The probability of the second problem vector being input into the second prior network to obtain the second prior latent variable. N is Gaussian distribution, I is the identity matrix, E is the mathematical expectation, and Loss is the total loss.

[0158] Step S50, performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a trained A-CVAE model;

[0159] In this embodiment, after obtaining the total loss, the dialogue generation device performs reverse gradient optimization on the A-CVAE model according to the total loss to obtain a trained A-CVAE model.

[0160] Step S50, performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a trained A-CVAE model, may include:

[0161] Step S51, performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a first A-CVAE model;

[0162] In this embodiment, after obtaining the total loss, the dialogue generation device performs reverse gradient optimization on the A-CVAE model according to the total loss to obtain a first A-CVAE model.

[0163] Step S52, detecting whether the model parameters of the first CVAE model converge;

[0164] In this embodiment, after obtaining the first CVAE model, the dialogue generation device detects whether the model parameters of the first CVAE model converge.

[0165] Step S53, when the model parameters of the first A-CVAE model converge, the first A-CVAE model is used as a training A-CVAE model;

[0166] In this embodiment, when the model parameters of the first A-CVAE model converge, the first A-CVAE model is used as the training A-CVAE model.

[0167] Step S54, when the model parameters of the first A-CVAE model have not converged, execute: input the first training pair in the data set into the A-CVAE model to obtain the step of reconstructing the expected loss and the KL divergence.

[0168] In this embodiment, when the model parameters of the first A-CVAE model have not converged, step S30 is executed.

[0169] Step S60, obtaining the dialogue question to be answered;

[0170] In this embodiment, after obtaining the trained A-CVAE model, the dialogue generation device obtains the dialogue question to be answered.

[0171] Step S70: input the dialogue question to be answered into the training A-CVAE model to generate a dialogue reply.

[0172] In this embodiment, after obtaining the training A-CVAE model and acquiring the dialogue question to be answered, the dialogue generation device inputs the dialogue question to be answered into the training A-CVAE model to generate a dialogue response.

[0173] In this embodiment, through the above scheme, a data set and a dialogue category are obtained; several first training pairs in the data set are randomly selected and input into the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category; the second training pair in the data set is input into the advanced conditional variational autoencoder A-CVAE model to obtain the reconstruction expected loss and KL divergence; the total loss is obtained according to the reconstruction expected loss, KL divergence, and the priori Gaussian distribution corresponding to the first training pair; the A-CVAE model is reversely gradient optimized according to the total loss to obtain a training A-CVAE model; the dialogue question to be replied is obtained; the dialogue question to be replied is input into the training A-CVAE model to generate a dialogue reply. The present invention can solve the technical problem that the existing model cannot capture the category semantics of the dialogue well and the generated dialogue is not highly interpretable. By introducing prior knowledge to optimize the latent space, the latent space is interpretable and easy to distinguish, so that the semantic category of the sentence can be better guessed. By introducing the golden Gaussian distribution containing category information to approximate the latent space distribution, the model can map dialogues of different categories to different positions in the latent space, so that the model can generate high-quality and diverse replies under the premise of interpretability. A new measurement metric (the prior Gaussian distribution corresponding to the dialogue category) is proposed, which can more objectively evaluate the interpretability of the latent space. The golden category Gaussian (the prior Gaussian distribution) obtained by pre-training the semantic dialogue category labels is used to supervisely decouple the latent space of the deep latent variable generation model into subspaces of different semantic categories, so that dialogues of different semantic categories can be mapped to different positions in the latent space. This enables the model to better capture the semantics of the dialogue, thereby improving the interpretability of the dialogue generation.

[0174] In this embodiment, the variational autoencoder (VAE) was first proposed for use in the image field and then applied to the natural language processing field. Figure 5 As shown in the figure, based on VAE, it is proposed to enhance the interpretability of VAE by discovering interpretable semantics through encoder or context prediction. For the first time, a dialogue generation model based on conditional variational autoencoder is proposed, and the external knowledge is integrated to improve the interpretability of the model. A discrete variable with clear semantics is introduced into CVAE, and the semantic distance between latent variables is used to maintain good diversity between sampled latent variables. By introducing exponential mixture distribution to replace Gaussian prior and capture the hidden semantic relationship between mixture components and data, a more interpretable latent space is obtained, and the variational evidence lower bound is decomposed to obtain the loss term that causes mode collapse.

[0175] In this embodiment, an evaluation index (Disentanglement Index Classification Explanation, DICE) is proposed to evaluate the interpretability of the latent space distribution. The responses we generate are sampled on the corresponding category latent space, so the responses generated by the decoder should be text containing category information. Based on this idea, the present invention uses CVAE to train a text classifier, using the reference responses in the dataset as input encoder Encoder in Input, category label as output encoder Encoder out The decoder reconstructs the category label based on the input of the generated response. If the generated response is generated based on the latent variable containing the category information, then the generated response is used as the input of the classifier, and the generated category prediction value should be the same as the prediction value generated by using the reference response in the dataset as the input of the classifier. The proportion of reference responses and generated responses in the test set that are classified as the same category is used as the indicator value to evaluate the interpretability of the latent space distribution.

[0176] The dataset used is Daily Dialog Dataset, which is a labeled multi-round dialogue dataset. We split the multi-round dialogue into single-round dialogues. The dataset has two labels, including 4 types of behaviors and 10 types of emotions. However, the distribution of emotion labels in the dataset is too uneven, so emotion labels are not used as classification. We balanced the dataset according to the behavior labels, so that the data of various behavior labels (dialogue labels) are evenly distributed in the dataset.

[0177] In this embodiment, three evaluation indicators are used to evaluate the quality of text generation. BLEU calculates the frequency of co-occurring words in two sentences, that is, by counting the number of times the n-gram phrases in the generated response and the real response appear in the entire training corpus. ROUGE evaluates the quality of text by calculating the frequency of co-occurring words, but unlike BLEU, ROUGE's words may not be continuous, while BLEU's n-gram requires words to appear continuously. METEOR has made some improvements based on BLEU and added an alignment relationship between the generated response and the real response. WordNet is used to calculate specific sequence matching, synonyms, roots and affixes, and matching relationships between interpretations, which improves the effect of BLEU and makes it more relevant to manual judgment. For ease of observation, we mapped the indicator values ​​to 0 to 100. At the same time, the self-proposed indicator DICE is used to evaluate the interpretability of the latent space in the dialogue behavior category. Distinct-2 determines whether there are a large number of general and repetitive responses, which is used to evaluate the diversity of text generation.

[0178] The A-CVAE model was compared with the following models in the dialogue generation task: first, seq2seq, combined with Global Attention; second, Transformer, using the self-Attention mechanism to encode and decode dialogues; third, Vanilla VAE, using continuous latent space and prior normal distribution; fourth, Vanilla CVAE, introducing conditional variables on the basis of VAE, which is more suitable for dialogue generation; fifth, CVAE with VADE, using clustering tasks to assist in latent variable representation. The model encoder and decoder use LSTM, hidden size 300, latent variable 200 dimensions, and use KL annealing algorithm for periodic annealing to avoid KL posterior collapse.

[0179] The performance of the A-CVAE model and other models for dialogue generation on several evaluation indicators (BLEU, METEOR, ROUGE, DICE, Distinct-2), such as Figure 6As shown. The A-CVAE model is higher than other models in BLEU and METEOR, and only lower than Transformer in ROUGE. The A-CVAE model is better than other models in text generation quality. In the indicators we proposed, we can see that the seq2seq without using latent space, the transformer is much lower than other models, indicating that the use of latent space is very effective for text generation. The Vanilla VAE is also low in this indicator because its latent space is only generated by questions, while the latent space of CVAE is generated by two information: questions and replies. Therefore, in dialogue generation, the latent space of VAE is a missing latent space that does not contain complete information, and the generated replies will be less distinguishable on the act label. In terms of the diversity of text generation, the A-CVAE model is only lower than the transformer. Compared with other models, our model is still greatly improved, indicating that our model can generate diverse replies.

[0180] Therefore, based on CVAE, we use macroscopic category-guided response knowledge to guide the distribution of mesoscopic latent space, forcing different dialogues to be encoded and mapped to different positions in the latent space, enhancing the interpretability of the model's latent space while generating high-quality and diverse texts. Experimental results show that compared with several other models on the DD dataset, the A-CVAE model can generate higher-quality diverse dialogue texts and interpretable latent spaces in the dialogue generation task.

[0181] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0182] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0183] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0184] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for open domain dialogue generation based on multi-granularity feature decoupling, It is characterized in that The steps include: Acquire a data set and a dialogue category; the data set includes M training pairs, the training pairs include dialogue reference responses and dialogue questions corresponding to the dialogue reference responses, and the dialogue category is category information of the training pairs; Randomly select a number of first training pairs from the data set and input them into a conditional variational autoencoder (CVAE) model to obtain a priori Gaussian distribution corresponding to the dialogue category; the first training pairs are the training pairs randomly selected from the data set; Inputting the second training pair in the data set into the advanced conditional variational autoencoder A-CVAE model to obtain the reconstruction expected loss and KL divergence; the second training pair is the training pair randomly selected from the data set; Obtaining a total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair; Perform reverse gradient optimization on the A-CVAE model according to the total loss to obtain a trained A-CVAE model; Get the conversation questions to be answered; Inputting the dialogue question to be answered into the trained A-CVAE model to generate a dialogue answer; The step of randomly selecting a number of training pairs from the data set and inputting the conditional variational autoencoder CVAE model to obtain a priori Gaussian distribution corresponding to the dialogue category includes: Dividing the data set into k sub-data sets according to the dialogue categories; A plurality of pairs of training pairs are randomly selected from the first sub-dataset to train the conditional variational autoencoder CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the first class class; the CVAE model comprises: a first input encoder, a first output encoder, a first priori network, a first approximate posterior network and a first decoder; wherein the first input encoder, the first output encoder and the first decoder are LSTM network models, and the first priori network and the first approximate posterior network are MLP network models; Randomly select a number of training pairs from the second sub-dataset to train the CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the second dialogue category; By analogy, after obtaining the prior Gaussian distribution corresponding to the k-1th dialogue category, several pairs of training pairs are randomly selected from the kth sub-dataset to train the CVAE model in sequence to obtain the prior Gaussian distribution of the kth dialogue category; The step of randomly selecting a number of training pairs from the kth sub-dataset to train the conditional variational autoencoder CVAE model in sequence to obtain a priori Gaussian distribution corresponding to the kth dialogue category includes: Randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-dataset; Inputting the first dialogue question into the first input encoder to obtain a first question vector; Inputting the first dialogue reference reply into the output encoder to obtain a first reply vector; Inputting the first problem vector into the first prior network to obtain a first prior distribution expectation and a first prior distribution standard deviation; Concatenate the first reply vector and the first question vector to obtain a first concatenated vector; Inputting the first concatenated vector into the first approximate posterior network to obtain a first latent variable; Processing the first latent variable according to the reparameterization technique to obtain a first posterior distribution expectation and a first posterior distribution standard deviation; Inputting the first latent variable z into the first decoder to obtain a first generated response; Obtain a variational evidence lower bound ELBO according to the first generated response, the first reference response, the first latent variable, and the first dialogue question; Perform reverse gradient optimization on the CVAE model according to the ELBO to obtain a first CVAE model; Detecting whether the model parameters of the first CVAE model converge; If the model parameters of the first CVAE model have not converged, executing: randomly selecting a first dialogue reference response and a first dialogue question corresponding to the first dialogue reference response from the first sub-dataset; If the model parameters of the first CVAE model converge, obtaining a priori Gaussian distribution corresponding to the first dialogue category according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation; The step of obtaining a priori Gaussian distribution corresponding to the kth dialogue category according to the first prior distribution expectation, the first prior distribution standard deviation, the first posterior distribution expectation, and the first posterior distribution standard deviation comprises: Prior Gaussian distribution corresponding to the k-th dialogue category Among them, k is the dialogue category, j is the dimension of the first latent variable z; d z is the highest dimension of the first latent variable, μ k is the first posterior distribution expectation in the k-th dialogue category, σ k The standard deviation of the first approximate posterior distribution in the k-th conversation category; The step of inputting the second training pair in the data set into the A-CVAE model to obtain the reconstruction expected loss and KL divergence includes: Reading a second dialogue reference response and a second dialogue question corresponding to the second dialogue reference response in the second training pair; Inputting a second dialogue question in the second training pair into a second input encoder to obtain a second question vector; Inputting the second dialogue reference reply in the second training pair into a second output encoder to obtain a second reply vector; Inputting the second question vector into a second prior network to obtain a second prior distribution expectation and a second prior distribution standard deviation; Concatenate the second reply vector and the second question vector to obtain a second concatenated vector; Inputting the second concatenated vector into a second approximate posterior network to obtain a second latent variable; Processing the second latent variable according to the reparameterization technique to obtain a second approximate posterior distribution expectation and a second approximate posterior distribution standard deviation; Inputting the second latent variable into a second decoder to obtain a second generated response; Processing the second generated response and the second reference response according to a Monte Carlo sampling method to obtain a reconstruction expected loss; Obtaining KL divergence according to the second prior distribution expectation, the second prior distribution standard deviation and the second latent variable; The step of obtaining the reconstructed expected loss according to the second generated response and the second reference response comprises: q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable; p θ (X|z,C) is the probability of inputting the second latent variable into the second decoder to obtain the second generated response; E is the mathematical expectation; The step of obtaining the KL divergence according to the second prior distribution expectation, the second prior distribution standard deviation, the second approximate posterior distribution expectation and the second approximate posterior distribution standard deviation comprises: The second prior latent variable is obtained according to the second prior distribution expectation and the second prior distribution standard deviation: According to the second prior latent variable and the second latent variable z, the KL divergence is obtained; wherein the KL divergence is in, The probability of inputting the second priori network into the second problem vector to obtain the second priori latent variable; q φ (z|X,C) is the probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable; The step of obtaining the total loss according to the reconstructed expected loss, the KL divergence, and the prior Gaussian distribution corresponding to the first training pair includes: Among them, X is the dialogue reference response, C is the dialogue question, z is the first latent variable, β is the first coefficient, λ is the second coefficient, φ is the first probability distribution parameter, is the second probability distribution parameter, θ is the third probability distribution parameter, μ is the second posterior distribution expectation, σ is the second approximate posterior distribution standard deviation, p θ The probability distribution of generating a dialogue reference response by inputting the latent variable z into the decoder, q φ The probability of the second concatenated vector being input into the second approximate posterior network to obtain the first latent variable, The probability of the second problem vector being input into the second prior network to obtain the second prior latent variable, N is the Gaussian distribution, I is the identity matrix, and E is the mathematical expectation; The A-CVAE model includes: the second input encoder Encoder in , the second output encoder Encoder out , the second prior network Second approximate posterior network PriorNet q φ (z|C) and the second decoder Decoderp θ (X|z,C); wherein the second input encoder, the second output encoder and the second decoder are LSTM network models, and the second prior network and the second approximate posterior network are MLP network models.

2. The method for generating open domain dialogue based on multi-granularity feature decoupling according to claim 1, It is characterized in that The step of performing reverse gradient optimization on the A-CVAE model according to the total loss to obtain a training A-CVAE model includes: Perform reverse gradient optimization on the A-CVAE model according to the total loss to obtain a first A-CVAE model; Detecting whether the model parameters of the first A-CVAE model converge; If the model parameters of the first A-CVAE model converge, using the first A-CVAE model as a training A-CVAE model; If the model parameters of the first A-CVAE model have not converged, executing: inputting the first training pair in the data set into the A-CVAE model to obtain the step of reconstructing the expected loss and the KL divergence.