CN112989794A - Model training method and device, intelligent robot and storage medium - Google Patents

Model training method and device, intelligent robot and storage medium Download PDF

Info

Publication number
CN112989794A
CN112989794A CN201911294111.7A CN201911294111A CN112989794A CN 112989794 A CN112989794 A CN 112989794A CN 201911294111 A CN201911294111 A CN 201911294111A CN 112989794 A CN112989794 A CN 112989794A
Authority
CN
China
Prior art keywords
sentence
model
statement
real
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911294111.7A
Other languages
Chinese (zh)
Inventor
谢韬
高倩
邵长东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ecovacs Robotics Suzhou Co Ltd
Ecovacs Commercial Robotics Co Ltd
Original Assignee
Ecovacs Robotics Suzhou Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ecovacs Robotics Suzhou Co Ltd filed Critical Ecovacs Robotics Suzhou Co Ltd
Priority to CN201911294111.7A priority Critical patent/CN112989794A/en
Publication of CN112989794A publication Critical patent/CN112989794A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Machine Translation (AREA)

Abstract

The embodiment of the invention provides a model training method, a model training device, an intelligent robot and a storage medium, wherein the method comprises the following steps: acquiring a real sentence corresponding to a human-computer interaction process; inputting the real sentence into the first model, so that the first model outputs a prediction result corresponding to the real sentence and a confidence coefficient of the prediction result; and performing model training by taking the first statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold value and the prediction result of the first statement as training samples so as to train a second model. According to the method provided by the invention, on one hand, the prediction result of the first statement can be regarded as the labeling result of the first statement, and the labeling result is automatically obtained by using the first model, namely, manual labeling is not needed in the model training process, so that the model training efficiency can be improved. On the other hand, real sentences are used in the model training process, and the sentences have strong practicability and timeliness, so that the model training effect can be further ensured.

Description

