An information processing method, apparatus, device, and readable storage medium
By employing supervised pre-training and semi-supervised training of generative pre-trained models in task-oriented dialogue systems, combined with variational learning or self-training methods, the problem of dependence on labeled information in existing technologies is solved, thereby improving the output accuracy of the model.
Patent Information
- Application Number
- CN202210199563.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-03-02
AI Technical Summary
Existing task-oriented dialogue systems rely entirely on labeled information during model training, resulting in low output accuracy and impacting the performance of end-to-end task-oriented dialogue systems.
Supervised pre-training of generative pre-trained models is adopted, combined with semi-supervised training methods. Using labeled and unlabeled sample data, variational learning or self-training methods are used to optimize the generative and inference models, thereby improving the performance of the models.
This improves the model performance of end-to-end task-oriented dialogue systems in supervised and semi-supervised scenarios, thereby increasing the accuracy of output information.
Smart Images

Figure CN116737885B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an information processing method, apparatus, device, and readable storage medium. Background Technology
[0002] Task-oriented dialogue systems (hereinafter referred to as task-oriented dialogue systems) are primarily used to help users complete a specific task, such as booking a restaurant or checking train tickets. In a task-oriented dialogue system, the user's input has a clear purpose. The system needs to understand the user's intent through interaction, thereby obtaining the dialogue state. Using this state, the system queries a database for information, determines the next dialogue action based on the query results, and then generates the corresponding natural language. Task-oriented dialogues typically involve multi-turn question-and-answer processes.
[0003] In task-oriented dialogue systems, numerous works have applied semi-supervised learning to task-oriented dialogue datasets, aiming to achieve similar results to supervised learning by utilizing a small amount of labeled data and a large amount of unlabeled data. Among these, the Generative Pre-Training (GPT) model, also known as the GPT-2 model, is a large-scale language model based on transformers. This model employs a pre-training plus fine-tuning training mode and can be used for tasks such as classification, reasoning, question answering, and similarity analysis.
[0004] Although task-oriented dialogue systems modeled using GPT-2 have achieved good results, this approach still relies entirely on labeled information during model training, resulting in low model performance and affecting the accuracy of the output of end-to-end task-oriented dialogue systems. Summary of the Invention
[0005] This application provides an information processing method, apparatus, device, and readable storage medium to improve the accuracy of the output of an end-to-end task-oriented dialogue system.
[0006] In a first aspect, embodiments of this application provide an information processing method, including:
[0007] Obtain user input information;
[0008] The input information is used as the input to an end-to-end task-oriented dialogue system to obtain the output information;
[0009] The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the model obtained from the pre-training.
[0010] The training of the processing model includes:
[0011] Supervised pre-training is performed based on labeled sample data and generative pre-trained models.
[0012] Based on the model obtained from pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0013] The supervised pre-training based on labeled sample data and a generative pre-trained model includes:
[0014] The generative model is pre-trained using labeled sample data and a generative pre-trained model.
[0015] The inference model is pre-trained using the labeled sample data and the generative pre-trained model;
[0016] The generative model or the inference model is obtained based on the generative pre-trained model.
[0017] The step of pre-training a generative model using labeled sample data and a generative pre-trained model includes:
[0018] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a first preset order to obtain the first input sequence;
[0019] The first input sequence is used as input to the generative model to pre-train the generative model.
[0020] The step of pre-training the inference model using the labeled sample data and the generative pre-training model includes:
[0021] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence;
[0022] The second input sequence is used as input to the inference model to pre-train the inference model.
[0023] The model obtained based on pre-training, which utilizes mixed sample data for semi-supervised training, includes:
[0024] Obtain the current sample data from the mixed sample data;
[0025] If the current sample data is labeled sample data, then the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model;
[0026] If the current sample data is unlabeled sample data, then the generative model and inference model obtained through pre-training are trained using variational learning methods based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using self-training methods based on the unlabeled sample data.
[0027] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses;
[0028] The step of concatenating the input variables of each round of task-based dialogue in the labeled sample data according to a first preset order to obtain a first input sequence includes:
[0029] The input variables are concatenated in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
[0030] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses;
[0031] The step of concatenating the input variables of each round of task-based dialogue in the labeled sample data according to a second preset order to obtain a second input sequence includes:
[0032] The input variables are concatenated in the order of user input, system response, dialogue status, database query results, and dialogue actions to obtain the second input sequence.
[0033] Prior to the supervised pre-training using labeled sample data and a generative pre-trained model, the method further includes:
[0034] The labeled sample data is preprocessed.
[0035] Secondly, embodiments of this application provide an information processing apparatus, including:
[0036] The first acquisition module is used to acquire user input information;
[0037] The first processing module is used to take the input information as the input of an end-to-end task-oriented dialogue system and obtain output information.
[0038] The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the model obtained from the pre-training.
[0039] The device further includes a training module, comprising:
[0040] The first training submodule is used for supervised pre-training based on labeled sample data and generative pre-trained models.
[0041] The second training submodule is used to perform semi-supervised training based on the pre-trained model using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0042] The first training submodule includes:
[0043] The first training unit is used to pretrain the generative model using labeled sample data and a generative pretraining model.
[0044] The second training unit is used to pre-train the inference model using the labeled sample data and the generative pre-trained model.
[0045] The generative model or the inference model is obtained based on the generative pre-trained model.
[0046] The first training unit is used to concatenate the input variables of each round of task-based dialogue in the labeled sample data according to a first preset order to obtain a first input sequence; and to pre-train the generative model by using the first input sequence as input to the generative model.
[0047] The second training unit is used to concatenate the input variables of each round of task-based dialogue in the labeled sample data according to a second preset order to obtain a second input sequence; and to use the second input sequence as input to the inference model to pre-train the inference model.
[0048] The second training submodule includes:
[0049] The acquisition unit is used to acquire the current sample data from the mixed sample data;
[0050] The first training unit is configured to, if the current sample data is labeled sample data, concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a first preset order to obtain a first input sequence, and use the input sequence as input to a pre-trained generative model to train the generative model; concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a second preset order to obtain a second input sequence; and use the second input sequence as input to a pre-trained inference model to train the inference model.
[0051] The second training unit is used to train the generative model and inference model obtained through pre-training using variational learning methods based on the unlabeled sample data if the current sample data is unlabeled sample data; or, to train the generative model obtained through pre-training using self-training methods based on the unlabeled sample data.
[0052] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the first training unit is used to concatenate the input variables in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
[0053] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the second training unit is used to concatenate the input variables in the order of user input, system responses, dialogue state, database query results, and dialogue actions to obtain the second input sequence.
[0054] The device further includes:
[0055] A preprocessing module is used to preprocess the labeled sample data and / or the mixed sample data.
[0056] Thirdly, embodiments of this application provide an information processing apparatus, including: a processor and a transceiver;
[0057] The processor is used to acquire user input information; and to use the input information as input to an end-to-end task-oriented dialogue system to obtain output information.
[0058] The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the model obtained from the pre-training.
[0059] The processor is further configured to:
[0060] Supervised pre-training is performed based on labeled sample data and generative pre-trained models.
[0061] Based on the model obtained from pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0062] The processor is further configured to:
[0063] The generative model is pre-trained using labeled sample data and a generative pre-trained model.
[0064] The inference model is pre-trained using the labeled sample data and the generative pre-trained model;
[0065] The generative model or the inference model is obtained based on the generative pre-trained model.
[0066] The processor is further configured to:
[0067] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a first preset order to obtain the first input sequence;
[0068] The first input sequence is used as input to the generative model to pre-train the generative model.
[0069] The processor is further configured to:
[0070] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence;
[0071] The second input sequence is used as input to the inference model to pre-train the inference model.
[0072] The processor is further configured to:
[0073] Obtain the current sample data from the mixed sample data;
[0074] If the current sample data is labeled sample data, then the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model;
[0075] If the current sample data is unlabeled sample data, then the generative model and inference model obtained through pre-training are trained using variational learning methods based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using self-training methods based on the unlabeled sample data.
[0076] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the processor is also used for:
[0077] The input variables are concatenated in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
[0078] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the processor is also used for:
[0079] The input variables are concatenated in the order of user input, system response, dialogue status, database query results, and dialogue actions to obtain the second input sequence.
[0080] The processor is further configured to:
[0081] Data preprocessing is performed on the labeled sample data and / or the mixed sample data.
[0082] Fourthly, embodiments of this application also provide a communication device, including: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the information processing method described above.
[0083] Fifthly, embodiments of this application also provide a readable storage medium storing a program, which, when executed by a processor, implements the steps in the information processing method described above.
[0084] In this embodiment, the processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model, followed by semi-supervised training on the pre-trained model. Therefore, this approach does not rely entirely on labeled sample data for model training, thereby improving the performance of the obtained model under both supervised and semi-supervised conditions. Consequently, when using this end-to-end task-oriented dialogue system for processing, the accuracy of the obtained output information can be improved. Attached Figure Description
[0085] Figure 1 This is one of the flowcharts of the information processing method provided in the embodiments of this application;
[0086] Figure 2 This is a diagram illustrating a task-based dialogue.
[0087] Figure 3 This is a schematic diagram of the pre-trained generative model and inference model in the embodiments of this application;
[0088] Figure 4 This is the second flowchart of the information processing method provided in the embodiments of this application;
[0089] Figure 5 This is one of the structural diagrams of the information processing apparatus provided in the embodiments of this application;
[0090] Figure 6 This is the second structural diagram of the information processing device provided in the embodiments of this application. Detailed Implementation
[0091] In the embodiments of this application, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0092] In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0093] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0094] See Figure 1 , Figure 1 This is a flowchart of the information processing method provided in the embodiments of this application, such as... Figure 1 As shown, it includes the following steps:
[0095] Step 101: Obtain user input information.
[0096] The user's input information can be in the form of voice, text, or other formats. For example, the information could be something like, "I want to go to an Indian restaurant in the north."
[0097] Step 102: Use the input information as input to the end-to-end task-oriented dialogue system to obtain output information.
[0098] The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model, followed by semi-supervised training on the pre-trained model. That is, in this embodiment, the pre-trained language model is combined with a semi-supervised learning method to obtain the processing model used in the end-to-end task-oriented dialogue system. In this embodiment, the processing model used in the end-to-end task-oriented dialogue system can be called a Variational Latent State Generative Pre-trained Language Model (VLS-GPT).
[0099] In this embodiment of the application, the training process of the processing model may include:
[0100] (1) Supervised pre-training is performed based on labeled sample data and generative pre-trained models.
[0101] The annotation refers to the annotation of dialogue data, such as the annotation of dialogue status, database query results, and dialogue actions.
[0102] like Figure 2 The image shows an example of a task-based dialogue. The user's input is "I want to go to an Indian restaurant in the north"; the dialogue state is: restaurant type: Indian; restaurant region: north; the dialogue actions are: informing the user of the number of options; and asking the user for their choice.
[0103] In practical applications, the sample data can be obtained from historical task-oriented dialogue data.
[0104] For a task-oriented dialogue with T rounds (T≥1, and T is an integer), assuming u t b represents user input t Indicates the dialogue state, d t This represents the database query result, a t Indicates a dialogue action, r t This indicates a system response. The subscript t represents the t-th round of dialogue, and the value of t ranges from 1 to t ≤ T.
[0105] For a typical task-oriented end-to-end dialogue system, its basic function is to predict intermediate variables through user input information (first predict the dialogue state, then predict the dialogue action by querying the database), and then generate the final response based on the user input and the predicted intermediate variables, as shown in (1) below:
[0106] p θ (b 1:T d 1:T a 1:T r 1:T |u 1:T ) = pθ (b 1:T d 1:T a 1:T |u 1:T )·p θ (r 1:T |b 1:T b 1:T d 1:T a 1:T (1)
[0107] Where, p θ θ represents the probability output of the model in a task-oriented end-to-end dialogue system, and θ represents the system parameters. In this embodiment, the training objective is to make the above conditional probability distribution fit the true data distribution.
[0108] Suppose that in a real-world scenario, there is a large amount of unlabeled sample data, containing only user input u. t and system reply r t Only a small portion of the labeled sample data contains the intermediate variable b. t d t a t The annotation is used. In this embodiment of the application, a semi-supervised learning method is applied to effectively utilize unlabeled sample data, thereby improving the overall performance of the model.
[0109] Specifically, the model training process may include the following:
[0110] (1.1) Use labeled sample data and generative pre-trained models to pre-train generative models.
[0111] The generative model is obtained based on the generative pre-trained model. Specifically, in this process, the GPT-2 model can be used to model the entire task-oriented dialogue to obtain the generative model p. θ For labeled sample data, the teacher force self-supervised method of GPT-2 can be used to train the generative model p. θ .
[0112] Specifically, the input variables of each round of task-based dialogue in the labeled sample data are concatenated according to a first preset order to obtain a first input sequence. This first input sequence is then used as input to the generative model for pre-training. Specifically, when obtaining the first input sequence, the input variables can be concatenated in the order of user input, dialogue state, database query result, dialogue action, and system response. For example, the input variables of each round of task-based dialogue can be concatenated in the order of user input, dialogue state, database query result, dialogue action, and system response (i.e., the concatenation order is u).t b t d t a t r t The first input sequence for each round of task-based dialogue is obtained. During training, the optimization objective is as shown in equation (1), and the loss function is the cross-entropy between the model's output and the label (which can be the sequence obtained by shifting the input sequence one position to the left) (only the target text b is calculated). 1:T d 1:T a 1:T r 1:T (Cross-entropy at the point). Through such training, the model will possess the ability to predict in task-oriented dialogues, predicting intermediate variables based on user input, and then predicting the system's response.
[0113] (1.2) The inference model is pre-trained using the labeled sample data and the generative pre-trained model.
[0114] Wherein, the inference model q φ This is obtained based on the generative pre-trained model. In this step, the input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence, and this second input sequence is used as the input to the inference model to pre-train the inference model. As mentioned above, the input variables include user input, dialogue state, database query results, dialogue actions, and system responses. Here, the input variables can be concatenated in the order of user input, system response, dialogue state, database query results, and dialogue actions to obtain the second input sequence. For example, the input variables of each round of task-based dialogue can be concatenated in the order of user input, system response, dialogue state, database query results, and dialogue actions to obtain the second input sequence for each round of task-based dialogue.
[0115] In other words, the training process for the inference model differs from that for the generative model in that the input sequence is concatenated differently. When training the inference model, according to u... t r t b t d t a t The input sequence is obtained by concatenating the elements in the given order. This sequence is then shifted left by one position to obtain the label. The loss function is the cross-entropy between the model output and the label (only the target text b is calculated). 1:T d 1:T a 1:T The cross-entropy at the point). For the inference model, its optimization objective is shown in (2):
[0116] q φ (b 1:T d1:T a 1:T |u 1:T r 1:T (2)
[0117] like Figure 3 The diagram shown is a schematic representation of the structure of the generation model and the inference model in an embodiment of this application. The h in the diagram... t =b t d t a t These can be called latent variables or intermediate variables. (User) i BS i DB i Act i Resp i (1≤i≤T) represent user input, dialogue state, database query results, dialogue actions, and system responses, respectively.
[0118] (2) Based on the model obtained by pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0119] In this step, current sample data can be obtained from the mixed sample data. If the current sample data is labeled sample data, the input variables of each round of task-based dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model; if the current sample data is unlabeled sample data, the generative model and inference model obtained through pre-training are trained using a variational learning method based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using a self-training method based on the unlabeled sample data.
[0120] Specifically, sampling can be performed on mixed sample data to obtain the current sample data. If the current sample data is labeled sample data, then the generative model and inference model are trained respectively based on the generative model and inference model obtained through pre-training, following the training method for the generative model and inference model during pre-training.
[0121] If the current sample data is unlabeled, unsupervised learning or training can be performed using the following two methods.
[0122] (2.1) Variational Learning
[0123] The core of variational learning methods is the use of inference networks q φ (b 1:T d 1:T a 1:T |u 1:T r 1:T To fit the true posterior distribution, the Evidence Lower Bound (ELBO) in variational learning can be used to jointly optimize the pre-trained generative and inference models.
[0124] Let h t This represents intermediate information in task-oriented dialogues, namely h. t =b t d t a t Therefore, the optimization objective here, which is the derivation of the next proof, is as follows:
[0125]
[0126] Among them, J VL Indicates evidence for the next term. It expresses expectation.
[0127] By q φ (h 1:T |u 1:T r 1:T Upsampling The parameters θ of the generative model and φ of the inference model can be updated using stochastic gradients, and the above equation can be simplified to:
[0128]
[0129] In the embodiments of this application, Since the sequence is discrete, the Straight-Through gradient estimation method is used to address this issue when optimizing the lower bound of evidence in equation (3). In the Straight-Through method, discrete sampled values are used for forward computation, while their corresponding continuous softmax probability values are used for backward gradient propagation.
[0130] (2.2) Self-Training Method
[0131] Self-training, also known as pseudo-labeling, means generating labels for unlabeled sample data and then training the model accordingly. In self-training methods, for unlabeled sample data, a pre-trained generative model is used to generate labels, and then the generative model is trained using the same method as supervised learning. Its optimization objective is:
[0132]
[0133] in: J ST express:
[0134] Here, the Straight-Through method is also used to pass the gradient through... Pass through to p θ .
[0135] In the training process described above, the pre-trained language model GPT-2 and the semi-supervised learning method are integrated, thereby improving the performance of the model under both supervised and semi-supervised conditions.
[0136] In this embodiment, the processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model, followed by semi-supervised training on the pre-trained model. Therefore, this approach does not rely entirely on labeled sample data for model training, thereby improving the performance of the obtained model under both supervised and semi-supervised conditions. Consequently, when using this end-to-end task-oriented dialogue system for processing, the accuracy of the obtained output information can be improved.
[0137] Based on the above embodiments, data preprocessing can be performed on the labeled sample data and / or the mixed sample data to improve the efficiency of model training. This preprocessing includes tokenization, delexicalization, and other similar processes.
[0138] See Figure 4 , Figure 4 This is a flowchart of the information processing method provided in the embodiments of this application, such as... Figure 4 As shown, it includes the following steps:
[0139] Step 401: Data preprocessing.
[0140] This mainly includes the preprocessing of the sample data. This process may include:
[0141] 1. Tokenization
[0142] Taking English as an example, tokenization refers to breaking down a string of text into individual tokens. These tokens can be mapped to corresponding numbers using a vocabulary. In this way, the entire string sequence becomes a list of numbers, facilitating program processing. The GPT-2 model uses byte-level byte-pair encoding. Unlike ordinary byte-pair encoding (BPE), GPT-2's byte-level BPE uses bytes as the basic vocabulary, forcing a basic vocabulary size of 256. This ensures that every basic character is included in the vocabulary. Combined with special handling of punctuation marks, the GPT-2 tokenizer can separate all text without generating tokens outside the vocabulary. The GPT-2 vocabulary size is 50257, with 256 tokens from the basic vocabulary, 50,000 tokens from 50,000 merges in the BPE process, and a special token indicating the end of text.
[0143] 2. Delexicalization
[0144] To reduce the superficial features introduced by language variations and enable the system to generate more general responses, delexicalization is performed on the system responses in the data during preprocessing. Delexicalization involves replacing specific words in the text (such as proper nouns like place names or shop names) with uniform placeholders. Here, a domain-adaptive delexicalization method is used. This method decouples the domain from the slots, because many slots are shared across different domains, such as names and addresses. Information between these slots is sometimes interchangeable. Decoupling the domain from the slots makes it easier for the model to acquire information across domains.
[0145] For structured labeled information, a domain-adaptive preprocessing method is used to transform it into a text sequence. Dialogue states are represented as a sequence like [domain1]slot value slot value [domain2]slot value; database results are represented by simple placeholders [db_x], where x ranges from 0 to 3, representing the database matching level; system actions are represented as a sequence like [domain1][inform]slot [request]slot [domain2][inform]slot [request]slot, where [inform] indicates the system will inform the user of the corresponding slot information, and [request] indicates the system will query the user for the corresponding slot information.
[0146] The placeholders for the aforementioned domains, slots, or actions will be set as special tokens for the GPT-2 tokenizer and will not be further split during the segmentation process. Their corresponding word embedding vectors will be randomly initialized.
[0147] Step 402: Model training for the end-to-end task-oriented dialogue system.
[0148] 1. Input sequence
[0149] After preprocessing the sample data, all information in the task-oriented dialogue (user input) t Dialogue state b t Database structure d t System action a t And system reply r t All of these are transformed into text sequences. Therefore, two different sequence concatenation methods can be used to perform supervised pre-training of the generative and inference models, with objective functions shown in equations (1) and (2), respectively. The training sequences for the generative and inference models are as follows:
[0150] u1, b1, d1, a1, r1, ..., u T b T d T a T r T (5)
[0151] u1, r1, b1, d1, a1, ..., u T r T b T d T a T (6)
[0152] In the semi-supervised learning stage, facing unlabeled sample data, the corresponding intermediate variables (h, latent variables) are first generated. If the semi-supervised learning adopts a variational learning method, the inference model is used to generate them; if the semi-supervised learning adopts a self-training method, the generative model is used to generate them. Then, supervised training is performed in a similar manner. The objective functions of the variational learning method and the self-training learning method are shown in Equations (3) and (4), respectively, and the training sequences are as follows:
[0153]
[0154]
[0155] For self-training methods, only (7) can be used.
[0156] in, The gradients, representing the generated intermediate annotations, are propagated through these discrete sequences using the Straight-Through method.
[0157] 2. Training parameter settings
[0158] In practical applications, the system can be implemented based on open-source libraries, such as Huggingface Transformers. Taking Huggingface Transformers as an example, this library integrates general-purpose large pre-trained language models based on Transformers and provides very convenient external interfaces. Here, DistilGPT-2 is used to initialize the generative and inference models. DistilGPT-2 is a distillation of GPT-2; compared to GPT-2 with 12 self-attention layers, DistilGPT-2 only contains 6 self-attention layers, thus significantly reducing memory consumption. The maximum number of sequence labels that the GPT-2 model can accept is 1024; therefore, sequences exceeding 1024 in length will be pruned to 1024 from beginning to end.
[0159] When fine-tuning the GPT-2 model, the AdamW optimizer and a linear learning rate scheduler with warm-up are used. The hyperparameters and their corresponding settings are shown in Table 1. The learning rate shown in Table 1 is the maximum learning rate throughout the entire training process. In the first 20% of warm-up steps, the learning rate linearly increases from 0 to 1e-4, and in the next 80% of steps, it linearly decreases from 1e-4 back to 0. This learning rate scheduling method is commonly used for fine-tuning pre-trained language models. The purpose of pre-training is to prevent the model from catastrophically forgetting the previously trained knowledge due to an excessively large learning rate in the early stages. A batch size of 2*16 means that the original batch size was 2, but 16 gradient accumulations were performed, thus equivalent to a batch size of 32. In both the pre-training and semi-supervised learning stages, the model is trained for 50 epochs without using early stopping strategies. After each epoch, the model is tested on the validation set, and the model with the highest combined score is stored.
[0160] Table 1
[0161] Super Parameter set up Learning rate 1e-4 Warm-up ratio 20% Batch size 2*6 Number of iterations (epochs) 50
[0162] Step 403: Obtain user input information.
[0163] The input information can be information entered by the user through voice, text, or other means.
[0164] Step 404: Based on the input information, run the end-to-end task-based dialogue system to obtain the output information.
[0165] Using the method of this application embodiment, in addition to obtaining the output information prompted to the user, corresponding dialogue annotations can also be obtained for subsequent model training or information processing.
[0166] As can be seen from the above description, in this embodiment of the application, the large pre-trained language model GPT-2 is integrated into a semi-supervised task-oriented dialogue system, which improves the performance of the model in both supervised and semi-supervised situations. As a result, when using this end-to-end task-oriented dialogue system for processing, the accuracy of the obtained output information can be improved.
[0167] This application provides an information processing apparatus. See also... Figure 5 , Figure 5 This is a structural diagram of an information processing apparatus according to an embodiment of this application. The information processing apparatus 500 according to this embodiment includes:
[0168] The first acquisition module 501 is used to acquire user input information; the first processing module 502 is used to use the input information as input to the end-to-end task-oriented dialogue system to obtain output information; wherein, the processing model adopted by the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the model obtained from the pre-training.
[0169] The device further includes a training module, comprising:
[0170] The first training submodule is used for supervised pre-training based on labeled sample data and generative pre-trained models.
[0171] The second training submodule is used to perform semi-supervised training based on the pre-trained model using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0172] The first training submodule includes:
[0173] The first training unit is used to pretrain the generative model using labeled sample data and a generative pretraining model.
[0174] The second training unit is used to pre-train the inference model using the labeled sample data and the generative pre-trained model.
[0175] The generative model or the inference model is obtained based on the generative pre-trained model.
[0176] The first training unit is used to concatenate the input variables of each round of task-based dialogue in the labeled sample data according to a first preset order to obtain a first input sequence; and to pre-train the generative model by using the first input sequence as input to the generative model.
[0177] The second training unit is used to concatenate the input variables of each round of task-based dialogue in the labeled sample data according to a second preset order to obtain a second input sequence; and to use the second input sequence as input to the inference model to pre-train the inference model.
[0178] The second training submodule includes:
[0179] The acquisition unit is used to acquire the current sample data from the mixed sample data;
[0180] The first training unit is configured to, if the current sample data is labeled sample data, concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a first preset order to obtain a first input sequence, and use the input sequence as input to a pre-trained generative model to train the generative model; concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a second preset order to obtain a second input sequence; and use the second input sequence as input to a pre-trained inference model to train the inference model.
[0181] The second training unit is used to train the generative model and inference model obtained through pre-training using variational learning methods based on the unlabeled sample data if the current sample data is unlabeled sample data; or, to train the generative model obtained through pre-training using self-training methods based on the unlabeled sample data.
[0182] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the first training unit is used to concatenate the input variables in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
[0183] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the second training unit is used to concatenate the input variables in the order of user input, system responses, dialogue state, database query results, and dialogue actions to obtain the second input sequence.
[0184] The device further includes:
[0185] A preprocessing module is used to preprocess the labeled sample data and / or the mixed sample data.
[0186] The apparatus provided in this application embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0187] This application provides an information processing apparatus. See also... Figure 6 , Figure 6 This is a structural diagram of an information processing device according to an embodiment of this application. The information processing device according to this embodiment includes: a processor 601 and a transceiver 602;
[0188] The processor 601 is used to acquire user input information; and use the input information as input to an end-to-end task-oriented dialogue system to obtain output information.
[0189] The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the model obtained from the pre-training.
[0190] The processor 601 is further configured to:
[0191] Supervised pre-training is performed based on labeled sample data and generative pre-trained models.
[0192] Based on the model obtained from pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data.
[0193] The processor 601 is further configured to:
[0194] The generative model is pre-trained using labeled sample data and a generative pre-trained model.
[0195] The inference model is pre-trained using the labeled sample data and the generative pre-trained model;
[0196] The generative model or the inference model is obtained based on the generative pre-trained model.
[0197] The processor 601 is further configured to:
[0198] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a first preset order to obtain the first input sequence;
[0199] The first input sequence is used as input to the generative model to pre-train the generative model.
[0200] The processor 601 is further configured to:
[0201] The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence;
[0202] The second input sequence is used as input to the inference model to pre-train the inference model.
[0203] The processor 601 is further configured to:
[0204] Obtain the current sample data from the mixed sample data;
[0205] If the current sample data is labeled sample data, then the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model;
[0206] If the current sample data is unlabeled sample data, then the generative model and inference model obtained through pre-training are trained using variational learning methods based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using self-training methods based on the unlabeled sample data.
[0207] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the processor 601 is also used for:
[0208] The input variables are concatenated in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
[0209] The input variables include user input, dialogue state, database query results, dialogue actions, and system responses; the processor 601 is also used for:
[0210] The input variables are concatenated in the order of user input, system response, dialogue status, database query results, and dialogue actions to obtain the second input sequence.
[0211] The processor 601 is further configured to:
[0212] Data preprocessing is performed on the labeled sample data and / or the mixed sample data.
[0213] The apparatus provided in this application embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0214] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0215] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0216] This application provides a communication device, including: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program from the memory to implement the steps in the information processing method described above.
[0217] This application also provides a readable storage medium storing a program. When executed by a processor, this program implements the various processes of the above-described information processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0218] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0219] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0220] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An information processing method, characterized in that, include: Obtain user input information; The input information is used as the input to an end-to-end task-oriented dialogue system to obtain the output information; The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the pre-trained model; the processing model used in the end-to-end task-oriented dialogue system is a variational hidden state generative pre-trained language model. The training of the processing model includes: Supervised pre-training is performed based on labeled sample data and generative pre-trained models. Based on the model obtained from pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data. The model obtained based on pre-training is semi-supervised trained using mixed sample data, including: Obtain the current sample data from the mixed sample data; If the current sample data is labeled sample data, then the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model; If the current sample data is unlabeled sample data, then the generative model and inference model obtained through pre-training are trained using variational learning methods based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using self-training methods based on the unlabeled sample data.
2. The method according to claim 1, characterized in that, The supervised pre-training based on labeled sample data and a generative pre-trained model includes: The generative model is pre-trained using labeled sample data and a generative pre-trained model. The inference model is pre-trained using the labeled sample data and the generative pre-trained model; The generative model or the inference model is obtained based on the generative pre-trained model.
3. The method according to claim 2, characterized in that, The process of pre-training a generative model using labeled sample data and a generative pre-trained model includes: The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a first preset order to obtain the first input sequence; The first input sequence is used as input to the generative model to pre-train the generative model.
4. The method according to claim 2, characterized in that, The step of pre-training the inference model using the labeled sample data and the generative pre-trained model includes: The input variables of each round of task-based dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; The second input sequence is used as input to the inference model to pre-train the inference model.
5. The method according to claim 1 or 3, characterized in that, The input variables include user input, dialogue status, database query results, dialogue actions, and system responses; The step of concatenating the input variables of each round of task-based dialogue in the labeled sample data according to a first preset order to obtain a first input sequence includes: The input variables are concatenated in the order of user input, dialogue state, database query results, dialogue actions, and system responses to obtain the first input sequence.
6. The method according to claim 1 or 4, characterized in that, The input variables include user input, dialogue status, database query results, dialogue actions, and system responses; The step of concatenating the input variables of each round of task-based dialogue in the labeled sample data according to a second preset order to obtain a second input sequence includes: The input variables are concatenated in the order of user input, system response, dialogue status, database query results, and dialogue actions to obtain the second input sequence.
7. The method according to claim 1, characterized in that, Prior to the supervised pre-training using labeled sample data and a generative pre-trained model, the method further includes: Data preprocessing is performed on the labeled sample data and / or the mixed sample data.
8. An information processing device, characterized in that, include: The first acquisition module is used to acquire user input information; The first processing module is used to take the input information as the input of an end-to-end task-oriented dialogue system and obtain output information. The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the pre-trained model; the processing model used in the end-to-end task-oriented dialogue system is a variational hidden state generative pre-trained language model. The device further includes a training module, comprising: The first training submodule is used for supervised pre-training based on labeled sample data and generative pre-trained models. The second training submodule is used to perform semi-supervised training based on the pre-trained model using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data. The second training submodule includes: The acquisition unit is used to acquire the current sample data from the mixed sample data; The first training unit is configured to, if the current sample data is labeled sample data, concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a first preset order to obtain a first input sequence, and use the input sequence as input to a pre-trained generative model to train the generative model; concatenate the input variables of each round of task-oriented dialogue in the labeled sample data according to a second preset order to obtain a second input sequence; and use the second input sequence as input to a pre-trained inference model to train the inference model. The second training unit is used to train the generative model and inference model obtained through pre-training using variational learning methods based on the unlabeled sample data if the current sample data is unlabeled sample data; or, to train the generative model obtained through pre-training using self-training methods based on the unlabeled sample data.
9. An information processing device, characterized in that, include: Processor and transceiver; The processor is used to acquire user input information; The input information is used as the input to an end-to-end task-oriented dialogue system to obtain the output information; The processing model used in the end-to-end task-oriented dialogue system is obtained through supervised pre-training based on a generative pre-trained model and semi-supervised training based on the pre-trained model; the processing model used in the end-to-end task-oriented dialogue system is a variational hidden state generative pre-trained language model. The processor is further configured to: Supervised pre-training is performed based on labeled sample data and generative pre-trained models. Based on the model obtained from pre-training, semi-supervised training is performed using mixed sample data, wherein the mixed sample data is formed by mixing labeled sample data and unlabeled sample data. The processor is further configured to: Obtain the current sample data from the mixed sample data; If the current sample data is labeled sample data, then the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a first preset order to obtain a first input sequence, and the input sequence is used as the input to the generative model obtained through pre-training to train the generative model; the input variables of each round of task-type dialogue in the labeled sample data are concatenated in a second preset order to obtain a second input sequence; the second input sequence is used as the input to the inference model obtained through pre-training to train the inference model; If the current sample data is unlabeled sample data, then the generative model and inference model obtained through pre-training are trained using variational learning methods based on the unlabeled sample data; or, the generative model obtained through pre-training is trained using self-training methods based on the unlabeled sample data.
10. A communication device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program from the memory to implement the steps of the information processing method as described in any one of claims 1 to 7.
11. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the information processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
End-to-end task type dialogue system
CN109960733A
Bidding data named entity recognition method based on pre-training model
CN113283244A
Question replying method and device and electronic equipment
CN113934836A