CN-118674038-B - Model processing method, voice interaction method, device, equipment and storage medium thereof
Abstract
The disclosure provides a model processing method, a voice interaction method, a device, equipment and a storage medium thereof, which relate to the field of data processing, in particular to the fields of artificial intelligence, big data, voice technology and the like. The method comprises the steps of obtaining candidate problem sets of initial sample data in M initial sample data, wherein the initial sample data comprise M rounds of questions and answers between an object and an agent, the candidate problem sets of the initial sample data comprise next round of problem sets corresponding to the M-th round of questions in the M rounds of questions and answers, obtaining M training sample data based on the M initial sample data, the candidate problem sets of the initial sample data and label data of the initial sample data, wherein the label data of the initial sample data comprise target questions required to be generated by the agent in the m+1 round, and training a model to be trained by the M training sample data to obtain a target model capable of predicting the problems required to be generated by the next round of agent based on the historical questions and answers.
Inventors
- ZHANG LE
- ZHOU JINGBO
- HUANG JIZHOU
Assignees
- 北京百度网讯科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20240401
Claims (20)
- 1. A model processing method, comprising: Obtaining candidate question sets of each initial sample data in M initial sample data, wherein the initial sample data comprises M rounds of questions and answers between an object and an intelligent agent, the candidate question sets of the initial sample data comprise the next round of question sets corresponding to the M-th round of questions in the M rounds of questions and answers, M and M are positive integers which are more than or equal to 1, the M initial sample data meet that the distribution of the quantity of the initial sample data with different lengths meets the uniform distribution requirement in the M initial sample data, the length of the initial sample data represents the round number of questions and answers, and the distribution of answer contents transferred from the previous questions to the next questions in the M initial sample data meet the uniform distribution requirement; obtaining M training sample data based on M initial sample data, candidate problem sets of the initial sample data and label data of the initial sample data, wherein the label data of the initial sample data comprise target problems required to be generated by an intelligent agent in the (m+1) th round; Training the model to be trained by using M training sample data to obtain a target model capable of predicting the problem required to be generated by the next round of intelligent agent based on the historical question-answer, wherein the target model is a large language model; The training of the model to be trained by using M training sample data to obtain a target model capable of predicting the problem required to be generated by the next round of intelligent agent based on the historical question-answer includes: Inputting m rounds of questions and answers contained in the training sample data and a candidate problem set corresponding to the mth round of problems contained in the training sample data into a model to be trained, so that the model to be trained performs reasoning in the candidate problem set to avoid phantom problems in the reasoning process; obtaining an initial estimation result, wherein the initial estimation result represents a predicted problem which is generated by the intelligent agent in the (m+1) th round; Obtaining a loss value of a loss function based on the initial estimation result and a target problem which is required to be generated by the intelligent agent in the (m+1) th round and is contained in the label data in the training sample data, wherein the loss function can represent the distance between the predicted problem and the target problem; And adjusting at least part of adjustable parameters in the model to be trained based on the loss value of the loss function so as to train to obtain the target model.
- 2. The method of claim 1, wherein the inputting the m rounds of questions and answers included in the training sample data and the candidate question set corresponding to the m-th round of questions included in the training sample data into the model to be trained includes: obtaining target prompt word problems based on m rounds of questions and answers contained in the training sample data and a candidate problem set corresponding to the m-th round of problems contained in the training sample data; And inputting the target prompt word problem into the model to be trained.
- 3. The method of claim 1, further comprising: based on the determined finite state machine, obtaining the M initial sample data meeting the following conditions: The distribution of the quantity of initial sample data with different lengths in the M initial sample data meets the requirement of uniform distribution, and the length of the initial sample data is determined based on the finite state machine and represents the number of questions and answers; Among the M initial sample data, the distribution of answer contents of the previous question to the next question satisfies the uniform distribution requirement; the finite state machine can represent a group of questions generated by the intelligent agent and transfer conditions for transferring from a current question to a next question, wherein the transfer conditions relate to answer contents of an object replying to the current question.
- 4. A method according to claim 3, further comprising: Determining the finite state machine based on N pieces of history interaction data between the object and the intelligent agent, wherein the history interaction data in the N pieces of history interaction data comprise m rounds of question and answer between the object and the intelligent agent and the problem required to be generated by the intelligent agent in the (m+1) th round, and N is a positive integer greater than or equal to 1; Wherein the obtaining, based on the determined finite state machine, the M initial sample data satisfying the following conditions includes: And selecting M initial sample data meeting the following conditions from the N historical interaction data based on the determined finite state machine.
- 5. The method of claim 1, further comprising: After the target model is obtained, evaluating a target output result of the target model by utilizing at least one evaluation model so as to obtain a target evaluation result for evaluating the accuracy of the target output result; wherein an evaluation model of the at least one evaluation model satisfies at least one of the following conditions: Under the condition that the parameters of the evaluation model are adjustable, the parameter quantity of the adjustable parameters of the evaluation model is larger than the parameter quantity of the adjustable parameters of the target model, and the evaluation model is a model obtained after training based on the M training sample data; Under the condition that the parameters of the evaluation model are adjustable, the parameter quantity of the adjustable parameters of the evaluation model is larger than the parameter quantity of the adjustable parameters of the target model, and the evaluation model is obtained after training based on the M training sample data and a pre-constructed evaluation data set; In the case that the parameter of the evaluation model is not adjustable, the parameter amount of the adjustable parameter of the evaluation model is larger than the parameter amount of the adjustable parameter of the target model.
- 6. The method of claim 5, wherein the pre-constructed evaluation dataset comprises a plurality of positive sample data and a plurality of negative sample data constructed based on the plurality of positive sample data; The positive sample data in the positive sample data are obtained based on initial sample data in the M initial sample data, and comprise M rounds of questions and answers and true questions generated by a target model in the m+1th round; Negative sample data constructed based on positive sample data includes m rounds of questions and answers, and m+1st round of false questions constructed.
- 7. The method of claim 5, wherein said evaluating the target output result of the target model with at least one evaluation model after obtaining the target model to obtain a target evaluation result that evaluates the accuracy of the target output result comprises: And after the target model is obtained, and under the condition that the evaluation model is obtained after training based on the M training sample data, evaluating the target output result of the target model based on the evaluation model to obtain an initial evaluation result corresponding to the evaluation model, wherein the initial evaluation result of the evaluation model is used for measuring the accuracy of the target output result of the target model.
- 8. The method of claim 7, wherein the initial evaluation result corresponding to the evaluation model is represented by a value of likelihood that the trained evaluation model outputs the target output result output by the target model.
- 9. The method of claim 6, wherein the evaluating the target output result of the target model with at least one evaluation model after obtaining the target model to obtain a target evaluation result that evaluates accuracy of the target output result comprises: after the target model is obtained, and under the condition that an evaluation model is obtained after training based on the M training sample data and a pre-constructed evaluation data set, evaluating a target output result of the target model based on the evaluation model to obtain a first initial result and a second initial result corresponding to the evaluation model; Based on the first initial result and the second initial result, obtaining a target evaluation result for evaluating the accuracy of the target output result; The first initial result is used for measuring the accuracy of the target output result of the target model, and the second initial result is used for judging the probability that the target output result of the target model is an accurate value.
- 10. The method of claim 9, wherein the first initial result is represented by a value that indicates a likelihood that the trained evaluation model outputs a target output result output by the target model; and/or the second initial result is represented by a value that indicates a likelihood that the target output result output by the target model output by the trained evaluation model is accurate.
- 11. The method of claim 9, wherein the obtaining a target evaluation result that evaluates accuracy of the target output result based on the first initial result and the second initial result comprises: and carrying out weighting processing on the first initial result and the second initial result to obtain a target evaluation result for evaluating the accuracy of the target output result.
- 12. The method of any of claims 5-11, further comprising: In the case of performing an evaluation using two or more evaluation models, a total evaluation result of the accuracy of the evaluation target output result is obtained based on the target evaluation result of each evaluation model; and correcting the M training sample data based on the total evaluation result to obtain corrected M training sample data.
- 13. The method of claim 12, further comprising: Fine-tuning the target model based on the corrected M training sample data to obtain a corrected target model; And/or the number of the groups of groups, And fine-tuning the evaluation model with adjustable parameters based on the corrected M training sample data to obtain a corrected evaluation model.
- 14. A voice interaction method, comprising: acquiring target text data, wherein the target text data is obtained based on answer voices of the objects in the previous round of questions between the objects and the intelligent agent; Acquiring a next round of candidate problem sets of the problem aimed at by the target text data; Inputting target text data and a next round of candidate problem sets of the problems aimed by the target text data into a target model to obtain a problem text required to be generated by an intelligent agent, wherein the target model is obtained after training based on the model processing method in any one of claims 1-13.
- 15. The method of claim 14, further comprising: And converting the obtained problem text into problem voice, and outputting the problem voice.
- 16. The method of claim 14, further comprising: Obtaining answer voices aiming at objects in the previous round of questions; the answer speech for the object in the previous round of questions is converted into target text data.
- 17. The method of any of claims 14 to 16, wherein the next round of candidate question sets for the questions for which the target text data is intended is determined based on a finite state machine, the finite state machine being capable of representing a set of questions generated by the agent and a transition condition for transitioning from a current question to the next question, the transition condition being related to answer content of the object answering the current question.
- 18. A model processing apparatus comprising: The system comprises a data processing unit, a data processing unit and a training unit, wherein the data processing unit is used for obtaining candidate question sets of each initial sample data in M initial sample data, the initial sample data comprises M rounds of questions and answers between an object and an intelligent agent, the candidate question sets of the initial sample data comprise next round of question sets corresponding to the M-th round of questions in the M rounds of questions and answers, M and M are positive integers which are more than or equal to 1, the distribution of the number of the initial sample data with different lengths in the M initial sample data meets the uniform distribution requirement, the length of the initial sample data represents the round number of questions and answers, and the distribution of answer contents of the previous questions transferred to the next questions in the M initial sample data meets the uniform distribution requirement; the model training unit is used for training the model to be trained by using M training sample data so as to obtain a target model capable of predicting the problem required to be generated by the next round of intelligent agent based on the historical question-answer; The model training unit is specifically configured to: Inputting m rounds of questions and answers contained in the training sample data and a candidate problem set corresponding to the mth round of problems contained in the training sample data into a model to be trained, so that the model to be trained performs reasoning in the candidate problem set to avoid phantom problems in the reasoning process; Obtaining a loss value of a loss function based on the initial estimation result and a target problem which is required to be generated by the intelligent agent in the (m+1) th round and is contained in the label data in the training sample data, wherein the loss function can represent the distance between the predicted problem and the target problem; And adjusting at least part of adjustable parameters in the model to be trained based on the loss value of the loss function so as to train to obtain the target model.
- 19. The apparatus of claim 18, wherein the model training unit is specifically configured to: obtaining target prompt word problems based on m rounds of questions and answers contained in the training sample data and a candidate problem set corresponding to the m-th round of problems contained in the training sample data; And inputting the target prompt word problem into the model to be trained.
- 20. The apparatus of claim 18, wherein the data processing unit is further configured to: based on the determined finite state machine, obtaining the M initial sample data meeting the following conditions: The distribution of the quantity of initial sample data with different lengths in the M initial sample data meets the requirement of uniform distribution, and the length of the initial sample data is determined based on the finite state machine and represents the number of questions and answers; Among the M initial sample data, the distribution of answer contents of the previous question to the next question satisfies the uniform distribution requirement; the finite state machine can represent a group of questions generated by the intelligent agent and transfer conditions for transferring from a current question to a next question, wherein the transfer conditions relate to answer contents of an object replying to the current question.
Description
Model processing method, voice interaction method, device, equipment and storage medium thereof Technical Field The present disclosure relates to the field of data processing technologies, and in particular, to the technical fields of artificial intelligence, big data, and voice technologies. Background The intelligent voice finger-assisted voice intelligent agent can develop a voice intelligent agent of multiple rounds of conversations, and the voice intelligent agent can communicate with the object through understanding, active inquiry, clarification and the like, so that a specific target (such as information collection, directional investigation and the like) is realized. Along with the development of AI technology such as fusion deep learning, the ability of intelligent phonetic body is stronger and stronger, and the intelligent phonetic body can be automatically communicated with objects in a full process, and is widely applied to various fields such as intelligent customer service. Disclosure of Invention The present disclosure provides a model processing method, a voice interaction method, a device, equipment and a storage medium thereof. According to an aspect of the present disclosure, there is provided a model processing method including: Obtaining candidate problem sets of each initial sample data in M initial sample data, wherein the initial sample data comprise M rounds of questions and answers between an object and an intelligent agent, the candidate problem sets of the initial sample data comprise the next round of problem sets corresponding to the M-th round of questions in the M rounds of questions and answers, and M and M are positive integers which are more than or equal to 1; obtaining M training sample data based on M initial sample data, candidate problem sets of the initial sample data and label data of the initial sample data, wherein the label data of the initial sample data comprise target problems required to be generated by an intelligent agent in the (m+1) th round; and training the model to be trained by using M training sample data to obtain a target model capable of predicting the problems required to be generated by the next round of intelligent agent based on the historical question-answering. According to another aspect of the present disclosure, there is provided a voice interaction method, including: acquiring target text data, wherein the target text data is obtained based on answer voices of the objects in the previous round of questions between the objects and the intelligent agent; Acquiring a next round of candidate problem sets of the problem aimed at by the target text data; And inputting the target text data and a next round of candidate problem sets of the problems aimed by the target text data into a target model to obtain the problem text required to be generated by the intelligent agent. According to still another aspect of the present disclosure, there is provided a model processing apparatus including: the system comprises a data processing unit, a training sample data processing unit, a data processing unit and a data processing unit, wherein the data processing unit is used for obtaining candidate problem sets of each initial sample data in M initial sample data, the initial sample data comprises M rounds of questions and answers between an object and an intelligent agent, the candidate problem sets of the initial sample data comprise the next round of problem sets corresponding to the M-th round of questions in the M rounds of questions and answers, M and M are positive integers which are more than or equal to 1, and the training sample data are obtained based on the M initial sample data, the candidate problem sets of each initial sample data and the label data of each initial sample data, wherein the label data of the initial sample data comprise target questions required to be generated by the intelligent agent in the m+1 round; The model training unit is used for training the model to be trained by using M training sample data so as to obtain a target model capable of predicting the problems required to be generated by the next round of intelligent agents based on the historical question-answer. According to still another aspect of the present disclosure, there is provided a voice interaction apparatus, including: The system comprises an acquisition unit, a target text data acquisition unit, a candidate question set acquisition unit and a target text data processing unit, wherein the target text data is obtained based on answer voices of objects in a previous round of questions between the objects and an intelligent agent; and the model prediction unit is used for inputting the target text data and a next round of candidate problem set of the problem aimed by the target text data into the target model to obtain the problem text required to be generated by the intelligent agent. According to another aspect of the present disclosure, there is provided