Model training method and device, intelligent robot and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a model training method and device, an intelligent robot and a storage medium.
Background
With the development of artificial intelligence technology, various intelligent robots, such as service robots, cleaning robots, self-moving vending robots, and the like, increasingly come into the lives of people. After receiving the conversation content input by the user, the intelligent robot performs a series of processing such as natural language understanding, information extraction, natural language generation and the like on the conversation content by using a conversation system configured in the intelligent robot, and finally generates response content corresponding to the conversation content, namely, human-computer interaction is realized.
In practical applications, a dialog system is a complex system, which may generally be composed of a plurality of prediction models, such as a text matching model, a text classification model, a text sequence labeling model, and so on, and the reliability of the output result of each prediction model has an important influence on the effect of human-computer interaction.
Disclosure of Invention
The embodiment of the invention provides a model training method, a model training device and a storage medium, which are used for improving the efficiency of model training.
The embodiment of the invention provides a model training method, which is applied to an intelligent robot and comprises the following steps:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
An embodiment of the present invention provides a model training apparatus, including:
the acquisition module is used for acquiring a real sentence corresponding to a human-computer interaction process;
an input module, configured to input the real sentence into a first model, so that the first model outputs a confidence of a prediction result of the real sentence;
the determining module is used for determining the statement of which the confidence coefficient of the prediction result is greater than or equal to a preset threshold value as a first statement;
and the training module is used for carrying out model training on a model according to the first statement and the prediction result of the first statement so as to obtain a second model with the same function as the first model.
An embodiment of the present invention provides an intelligent robot, including: a processor and a memory; wherein the memory is to store one or more computer instructions that when executed by the processor implement:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
Embodiments of the present invention provide a computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform at least the following:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
In the embodiment of the invention, with the continuous use of the intelligent robot, the real sentences corresponding to the human-computer interaction process can be continuously obtained. The real sentence is input to the first model, so that the first model outputs a predicted result corresponding to the real sentence and a confidence of the predicted result. Then, the sentence, of which the confidence of the prediction result is greater than or equal to a preset threshold, in the real sentence is determined as the first sentence. The predicted result of the first sentence is more reliable than the other sentences in the real sentence. Finally, the first sentence and the prediction result of the first sentence are used as training samples to carry out model training, so that a second model with the same function as the first model is trained.
In the prior art, on one hand, the samples used for model training need to be labeled manually, and the predicted result of the first sentence used for model training can be regarded as the labeling result thereof, and the labeling result is obtained automatically by means of the first model. In other words, when the model training method provided by the invention is used for training the model, manual marking is not needed, so that the efficiency of model training can be improved. On the other hand, samples for training the model are usually collected from the network, and the samples are often not strong in timeliness and practicability, so that the model training effect is poor. The training samples used in the training method provided by the invention are real sentences generated in the human-computer interaction process, and the sentences have strong practicability, so that the accuracy of model training can be further ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a model training method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another model training method provided by the embodiment of the invention;
fig. 3 is a flowchart of a real sentence obtaining method according to an embodiment of the present invention;
fig. 4a is a flowchart of a fourth statement determining manner according to the embodiment of the present invention;
FIG. 4b is a flowchart of another fourth statement determination method according to the embodiment of the present invention;
FIG. 4c is a flowchart of a fourth sentence determination method according to an embodiment of the present invention;
FIG. 4d is a flowchart of a fourth statement determining method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a model training apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an intelligent robot corresponding to the model training apparatus provided in the embodiment shown in fig. 5.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well. "plurality" generally includes at least two unless the context clearly dictates otherwise.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
The model training method provided herein is described in detail below with reference to the following examples. Meanwhile, the sequence of steps in the following method embodiments is only an example and is not strictly limited.
In practical applications, the model training method may be performed by a model training apparatus. Alternatively, the model training device may be an intelligent robot such as a cleaning robot, a greeting robot, a self-moving vending robot, or other training devices independent of the intelligent robot. The intelligent robot can move freely in a certain space and complete the instruction given by the user. The following embodiments will be described by taking an intelligent robot as an execution subject of the model training method. This is, of course, merely an example and the present invention is not limited to the execution body.
Fig. 1 is a flowchart of a model training method provided in an embodiment of the present invention, where an execution subject of the method may be a robot, and as shown in fig. 1, the method may include the following steps:
101. and acquiring a real sentence corresponding to the human-computer interaction process.
The intelligent robot can be placed in a use scene, and then a user can generate corresponding real sentences in the process of human-computer interaction. And the intelligent robot stores each time after receiving one real sentence, so that after the intelligent robot is used for a period of time, the intelligent robot can acquire at least one real sentence generated by the user in the period of time.
For the real sentence, specifically, the intelligent robot may be configured with an operation screen for the user to input the interactive sentence, and at this time, the generated real sentence is represented in a text form. In addition, the intelligent robot can be provided with a sound pickup device such as a microphone, and when a user speaks a real sentence, the intelligent robot can acquire the real sentence in a voice form through the sound pickup device. When the user generates a real sentence in a voice form, the intelligent robot converts the real sentence in the voice form into a real sentence in a text form so as to perform subsequent processing on the real sentence.
Of course, the content of the real sentence generated by the user is also diversified in different application scenarios. For example, when the user wants to inquire about weather conditions, a real sentence "how the weather is tomorrow" can be sent to the intelligent robot. When the user is shopping, the intelligent robot can be sent out a real sentence of 'what group purchase is recently done'.
102. The real sentence is input to the first model so that the first model outputs a confidence of the predicted result of the real sentence.
Then, the intelligent robot may input the obtained real sentence into the first model, and the first model may output a prediction result of the real sentence and a confidence of the prediction result. The higher the confidence of the prediction result, the more accurate the prediction result is.
Alternatively, the first model may be any one of models included in a dialog system possessed by the intelligent robot, such as a text matching model, a text classification model, a text sequence labeling model, a text generation model, and the like. The text matching model is generally applicable to a single-round conversation process, and the combination of the text classification model, the text sequence labeling model and the text generation model can be applicable to a multi-round conversation process.
And this first model may be one that has been trained before the intelligent robot is put into use formally. However, the training samples used in the training of the first model are obtained through the internet, and the practicability and timeliness of the samples are not high, so that the first model is only a model which only completes preliminary training actually, and the training effect of the model is poor.
103. And determining the statement of which the confidence coefficient of the prediction result is greater than or equal to a preset threshold value as a first statement.
After the confidence of the prediction result of each real sentence is output by the first model, the intelligent robot can also screen out the real sentences of which the confidence is greater than or equal to a preset threshold value, and then determine the screening result as the first sentence. The screened first sentences are actually true sentences with reliable prediction results. And it will be appreciated that the number of first sentences in effect reflects the training effect of the first model. The greater the number of first sentences, the better the training of the first model.
The preset threshold value can be set to any value of 0-1, and the training effect of the first model can be referred to in the setting of the preset threshold value. For example, if the number of training samples used in training the first model and acquired on the network is large, the training effect of the first model is usually also good, and at this time, the preset threshold may be set to a small value, for example, 0.6. For another example, if the number of training samples obtained from the network is small, the training effect of the first model is usually poor, and at this time, the preset threshold may be set to a larger value, such as 0.9.
104. And carrying out model training on the model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
And finally, performing model training by taking the first statement and the prediction result of the first statement as new training samples to obtain a second model. Of course, this second model has the same function as the first model.
For the sake of simplicity in the following description, the training sample composed of the first sentence and its predicted result may be referred to as a first sample, and for the model training according to the first sample, alternatively, a model, that is, a second model, may be re-trained according to the first sample. Since the first sample used for training the second model is a real sentence with reliable prediction results, the retrained second model has more accurate prediction results compared with the first model. Of course, using this approach is generally applicable to situations where the first number of samples is large and the sample content coverage is wide.
Alternatively, the first model may be retrained using the first sample based on the first model to obtain the second model. In this way, the first model is optimized by using the real sentences, so that the second model with more accurate prediction result is obtained.
In this embodiment, a real sentence corresponding to a human-computer interaction process is acquired first, and then the real sentence is input to the first model, so that a prediction result corresponding to the real sentence and a confidence of the prediction result are output by the first model. And performing model training by taking the first statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold value and the prediction result of the first statement as training samples so as to train a second model with the same function as the first model. For the method provided by the invention, on one hand, the prediction result of the first statement can be regarded as the labeling result of the first statement, and the labeling result is automatically obtained by virtue of the first model, namely, manual labeling is not needed in the model training process, so that the model training efficiency can be improved. On the other hand, real sentences are used in the model training process, and the sentences have strong practicability and timeliness, so that the model training effect can be further ensured.
In the above process of screening real sentences, in addition to the first sentence having a confidence greater than or equal to the preset threshold, it is easy to understand that there may be a real sentence having a confidence less than the preset threshold. For the sake of brevity of the subsequent description, a sentence with a confidence level smaller than a preset threshold may be referred to as a second sentence. And in the above embodiment, the part of the second sentence is filtered out and does not participate in the training of the second model. In order to improve the efficiency of using a real sentence, fig. 2 is a flowchart of another model training method provided by the embodiment of the present invention, as shown in fig. 2, on the basis of the embodiment shown in fig. 1, the method may include the following steps:
201. and determining the statement with the confidence coefficient of the prediction result smaller than the preset threshold value as a second statement.
202. And correcting the predicted result of the second statement to obtain a corrected result.
203. And performing model training according to the second statement and the correction result of the second statement.
In the process of screening the real sentences according to the preset threshold, the intelligent robot can determine the sentences of which the confidence degrees of the real sentence prediction results are smaller than the preset threshold as second sentences according to the confidence degrees. Compared with the first statement, the predicted result of the second statement is unreliable, so that the predicted result of the second statement can be corrected to obtain a corrected result, and the second statement and the corrected result of the second statement can participate in the subsequent model training process.
Alternatively, the correction of the prediction may be performed manually. Specifically, the second sentence may be labeled manually, and the labeling result may be determined as the modification result. Here, the corrected result of the second sentence may correspond to the predicted result of the first sentence. And finally, taking the second sentence and the corrected result of the second sentence as training samples to carry out model training.
For the sake of simplicity in the following description, the training sample composed of the second sentence and the modified result thereof may be referred to as a second sample, and for performing model training according to the second sample, steps 201 to 203 shown in fig. 2 may be performed after step 104, in this case, in an optional manner, the second model may be retrained by using the second sample on the basis of the second model to obtain a third model. In this way, the second model is optimized by using the real second sentence, so that a third model with better prediction effect is obtained.
In addition, steps 201 to 203 shown in fig. 2 may also be executed after step 103, and at this time, in another optional manner, a model, that is, a third model, may also be trained again according to the second sample. Since the second sample used for training the third model is a real sentence with reliable correction result, compared with the first model, the retrained third model has more accurate prediction result.
In yet another alternative, the first model may be retrained with the second sample based on the first model to obtain a third model. In this way, the first model is optimized by the real second statement, so that a third model with better prediction effect is obtained.
In the two cases, it can be considered that training the second model according to the first sentence and training the third model according to the second sentence are two independent processes, and which of the second model and the third model is specifically used can be selected according to actual requirements for the second model and the third model which are respectively trained.
Of course, the trained third model is a model that can achieve the same functions as the first model and the second model in the above embodiments.
In this embodiment, in the process of model training, for the second sentence with a lower reliability of the prediction result, the prediction result is corrected to obtain a correction result with high reliability. Then, the second sentence and the high-reliability correction result are used for model training. The embodiment shown in fig. 1 can improve the training efficiency of the model, and on this basis, the second sentence can also participate in the model training process by correcting the prediction result. And the first sentence and the second sentence are used for training for multiple times in sequence, so that the effect of model training can be further optimized.
The real sentences for model training mentioned in the above embodiments are generated by the user during the process of using the intelligent robot, and the more training samples, the better the accuracy of the trained model. Therefore, data enhancement can be performed on the real sentences generated by the user, so that the effect of enriching the training samples is achieved. The real sentences obtained through data enhancement are also considered to correspond to the human-computer interaction process of the user, as the real sentences generated by the user.
Based on the foregoing embodiments, optionally, a specific implementation manner of obtaining the real sentence, that is, a specific implementation manner of step 101 may be as shown in fig. 3, where the implementation manner includes the following steps:
301. and acquiring a third sentence generated by the user in the man-machine interaction process.
302. A fourth sentence having the same semantics as the third sentence is determined.
303. And determining the third sentence and the fourth sentence as real sentences.
After the intelligent robot acquires the third sentence generated by the user, data enhancement can be performed on the third sentence, that is, some fourth sentences having the same semantics as the third sentence are automatically generated. And the third statement and a fourth statement obtained after data enhancement jointly form a real statement corresponding to the human-computer interaction process.
There are many alternative implementations for determining the fourth sentence, such as replacing a word in the third sentence to obtain the fourth sentence, wherein the determination of the replacement word can be obtained according to a thesaurus or a language model. And generating a fourth sentence with the same semantic meaning as the third sentence by using a repeating model. For example, the translation model is used to perform multilingual translation on the third sentence to obtain the fourth sentence. And the specific implementation process of different modes can refer to the specific description in fig. 4a to 4d below.
In this embodiment, the third sentence is subjected to data enhancement, so that the number of real sentences used in model training is greatly increased, that is, the number of the first sentence and the second sentence is also greatly increased, that is, the number of training samples for model training is greatly increased, and thus, the effect of model training is finally improved.
Optionally, a specific implementation of determining the fourth statement, that is, a specific implementation of step 302, may be as shown in fig. 4a, and the method includes the following steps:
401. and performing word segmentation processing on the third sentence.
402. And if the target word in the word segmentation result exists in a pre-established synonym word bank, determining the synonym of the target word in the synonym word bank, wherein the target word is any word in the third sentence.
403. And replacing the target word with the synonym to obtain a fourth sentence.
Specifically, word segmentation processing is performed on a third sentence generated by the user in human-computer interaction to obtain a word segmentation result. Then, the target word in the word segmentation result is compared with the word in the pre-established synonym thesaurus to determine whether the target word exists in the synonym thesaurus. If yes, determining synonyms of the target word in the synonym word bank. Alternatively, a target term may have at least one synonym. When the target word has N synonyms, the target word may be replaced with each synonym, respectively, resulting in N fourth sentences.
It should be noted that, as for the target word, it may be any one of the word segmentation results, and in practical application, each word in the word segmentation results may be subjected to synonym replacement processing. Because the third sentence comprises a plurality of target words, and each target word has at least one synonym, a plurality of fourth sentences can be obtained from one third sentence, thereby greatly expanding the number of real sentences.
On the basis of the foregoing embodiments, optionally, another specific implementation manner of determining the fourth statement, that is, a specific implementation manner of step 302 may be as shown in fig. 4b, where the specific implementation manner includes the following steps:
501. and performing word segmentation processing on the third sentence.
502. And covering the target words in the word segmentation result, wherein the target words are any words in the third sentence.
503. And inputting the covered third sentence into a language model, so that the language model predicts a candidate word according to the position of the target word in the third sentence and the contextual word of the position.
504. And replacing the target word by the candidate word to obtain a fourth sentence.
Specifically, in a manner similar to that shown in fig. 4a, a third sentence generated by the user in the human-computer interaction is also subjected to word segmentation processing to obtain a word segmentation result. And then, performing covering processing on the target words in the third sentence, wherein the covering processing can be understood as marking the positions of the target words in the word segmentation result in the third sentence, and the target words can be any words in the third sentence. And then, inputting the covered third sentence into a language model configured in the intelligent robot. For example, the masking process may be embodied as: the third sentence is "welcome to buy the financing product A of my row", and if the target word is "welcome", the "welcome" is masked, and the masking result is "[ MASK ] to buy the financing product A of my row".
Then, the language model can predict candidate words corresponding to the target words according to the context words, namely the non-target words, of the positions of the target words. The prediction process may specifically be: the language model sequentially fills all words included in the training samples used in the training process into the covering positions in the third sentences to replace the target words, calculates a matching value between the words included in each training sample and the non-target words in the covered third sentences based on the replacement result, and determines the candidate words according to the height of the matching value, for example, the word with the highest matching value can be determined as the candidate word. At this time, the intelligent robot may obtain the fourth sentence according to the candidate words output by the language model.
The language model may be specifically implemented as: a transformed bi-directional encoding Representation (BERT) model, an Enhanced semantic Representation (ERNIE) model, and so on.
On the basis of the foregoing embodiments, optionally, another specific implementation manner of determining the fourth statement, that is, a specific implementation manner of step 302 may be as shown in fig. 4c, where the specific implementation manner includes the following steps:
601. and inputting the third sentence in the first language into the translation model, and translating by the translation model to obtain a fifth sentence in the second language.
602. And inputting the fifth sentence into the translation model so as to obtain a fourth sentence of the first language by translation of the translation model.
Specifically, the third sentence in the first sentence is input into the translation model, so that the translation model translates the third sentence in the first language into the fifth sentence in the second language. Wherein, optionally, the translation model can be pre-configured inside the intelligent robot. Then, the fifth sentence of the second language is input into the translation model again, and the translation model translates the fifth sentence of the second language back to the first language, and the obtained translation result is the fourth sentence of the first language.
The obtained fourth sentence and the original third sentence have the same semantic meaning through the language conversion process. Meanwhile, due to the processing of the conversion between languages, the third statement and the fourth statement can have different expression modes, and the effect of enriching real statements is achieved.
On the basis of the foregoing embodiments, optionally, another specific implementation manner of determining the fourth statement, that is, a specific implementation manner of step 302 may be as shown in fig. 4d, where the specific implementation manner includes the following steps:
701. and inputting the third sentence into an encoder of the repeating model, so that the encoder encodes the third sentence into a semantic vector with a preset length.
702. The semantic vector is input into a decoder of the repeating model to generate a fourth statement by the decoder.
Specifically, the intelligent robot inputs the third sentence into a repeating model configured by the intelligent robot, and the third sentence is encoded by an encoder in the repeating model to obtain a semantic vector corresponding to the preset length of the third sentence. Then, the decoder in the repeat model decodes the semantic vector, and the decoded result is the fourth statement.
Optionally, the aforementioned reiteration model may be embodied as: sequence to sequence (seq 2seq) models, Masked sequence to sequence pre-training (MASS) models, and so on.
It should be noted that the language translation model may actually be considered as a special translation model, which realizes translation between the same languages. Based on this, the translation model in the embodiment shown in fig. 4c also includes an encoder and a decoder, and in this case, the decoder and the encoder in the translation model can be used to implement the translation of the third sentence in the first language into the fifth sentence in the second language and to implement the translation of the fifth sentence in the second language into the fourth sentence in the first language.
In summary, for the determination methods of the multiple fourth statements provided above, that is, the data enhancement methods of the multiple third statements, one or more of the determination methods may be selected and used according to actual requirements.
In addition, the above embodiments are described with the smart robot as the execution subject. As mentioned in the above description, the execution subject of each embodiment provided by the present invention may also be a model training device independent from the intelligent robot, so that when the intelligent robot acquires a real sentence generated within a certain time period, the real sentence may be sent to the model training device, and at this time, the model training device may continue to execute the model training method provided by each embodiment of the present invention.
The model training apparatus of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these model training devices can each be constructed using commercially available hardware components configured through the steps taught in the present scheme.
Fig. 5 is a schematic structural diagram of a model training apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes:
and the obtaining module 11 is used for obtaining the real sentence corresponding to the human-computer interaction process.
An input module 12, configured to input the real sentence into a first model, so that the first model outputs a confidence of a prediction result of the real sentence.
And the determining module 13 is configured to determine, as the first statement, a statement with the confidence of the prediction result being greater than or equal to a preset threshold.
And the training module 14 is configured to perform model training on a model according to the first sentence and the prediction result of the first sentence to obtain a second model having the same function as the first model.
Optionally, the determining module 13 in the model training apparatus may be further configured to: and determining the statement with the confidence coefficient of the prediction result smaller than the preset threshold value as a second statement.
The model training apparatus may further include: and the correcting module 21 is configured to correct the predicted result of the second statement to obtain a corrected result.
The training model 14 in the model training apparatus may also be used to: and performing model training according to the second statement and the correction result of the second statement to obtain a third model with the same function as the first model.
Optionally, the obtaining module 11 in the model training apparatus includes:
an obtaining unit 111, configured to obtain a third sentence generated by the user in the human-computer interaction process.
A first determining unit 112, configured to determine a fourth sentence having the same semantic as the third sentence.
A second determining unit 113, configured to determine the third sentence and the fourth sentence as the real sentence.
In order to determine the fourth sentence, optionally, the first determining unit 112 in the model training apparatus is specifically configured to: performing word segmentation processing on the third sentence;
if the target word in the word segmentation result exists in a pre-established synonym word bank, determining the synonym of the target word in the synonym word bank, wherein the target word is any word in the third sentence;
replacing the target term with the synonym to obtain the fourth sentence.
Optionally, the first determining unit 112 in the model training apparatus is specifically configured to: performing word segmentation processing on the third sentence;
covering a target word in the word segmentation result, wherein the target word is any word in the third sentence;
inputting the covered third sentence into a language model, so that the language model predicts a candidate word according to the position of the target word in the third sentence and the context word of the position;
replacing the target term with the candidate term to obtain the fourth sentence.
Optionally, the first determining unit 112 in the model training apparatus is specifically configured to: inputting the third sentence in the first language into a translation model, and translating the third sentence by the translation model to obtain a fifth sentence in a second language;
inputting the fifth sentence into the translation model, so that the fourth sentence in the first language is translated by the translation model.
Optionally, the first determining unit 112 in the model training apparatus is specifically configured to: inputting the third sentence into an encoder of a repeating model, so that the encoder encodes the third sentence into a semantic vector with a preset length;
inputting the semantic vector into a decoder of the restatement model to generate the fourth sentence by the decoder.
The model training apparatus shown in fig. 5 may perform the model training method provided in the embodiments shown in fig. 1 to 4d, and for parts not described in detail in this embodiment, reference may be made to the related description of the embodiments shown in fig. 1 to 4d, which is not described herein again.
The internal functions and structures of the model training apparatus are described above, and in one possible design, the structure of the model training apparatus may be implemented as part of an intelligent robot, as shown in fig. 6, which may include: a processor 31 and a memory 32. Wherein the memory 32 is used for storing a program for supporting the intelligent robot to execute the model training method provided in the foregoing embodiments shown in fig. 1 to 4d, and the processor 31 is configured to execute the program stored in the memory 32.
The program comprises one or more computer instructions which, when executed by the processor 21, are capable of performing the steps of:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
Optionally, the processor 31 is further configured to perform all or part of the steps in the embodiments shown in fig. 1 to 4 d.
The structure of the intelligent robot may further include a communication interface 33 for communicating with other devices or a communication network.
Additionally, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform at least the following:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
The above-described apparatus embodiments are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding, the above technical solutions may be embodied in the form of a computer product, which is a substantial part of or contributes to the prior art.
For ease of understanding, a specific implementation of the model training method provided above is illustrated in conjunction with the following application scenarios.
Taking a public service scenario such as a bank as an example, an intelligent terminal device such as a service robot may be set in the bank. The dialog system configured in such an intelligent robot may include models that enable various functions, such as a text matching model, a text classification model, a text generation model, and so forth. The text classification model may be used to determine the type of the real sentence, for example, determine the emotion type of the real sentence, and this emotion type may also be considered as the intention of the real sentence. The text matching model may be used to identify the intent of the real sentence. Under different use scenes, the text generation model can generate corresponding answer sentences according to the intention of the real sentences or the types of the real sentences, so that normal human-computer interaction is realized.
If the text matching model is trained, the intelligent robot can acquire a real sentence A after being used for a period of time: "I want to redeem USD", true statement B: "I want to withdraw" and the real sentence C: "I want to transact a bank card". These three sentences are also the third sentences in the above embodiments, and they all belong to real sentences. Then, three real sentences may be input into a first model, which may predict that the real sentence a is intended to be "redeemed dollars" with a prediction result confidence of 0.8; the intention of the real statement B is withdrawal, and the confidence coefficient of the prediction result is 0.85; the true statement C is intended to "transact the bank card" and the confidence of the prediction result is 0.4.
When the preset threshold is 0.6, the real sentence a and the real sentence B can be determined as the first sentence according to the preset threshold. And finally, performing model training by taking the real sentence A, the real sentence B and the corresponding prediction results as training samples to obtain a second model, wherein the second model is also a text classification model. Optionally, the second model may be a model trained only from the real sentence a and the real sentence B, or the first model may be optimized according to the real sentence a and the real sentence B, so as to obtain the second model.
Because the real sentences A and B are generated in the actual use process of the intelligent robot, the practicability and the effectiveness of the intelligent robot are far greater than those of the sentences collected from the network, and therefore, a second model trained by using the real sentences A and B as training samples has a more accurate prediction result.
And for the real statement C with lower confidence of the prestored result, namely the second statement, the predicted result can be corrected, so that the corrected result obtained after correction has higher confidence. The modification of the real sentence C may be optionally modified manually. That is, the real sentence C and the corrected result thereof are manually input to the intelligent robot, and at this time, the intelligent robot can perform model training by using the real sentence C and the corrected result thereof as training samples to obtain the third model. This third model is also a text classification model.
Optionally, the third model may be a model trained solely according to the real sentence C, or the third model may be obtained by optimizing the first model according to the real sentence C, or the third model may be obtained by optimizing the second model according to the real sentence C.
The above-mentioned real sentences a to C are generated by the user, that is, the third sentence in the above-mentioned embodiment, and it is easy to understand that the more training samples, the more accurate the prediction result of the trained model is. Therefore, the above-mentioned real sentences a to C may also be subjected to data enhancement to obtain fourth sentences which are sentences having the same semantics as those of the third sentences but having a less similar expression form. The specific implementation of data enhancement can be seen in the embodiments shown in fig. 4a to 4 b.
For example, for the real sentence a, when the target word is "dollar", the data enhancement can obtain the real sentence a': "i want to exchange yen", real sentence a ": "I want to redeem coins", and so on. The target word in the real sentence a may also be other words in the sentence.
For the real statement B, when the target word is "withdraw money", the real statement B' can be obtained after data enhancement: "I want to transfer," real statement B ": "I want to deposit," etc. The target word in the real sentence B may also be other words in the sentence.
For the real sentence C, when the target word is "bank card", the real sentence C' can be obtained after data enhancement: "I want to transact a savings card", true statement C ": "I want to handle a payroll card", etc. The target word in the real sentence C may also be other words in the sentence.
These real sentences a' to C, i.e., the fourth sentence described above can also be regarded as real sentences. The real sentences A 'to C can also be processed in the same way as the real sentences A to C so as to carry out model training by using the real sentences A' to C, thereby finally obtaining the text classification model with better training effect.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of model training, the method comprising:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
2. The method of claim 1, further comprising:
determining the statement with the confidence coefficient of the prediction result smaller than the preset threshold value as a second statement;
correcting the predicted result of the second statement to obtain a corrected result;
and performing model training according to the second statement and the correction result of the second statement to obtain a third model with the same function as the first model.
3. The method of claim 1, wherein the obtaining of the real sentence corresponding to the human-computer interaction process comprises:
acquiring a third sentence generated by a user in the human-computer interaction process;
determining a fourth sentence having the same semantics as the third sentence;
determining the third sentence and the fourth sentence as the real sentences.
4. The method of claim 3, wherein determining a fourth sentence having the same semantics as the third sentence comprises:
performing word segmentation processing on the third sentence;
if the target word in the word segmentation result exists in a pre-established synonym word bank, determining the synonym of the target word in the synonym word bank, wherein the target word is any word in the third sentence;
replacing the target term with the synonym to obtain the fourth sentence.
5. The method of claim 3, wherein determining a fourth sentence having the same semantics as the third sentence comprises:
performing word segmentation processing on the third sentence;
covering a target word in the word segmentation result, wherein the target word is any word in the third sentence;
inputting the covered third sentence into a language model, so that the language model predicts a candidate word according to the position of the target word in the third sentence and the context word of the position;
replacing the target term with the candidate term to obtain the fourth sentence.
6. The method of claim 3, wherein determining a fourth sentence having the same semantics as the third sentence comprises:
inputting the third sentence in the first language into a translation model, and translating the third sentence by the translation model to obtain a fifth sentence in a second language;
inputting the fifth sentence into the translation model, so that the fourth sentence in the first language is translated by the translation model.
7. The method of claim 3, wherein determining a fourth sentence having the same semantics as the third sentence comprises:
inputting the third sentence into an encoder of a repeating model, so that the encoder encodes the third sentence into a semantic vector with a preset length;
inputting the semantic vector into a decoder of the restatement model to generate the fourth sentence by the decoder.
8. A model training apparatus, comprising:
the acquisition module is used for acquiring a real sentence corresponding to a human-computer interaction process;
an input module, configured to input the real sentence into a first model, so that the first model outputs a confidence of a prediction result of the real sentence;
the determining module is used for determining the statement of which the confidence coefficient of the prediction result is greater than or equal to a preset threshold value as a first statement;
and the training module is used for carrying out model training on a model according to the first statement and the prediction result of the first statement so as to obtain a second model with the same function as the first model.
9. An intelligent robot, comprising: a processor and a memory; wherein the memory is to store one or more computer instructions that when executed by the processor implement:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence;
determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
10. A computer-readable storage medium storing computer instructions, which when executed by one or more processors, cause the one or more processors to perform at least the following acts:
acquiring a real sentence corresponding to a human-computer interaction process;
inputting the real sentence to a first model so that the first model outputs a confidence of a predicted result of the real sentence; determining a statement with the confidence coefficient of the prediction result being greater than or equal to a preset threshold as a first statement;
and carrying out model training on a model according to the first statement and the prediction result of the first statement to obtain a second model with the same function as the first model.
CN201911294111.7A 2019-12-16 2019-12-16 Model training method and device, intelligent robot and storage medium Pending CN112989794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911294111.7A CN112989794A (en) 2019-12-16 2019-12-16 Model training method and device, intelligent robot and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911294111.7A CN112989794A (en) 2019-12-16 2019-12-16 Model training method and device, intelligent robot and storage medium

Publications (1)

Publication Number Publication Date
CN112989794A true CN112989794A (en) 2021-06-18

Family

ID=76343280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911294111.7A Pending CN112989794A (en) 2019-12-16 2019-12-16 Model training method and device, intelligent robot and storage medium

Country Status (1)

Country Link
CN (1) CN112989794A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079646A (en) * 2023-10-13 2023-11-17 之江实验室 Training method, device, equipment and storage medium of voice recognition model
CN117131945A (en) * 2023-10-26 2023-11-28 北京睿企信息科技有限公司 Data training method and storage medium for LLM model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108460015A (en) * 2018-02-08 2018-08-28 合肥工业大学 Text emotion grouped data enhances analysis method
CN109388705A (en) * 2017-08-07 2019-02-26 芋头科技(杭州)有限公司 A kind of text intent classifier method
CN109446509A (en) * 2018-09-06 2019-03-08 厦门快商通信息技术有限公司 A kind of dialogue corpus is intended to analysis method, system and electronic equipment
CN109582793A (en) * 2018-11-23 2019-04-05 深圳前海微众银行股份有限公司 Model training method, customer service system and data labeling system, readable storage medium storing program for executing
CN110162627A (en) * 2019-04-28 2019-08-23 平安科技(深圳)有限公司 Data increment method, apparatus, computer equipment and storage medium
CN110532547A (en) * 2019-07-31 2019-12-03 厦门快商通科技股份有限公司 Building of corpus method, apparatus, electronic equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388705A (en) * 2017-08-07 2019-02-26 芋头科技(杭州)有限公司 A kind of text intent classifier method
CN108460015A (en) * 2018-02-08 2018-08-28 合肥工业大学 Text emotion grouped data enhances analysis method
CN109446509A (en) * 2018-09-06 2019-03-08 厦门快商通信息技术有限公司 A kind of dialogue corpus is intended to analysis method, system and electronic equipment
CN109582793A (en) * 2018-11-23 2019-04-05 深圳前海微众银行股份有限公司 Model training method, customer service system and data labeling system, readable storage medium storing program for executing
CN110162627A (en) * 2019-04-28 2019-08-23 平安科技(深圳)有限公司 Data increment method, apparatus, computer equipment and storage medium
CN110532547A (en) * 2019-07-31 2019-12-03 厦门快商通科技股份有限公司 Building of corpus method, apparatus, electronic equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079646A (en) * 2023-10-13 2023-11-17 之江实验室 Training method, device, equipment and storage medium of voice recognition model
CN117079646B (en) * 2023-10-13 2024-01-09 之江实验室 Training method, device, equipment and storage medium of voice recognition model
CN117131945A (en) * 2023-10-26 2023-11-28 北京睿企信息科技有限公司 Data training method and storage medium for LLM model

Similar Documents

Publication Publication Date Title
WO2019200923A1 (en) Pinyin-based semantic recognition method and device and human-machine conversation system
CN110428820B (en) Chinese and English mixed speech recognition method and device
CN111198937B (en) Dialog generation device, dialog generation program, dialog generation apparatus, computer-readable storage medium, and electronic apparatus
CN109979432B (en) Dialect translation method and device
CN114580382A (en) Text error correction method and device
CN112528637B (en) Text processing model training method, device, computer equipment and storage medium
US20220300718A1 (en) Method, system, electronic device and storage medium for clarification question generation
CN115309877B (en) Dialogue generation method, dialogue model training method and device
CN112200664A (en) Repayment prediction method based on ERNIE model and DCNN model
CN113591462A (en) Bullet screen reply generation method and device and electronic equipment
CN108763230B (en) Neural machine translation method using external information
Mishakova et al. Learning natural language understanding systems from unaligned labels for voice command in smart homes
CN113609284A (en) Method and device for automatically generating text abstract fused with multivariate semantics
CN112989794A (en) Model training method and device, intelligent robot and storage medium
CN109979461B (en) Voice translation method and device
KR20230158107A (en) Efficient streaming non-circular on-device end-to-end model
Arora et al. Joint modelling of spoken language understanding tasks with integrated dialog history
Kim et al. Speaker-sensitive dual memory networks for multi-turn slot tagging
Sakti et al. Incremental sentence compression using LSTM recurrent networks
CN116258147A (en) Multimode comment emotion analysis method and system based on heterogram convolution
KR20240065125A (en) Large-scale language model data selection for rare word speech recognition.
CN111435408B (en) Dialog error correction method and device and electronic equipment
Zou et al. Associated lattice-bert for spoken language understanding
Hong et al. End-to-End Task-Oriented Dialog System Through Template Slot Value Generation.
CN115169367B (en) Dialogue generating method and device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination