WO2024103609A1 - 一种对话模型的训练方法及装置、对话响应方法及装置 - Google Patents

一种对话模型的训练方法及装置、对话响应方法及装置 Download PDF

Info

Publication number
WO2024103609A1
WO2024103609A1 PCT/CN2023/086071 CN2023086071W WO2024103609A1 WO 2024103609 A1 WO2024103609 A1 WO 2024103609A1 CN 2023086071 W CN2023086071 W CN 2023086071W WO 2024103609 A1 WO2024103609 A1 WO 2024103609A1
Authority
WO
WIPO (PCT)
Prior art keywords
dialogue
professional
dialogue model
score
model
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.)
Ceased
Application number
PCT/CN2023/086071
Other languages
English (en)
French (fr)
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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Publication of WO2024103609A1 publication Critical patent/WO2024103609A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Definitions

  • the present application relates to the field of artificial intelligence technology, and in particular to a method and device for training a dialogue model, a method and device for dialogue response, an electronic device, and a storage medium.
  • NLP natural language processing
  • chat needs including: small talk, common sense Q&A, and professional Q&A.
  • a medical robot chats with a patient it must not only answer medical professional knowledge, but also common sense questions in life, and it must also be able to chat to relieve the patient's emotions.
  • most professional dialogue models use retrieval methods, and their main principle is semantic matching, that is, finding answers to questions asked by users in the knowledge base.
  • semantic matching that is, finding answers to questions asked by users in the knowledge base.
  • the purpose of this application is to provide a conversation model training method and device, a conversation response method and device, an electronic device and a storage medium, so that the trained target professional conversation model has both versatility and professionalism, thereby improving the user experience.
  • a method for training a dialogue model comprising:
  • the original dialogue model is trained using the pre-acquired general dialogue dataset to obtain a general dialogue model
  • the initial professional dialogue model was verified using the verification data set and the preset natural language processing evaluation indicators. Verification score;
  • the initial professional dialogue model is determined as the target professional dialogue model.
  • the following when it is determined that the verification score is less than or equal to a preset score threshold, the following further includes:
  • the initial labeled data set is updated according to the labeling results to obtain an updated labeled data set
  • the initial professional dialogue model is trained based on the updated annotated data set to obtain an updated professional dialogue model
  • the updated professional dialogue model is verified using the verification data set to obtain a verification score, and the step of determining whether the verification score is greater than a preset score threshold is repeated.
  • the method further includes:
  • the initial professional dialogue model is verified using a verification data set and a preset natural language processing evaluation index, including:
  • the initial professional dialogue model is verified by combining the verification data set, BLEU index, ROUGE index, PPL index, and DISTINCT index through the following formula:
  • Score BLEU is the score of the initial professional dialogue model on the BLEU indicator
  • Score BLEU is the score of the initial professional dialogue model on the ROUGE indicator
  • Score PPL is the score of the initial professional dialogue model on the PPL indicator, which is the inverse form of the PPL indicator score
  • Score distinct is the score of the initial professional dialogue model on the DISTINCT indicator
  • Score val is the verification score.
  • a calculation process of the score Score BLEU of the initial professional dialogue model on the BLEU indicator is also included.
  • the calculation process of the score Score BLEU of the initial professional dialogue model on the BLEU indicator includes:
  • the score of the initial professional dialogue model on the BLEU indicator is calculated using the following formula:
  • lc is the length of the machine translation
  • lr is the length of the shortest reference translation sentence
  • Pn is the precision of n-gram
  • Wn is the weight of n-gram, for any n
  • Wn 1/N
  • BP is the penalty factor.
  • a calculation process of the score Score ROUGE of the initial professional dialogue model on the ROUGE indicator is also included.
  • the calculation process of the score Score ROUGE of the initial professional dialogue model on the ROUGE indicator includes:
  • the score of the initial professional dialogue model on the ROUGE indicator is calculated using the following formula:
  • ⁇ reference translation ⁇ represents the reference translation set
  • gram N represents the combination of N words
  • Count(gram N ) represents the number of N-grams in the calculated translation.
  • the denominator of the formula is the number of N-grams in all reference translations
  • the numerator is the number of N-grams shared by all reference translations and machine translations.
  • the calculation process of the score Score PPL of the initial professional dialogue model on the PPL indicator is also included.
  • the calculation process of the score Score PPL of the initial professional dialogue model on the PPL indicator is:
  • x1 , x2 , ..., xi-1 ) represents the probability of predicting the i-th word based on the previous words
  • N represents the length of the sentence.
  • a calculation process of the score Score distinct of the initial professional dialogue model on the DISTINCT indicator is also included.
  • the calculation process of the score Score distinct of the initial professional dialogue model on the DISTINCT indicator includes:
  • the score of the initial professional dialogue model on the DISTINCT indicator is calculated using the following formula :
  • Count(unique ngram) represents the number of unique ngrams in the reply
  • Count(word) represents the total number of ngram words in the reply.
  • the method before the original dialogue model is trained using the pre-acquired general dialogue dataset, the method further includes:
  • the question-answering data and small talk data in the general conversation dataset are filtered separately.
  • the original dialogue model is trained using a pre-acquired general dialogue dataset to obtain a general dialogue model, including:
  • the dialogue model obtained by this round of iterative training is determined as the general dialogue model.
  • determining whether the model training cutoff condition is reached according to the current number of iterations and the loss standard deviation includes:
  • the process when it is determined that the current iteration number is greater than the first preset value and the loss standard deviation is greater than or equal to the second preset value, the process further includes:
  • the general dialogue data set is input into the dialogue model obtained by this round of iterative training for model iterative training, and the steps of obtaining the current iteration number and the loss standard deviation obtained by this round of iterative training are repeated.
  • data screening of a general conversation data set is performed according to a professional keyword group, including:
  • the DFA algorithm is used to screen the general dialogue dataset according to professional keyword groups.
  • a dialogue response method is applied to a dialogue system including a target professional dialogue model trained as above, comprising:
  • the target professional dialogue model fails to respond to the target question voice, it searches for relevant answers from the database based on the preset retrieval algorithm;
  • the relevant answers are output by voice.
  • a training device for a dialogue model comprising:
  • a general dialogue model acquisition module is used to train the original dialogue model using the pre-acquired general dialogue data set to obtain a general dialogue model
  • An initial annotated data set determination module is used to obtain a preset professional keyword group, and screen the general conversation data set according to the professional keyword group, and determine the screened data set as the initial annotated data set;
  • An initial professional dialogue model acquisition module is used to train the general dialogue model using the initial annotated data set to obtain an initial professional dialogue model
  • a verification score acquisition module is used to perform a verification operation on the initial professional dialogue model using a verification data set and a preset natural language processing evaluation index to obtain a verification score;
  • a judgment module is used to judge whether the verification score is greater than a preset score threshold
  • the target professional dialogue model determination module is used to determine the initial professional dialogue model as the target professional dialogue model when the verification score is greater than a preset score threshold.
  • a dialogue response device comprising:
  • a question voice receiving module is used to receive a target question voice to be responded to
  • a response speech generation module is used to generate a target response speech corresponding to a target question speech by using a target professional dialogue model obtained by training a general dialogue model;
  • the response speech output module is used to output the target response speech.
  • An electronic device comprising:
  • the processor is used to implement the steps of the training method or the dialogue response method of the above dialogue model when executing the computer program.
  • a non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the training method or the dialogue response method of the above dialogue model are implemented.
  • the training method of the dialogue model provided in the present application uses a pre-acquired general dialogue data set to train the original dialogue model to obtain a general dialogue model; obtains a preset professional keyword group, and screens the general dialogue data set according to the professional keyword group, and determines the screened data set as the initial annotated data set; uses the initial annotated data set to train the general dialogue model to obtain an initial professional dialogue model; uses a verification data set and a preset natural language processing evaluation index to verify the initial professional dialogue model to obtain a verification score; determines whether the verification score is greater than a preset score threshold; if the verification score is greater than the preset score threshold, determines the initial professional dialogue model as the target professional dialogue model.
  • the present application also provides a dialogue model training device, a dialogue response method and device, an electronic device and a storage medium corresponding to the above-mentioned dialogue model training method, which have the above-mentioned technical effects and will not be repeated here.
  • FIG1 is a flowchart of an implementation of a method for training a dialogue model in an embodiment of the present application
  • FIG2 is another implementation flow chart of the method for training a dialogue model in an embodiment of the present application.
  • FIG3 is a flowchart of an implementation of a dialogue response method in an embodiment of the present application.
  • FIG4 is a structural block diagram of a training device for a dialogue model in an embodiment of the present application.
  • FIG5 is a structural block diagram of a dialogue response device in an embodiment of the present application.
  • FIG6 is a structural block diagram of an electronic device in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a specific structure of an electronic device provided in an embodiment of the present application.
  • FIG. 1 is a flowchart of an implementation of a method for training a dialogue model in an embodiment of the present application.
  • the method may include the following steps:
  • General conversation data sets can be divided into two categories: question-answering and small talk.
  • Question-answering data can cover many fields such as common sense, current events, mother and baby, medical care, law, insurance, aviation, psychology, traditional Chinese medicine, and epidemics.
  • Small talk data can include Weibo discussions, TV drama dialogues, Tieba discussions, Douban comments, e-commerce conversations, and other data sets, which can cover various topics of daily life such as history, movies, weather, entertainment, and sports.
  • the original dialogue model is trained using the pre-acquired general dialogue dataset to obtain a general dialogue model.
  • S102 Obtain a preset professional keyword group, and screen the general dialogue data set according to the professional keyword group, and determine the screened data set as the initial annotated data set.
  • Professional dialogue datasets are generally labeled by experts. Although the data demand is much smaller than that of general dialogue datasets, it is also very time-consuming and labor-intensive to rely solely on expert annotation. Therefore, professional keyword groups are set in advance. After the original dialogue model is trained with the general dialogue dataset to obtain the general dialogue model, the preset professional keyword groups are obtained, and the general dialogue dataset is screened according to the professional keyword groups. The screened dataset is determined as the initial annotated dataset, which is recorded as L 0. By setting professional keyword groups to screen the general dialogue dataset to obtain the initial annotated dataset, the generation efficiency of the professional dialogue dataset is greatly improved compared with the simple manual annotation method.
  • data screening of a general conversation data set according to a professional keyword group may include the following steps:
  • the DFA algorithm is used to screen the general dialogue dataset according to professional keyword groups.
  • the DFA algorithm When filtering professional conversation data sets from general conversation data sets, the DFA algorithm is used to filter data from the general conversation data sets according to professional keyword groups. In this way, the DFA algorithm can be fully utilized to achieve efficient keyword matching while also achieving the advantage of sensitive word filtering.
  • the embodiment of the present application uses the DFA algorithm to implement keyword matching.
  • the process of filtering out professional conversation data from a general conversation data set may include the following steps:
  • the professional conversation dataset is composed according to the prompt format of Table 1.
  • a specific example of building a server professional dialogue dataset is as follows:
  • the server intelligent customer service is a multi-round dialogue
  • the content of the dialogue is: "Hello, how can I help you?"
  • "The red status light is related to the power supply, right? This will not affect the normal operation of the server.”
  • "The status is a general light. It will light up when there is a problem with the machine. It is recommended to plug in all four power supplies.” "There is no condition to plug in 4 power supplies on site. Is there any way to prevent the status light from turning on?” "Yes, use the command to refresh the power supply policy to dual power.”
  • S103 Train the general dialogue model using the initial annotated data set to obtain an initial professional dialogue model.
  • the general dialogue model is trained using the initial annotated data set L 0 to obtain an initial professional dialogue model, which is denoted as G 0 .
  • S104 Use the verification data set and the preset natural language processing evaluation index to verify the initial professional dialogue model and obtain a verification score.
  • the initial professional dialogue model G0 is obtained through training, the initial professional dialogue model is verified using the verification data set and the preset natural language processing evaluation index to obtain a verification score, which is recorded as Score val .
  • the response performance of the initial professional dialogue model to voice questions is estimated through the verification score.
  • step S105 Determine whether the verification score is greater than a preset score threshold. If the verification score is greater than the preset score threshold, execute step S106. If the verification score is not greater than the preset score threshold, continue training the initial professional dialogue model.
  • a score threshold is set in advance. After the initial professional dialogue model is verified using the verification data set and the preset natural language processing evaluation index, it is determined whether the verification score is greater than the preset score threshold. If the verification score is greater than the preset score threshold, it means that the model has been trained, and step S106 is executed. If the verification score is not greater than the preset score threshold, it means that the initial professional dialogue model needs to continue to be trained.
  • S106 Determine the initial professional dialogue model as the target professional dialogue model.
  • the verification score is greater than the preset score threshold, it means that the model has been trained, and the initial professional dialogue model is determined as the target professional dialogue model.
  • the target professional dialogue model and all current expert annotation data sets can also be output.
  • FIG. 2 is another implementation flow chart of the method for training a dialogue model in an embodiment of the present application.
  • the method may include the following steps:
  • the method for training the dialogue model may further include the following steps:
  • the question-answering data and small talk data in the general conversation dataset are filtered separately.
  • the question-answering data and the chat data in the general conversation dataset are filtered respectively.
  • the overall noise of the question-answering dataset is relatively small, only simple filtering can be performed, including removing conversations containing sensitive words, removing conversations with less than m (m ⁇ 10) characters, removing conversations with the same questions and answers, and removing meaningless characters in the corpus.
  • the filtering methods used include removing conversations containing sensitive words, removing conversations with less than m (m ⁇ 10) characters, removing conversations with only one sentence, removing conversations that do not contain Chinese characters, removing advertising conversations, removing repeated conversations, and removing meaningless characters in the corpus.
  • the data set can also be organized into different categories in a certain prompt format, as follows:
  • step S201 may include the following steps:
  • Step 1 Input the general dialogue dataset into the original dialogue model for iterative model training
  • Step 2 Get the current iteration number and the loss standard deviation obtained in this round of iterative training
  • Step 3 Determine whether the model training cutoff condition is met based on the current number of iterations and the loss standard deviation. If the model training cutoff condition is met, execute step 4; if the model training cutoff condition is not met, execute step 5;
  • Step 4 Determine the dialogue model obtained by this round of iterative training as the general dialogue model
  • Step 5 Input the general dialogue data set into the dialogue model obtained in this round of iterative training to perform model iterative training, and return to execute step 2.
  • the process of using the general dialogue data set to train the original dialogue model to obtain the general dialogue model may include inputting the general dialogue data set into the original dialogue model for model iterative training, obtaining the current iteration number and the loss standard deviation obtained in this round of iterative training, and determining whether the model training cutoff condition is met according to the current iteration number and the loss standard deviation. If the model training cutoff condition is met, it means that the model obtained by the current training can already give a good voice response to general questions, and the dialogue model obtained by this round of iterative training is determined as the general dialogue model.
  • model training cutoff condition If the model training cutoff condition is not met, it means that the model obtained by the current training cannot yet give a good voice response to general questions, and the general dialogue data set is inputted into the dialogue model obtained by this round of iterative training for model iterative training, and the current iteration number and the loss standard deviation obtained by this round of iterative training are again obtained, and the model is continuously optimized through multiple training iterations.
  • model training cutoff condition can be set and adjusted according to actual conditions, and the embodiments of the present application do not limit this. For example, it can be set to an upper limit on the number of iterations or a loss threshold.
  • determining whether the model training cutoff condition is reached according to the current number of iterations and the loss standard deviation may include the following steps:
  • Step 1 Input the general dialogue dataset into the original dialogue model for iterative model training
  • Step 2 Get the current iteration number and the loss standard deviation obtained in this round of iterative training
  • Step 3 Determine whether the current number of iterations is greater than the first preset value and the loss standard deviation is less than the second preset value. If the current number of iterations is greater than the first preset value and the loss standard deviation is less than the second preset value, execute step 4. If the current number of iterations is greater than the first preset value and the loss standard deviation is less than the second preset value, then when it is determined that the current number of iterations is greater than the first preset value and the loss standard deviation is greater than or equal to the second preset value, execute step 5.
  • Step 4 Determine the dialogue model obtained by this round of iterative training as the general dialogue model
  • Step 5 Determine whether the current iteration number is greater than a third preset value. If the current iteration number is greater than the third preset value, return to step 4. If the current iteration number is not greater than the third preset value, execute step 6.
  • the third preset value is greater than the first preset value
  • Step 6 Input the general dialogue data set into the dialogue model obtained in this round of iterative training to perform model iterative training, and return to execute step 2.
  • Pre-set hyperparameters in model training may include the minimum number of pre-training iterations N 1 (i.e., the first preset value) obtained by pre-training the number of iterations iters, and the standard deviation threshold T of the loss standard deviation ⁇ loss (i.e., the second preset value).
  • the loss standard deviation ⁇ loss represents the standard deviation of the latest ten iteration losses.
  • the pre-set hyperparameters in the model training may also include a pre-training maximum iteration number N 2 (i.e., a third preset value) obtained by pre-training the iteration number iters, the third preset value being greater than the first preset value, i.e., N 2 >N 1 .
  • N 2 a pre-training maximum iteration number obtained by pre-training the iteration number iters
  • the third preset value being greater than the first preset value, i.e., N 2 >N 1 .
  • the dialogue model obtained in this round of iterative training is determined as a general dialogue model. If the current iteration number is not greater than the third preset value, it is determined that the model needs to be further trained, and the general dialogue data set is input into the dialogue model obtained in this round of iterative training for model iterative training, and the current iteration number and the loss standard deviation obtained in this round of iterative training are obtained again. It is determined whether the model training cutoff condition is met based on the data of this round of iterations, and this is repeated until the preset model training cutoff condition is met, thereby obtaining a general dialogue model that can respond well to general question voices.
  • S202 Obtain a preset professional keyword group, and screen the general dialogue data set according to the professional keyword group, and determine the screened data set as the initial annotated data set.
  • S203 Train the general dialogue model using the initial annotated data set to obtain an initial professional dialogue model.
  • S204 Use the verification data set and the preset natural language processing evaluation index to verify the initial professional dialogue model and obtain a verification score.
  • the verification operation of the initial professional dialogue model using the verification data set and the preset natural language processing evaluation index may include the following steps:
  • the initial professional dialogue model is verified by combining the verification data set, BLEU index, ROUGE index, PPL index, and DISTINCT index through the following formula:
  • Score BLEU is the score of the initial professional dialogue model on the BLEU indicator
  • Score ROUGE is the score of the initial professional dialogue model on the ROUGE indicator
  • Score PPL is the score of the initial professional dialogue model on the PPL indicator.
  • the score on the DISTINCT indicator is in the inverse form of the PPL indicator score.
  • Score distinct is the score of the initial professional dialogue model on the DISTINCT indicator
  • Score val is the verification score.
  • Score BLEU is the score of the initial professional dialogue model on the BLEU indicator
  • Score ROUGE is the score of the initial professional dialogue model on the ROUGE indicator
  • Score PPL is the score of the initial professional dialogue model on the PPL indicator, which is in the inverse form of the PPL indicator score. The smaller the value, the worse the model generation effect.
  • the performance of the model on the validation dataset is comprehensively evaluated by using four indicators: BLEU, ROUGE, PPL, and DISTINCT. While ensuring the fluency and diversity of model generation, the accuracy and recall of the generated answers are guaranteed.
  • the training method of the dialogue model may further include a process of calculating the score Score BLEU of the initial professional dialogue model on the BLEU indicator.
  • the process of calculating the score Score BLEU of the initial professional dialogue model on the BLEU indicator may include the following steps:
  • the score of the initial professional dialogue model on the BLEU indicator is calculated using the following formula:
  • lc is the length of the machine translation
  • lr is the length of the shortest reference translation sentence
  • Pn is the precision of n-gram
  • Wn is the weight of n-gram, for any n
  • Wn 1/N
  • BP is the penalty factor.
  • BLEU The core idea of BLEU is to compare the overlap between the n-grams in the candidate translation and the reference translation.
  • N is usually taken as 1 to 4, and then a weighted average is performed.
  • lc is the length of the machine translation
  • lr is the length of the shortest reference translation sentence
  • Pn is the n-gram precision
  • Wn is the n-gram weight, which is generally set to a uniform weight, that is, for any n
  • Wn 1/N.
  • BP is a penalty factor. If the length of the translation is less than the shortest reference translation, BP is less than 1.
  • the 1-gram precision of BLEU indicates the degree of faithfulness of the translation to the original text, while other n-grams indicate the fluency of the translation.
  • the training method of the dialogue model may further include a calculation process of the score Score ROUGE of the initial professional dialogue model on the ROUGE indicator.
  • the calculation process of the score Score ROUGE of the initial professional dialogue model on the ROUGE indicator may include:
  • the score of the initial professional dialogue model on the ROUGE indicator is calculated using the following formula:
  • ⁇ reference translation ⁇ represents the reference translation set
  • gram N represents the combination of N words
  • Count(gram N ) represents the number of N-grams in the calculated translation.
  • the denominator of the formula is the number of N-grams in all reference translations
  • the numerator is the number of N-grams shared by all reference translations and machine translations.
  • ROUGE-N focuses on recall rather than precision. It looks at how many n-grams in the reference translation appear in the output. "N" refers to N-gram, which is calculated similarly to BLEU, except that BLEU is based on precision, while ROUGE is based on recall. ROUGE-N mainly counts the recall on N-gram. For N-gram, the ROUGE-N score can be calculated as follows:
  • ⁇ reference translation ⁇ represents a reference translation set. In actual applications, there may be multiple reference translations.
  • Gram N represents a combination of N words, and Count(gram N ) represents the number of N-grams in the translation.
  • the denominator of the formula is the number of N-grams in all reference translations, while the numerator is the number of N-grams shared by all reference translations and machine translations.
  • the training method of the dialogue model may further include a calculation process of the score Score PPL of the initial professional dialogue model on the PPL indicator.
  • the calculation process of the score Score PPL of the initial professional dialogue model on the PPL indicator is:
  • x1 , x2 , ..., xi-1 ) represents the probability of predicting the i-th word based on the previous words
  • N represents the length of the sentence.
  • PPL refers to the perplexity in the language model. Perplexity is an indicator to measure whether a sentence is fluent. It is defined as:
  • x1 , x2 , ..., xi-1 ) represents the probability of predicting the i-th word based on the previous words
  • N represents the length of the sentence.
  • PPL value the more natural and fluent the response generated by the model.
  • Using PPL to evaluate the response quality can avoid the situation where the responses generated by the model are out of order or inverted.
  • the method may further include a calculation process of a score Score distinct of the initial professional dialogue model on a DISTINCT indicator, and the calculation process of the score Score distinct of the initial professional dialogue model on a DISTINCT indicator includes:
  • the score of the initial professional dialogue model on the DISTINCT indicator is calculated using the following formula:
  • Count(unique ngram) represents the number of unique ngrams in the reply
  • Count(word) represents the total number of ngram words in the reply.
  • the Distinct evaluation index determines the diversity of machine responses.
  • the Distinct index determines whether a large number of common and repetitive responses appear.
  • the definition of Distinct is as follows:
  • Count(unique ngram) represents the number of unique ngrams in the reply
  • Count(word) represents the total number of ngram words in the reply. The larger Count(unique ngram) is, the higher the diversity of the generated replies is.
  • step S205 Determine whether the verification score is greater than a preset score threshold. If the verification score is greater than the preset score threshold, execute step S106; if the verification score is not greater than the preset score threshold, execute step S207.
  • S207 Generate corresponding response data for each sample data in the preset unlabeled pool using the initial professional dialogue model.
  • the initial professional dialogue model G0 is used to generate corresponding response data for each sample data in the preset unlabeled pool.
  • the automatic evaluation score corresponding to each response data is calculated respectively.
  • the automatic evaluation score corresponding to each response data can be calculated using the PPL indicator and the Distinct indicator, and the calculation formula is as follows:
  • S209 sorting the automatic evaluation scores by size, and selecting a preset number of automatic evaluation scores from the end with smaller scores.
  • the automatic evaluation scores are sorted, and a preset number of automatic evaluation scores are selected from the end with smaller scores, such as selecting the lowest N Score U scores.
  • S210 Outputting annotation prompt information for annotating the response data corresponding to each selected automatic evaluation score.
  • labeling prompt information for labeling the response data corresponding to each selected automatic evaluation score is output, thereby prompting the expert to label the response data corresponding to the lowest N Score U scores.
  • the annotation result is obtained, and the initial annotation data set is updated according to the annotation result to obtain an updated annotation data set, thereby achieving effective annotation of data for which the response data generated by the current professional dialogue model is not good.
  • the method for training the dialogue model may further include the following steps:
  • the preset unlabeled pool is updated according to the updated labeled data set, thereby achieving timely update of the unlabeled sample data in the preset unlabeled pool.
  • the initial professional dialogue model is trained based on the updated annotated data set to obtain an updated professional dialogue model.
  • the embodiment of the present application adopts an active learning method to reduce the number of samples annotated by experts as much as possible, thereby reducing the impact on model performance.
  • the "difficult samples" that can improve the model performance the most are continuously selected from the preset unlabeled pool, thereby improving the model performance.
  • step S213 Use the verification data set to verify the updated professional dialogue model, obtain a verification score, and return to execute step S205.
  • the updated professional dialogue model is verified using the verification dataset to obtain a verification score, and the step of determining whether the verification score is greater than a preset score threshold is returned to execute, and this process is repeated until the calculated verification score is greater than the preset score threshold, thereby obtaining a target professional dialogue model that can respond well to the received question voice.
  • FIG. 3 is a flowchart of an implementation of a dialogue response method in an embodiment of the present application, which is applied to a dialogue system including a target professional dialogue model obtained by the previous training.
  • the method may include the following steps:
  • the target question voice is output to the dialogue response control center, and the dialogue response control center receives the target question voice to be responded to.
  • the dialog response control center may be a processor on which a dialog model is deployed.
  • the target question voice can be small talk, general knowledge Q&A, professional Q&A, etc.
  • S302 Generate a target response speech corresponding to the target question speech using a target professional dialogue model obtained based on training of the general dialogue model.
  • Pre-train a general dialogue model For example, you can train a model based on a large model on a general dialogue dataset to obtain a general dialogue model.
  • the large model can be based on a Transformer structure and is suitable for generation tasks, such as a GPT (Generative Pre-Training) model, a BERT (Bidirectional Encoder Representation from Transformers) model, etc.
  • GPT Generative Pre-Training
  • BERT Bidirectional Encoder Representation from Transformers
  • the two-stage model training method is adopted, so that the trained target professional dialogue model has both universality and professionalism.
  • model training process requires more resources than the model application process, more resources can be allocated to the model training process in advance, and relatively fewer resources can be allocated to the model application process.
  • 80G GPUs Graphics Processing Units
  • 1 or more 80G GPUs can be allocated in advance for model application.
  • An 80G GPU is used for model application.
  • the dialogue response method may further include the following steps:
  • Step 1 When the target professional dialogue model fails to respond to the target question voice, it searches for relevant answers from the database based on the preset retrieval algorithm;
  • Step 2 Voice output of relevant answers.
  • the embodiment of the present application pre-sets a fallback solution, uses professional data sets to build a professional database, and when the target professional dialogue model fails to respond to the target question voice, that is, when the target professional dialogue model output is empty, the database is searched for relevant answers based on the preset retrieval algorithm, and the relevant answers are output in voice. This optimizes the application process of the professional dialogue model, further ensures that the user's question voice will not be unanswered, and improves the user experience.
  • the present application also provides a training device for a dialogue model.
  • the training device for a dialogue model described below and the training method for a dialogue model described above can refer to each other.
  • FIG. 4 is a structural block diagram of a training device for a dialogue model in an embodiment of the present application.
  • the training device for the dialogue model may include:
  • a general dialogue model acquisition module 41 is used to train the original dialogue model using the pre-acquired general dialogue data set to obtain a general dialogue model;
  • the initial annotated data set determination module 42 is used to obtain a preset professional keyword group, and screen the general conversation data set according to the professional keyword group, and determine the screened data set as the initial annotated data set;
  • An initial professional dialogue model acquisition module 43 is used to train the general dialogue model using the initial annotated data set to obtain an initial professional dialogue model
  • a verification score obtaining module 44 is used to perform a verification operation on the initial professional dialogue model using a verification data set and a preset natural language processing evaluation index to obtain a verification score;
  • a determination module 45 used to determine whether the verification score is greater than a preset score threshold
  • the target professional dialogue model determination module 46 is used to determine the initial professional dialogue model as the target professional dialogue model when the verification score is greater than a preset score threshold.
  • the training device of the dialogue model may further include:
  • a response data generation module used to generate corresponding response data for each sample data in a preset unlabeled pool using an initial professional dialogue model when it is determined that the verification score is less than or equal to a preset score threshold;
  • An automatic evaluation score calculation module is used to calculate the automatic evaluation score corresponding to each response data
  • An automatic evaluation score selection module is used to sort the automatic evaluation scores and select a preset number of automatic evaluation scores from the end with smaller scores;
  • a labeling prompt information output module is used to output labeling prompt information for labeling the response data corresponding to each selected automatic evaluation score
  • the labeling data set updating module is used to update the initial labeling data set according to the labeling result to obtain an updated labeling data set;
  • a professional dialogue model updating module is used to train the initial professional dialogue model based on the updated annotated data set to obtain an updated professional dialogue model
  • the repeated execution module is used to use the verification data set to verify the updated professional dialogue model, obtain a verification score, and repeatedly execute the step of determining whether the verification score is greater than a preset score threshold.
  • the training device of the dialogue model may further include:
  • the unlabeled pool updating module is used to update the preset unlabeled pool according to the updated labeled data set after obtaining the updated labeled data set.
  • the verification score acquisition module 44 is specifically used to verify the initial professional dialogue model by combining the verification data set, BLEU index, ROUGE index, PPL index, and DISTINCT index through the following formula:
  • Score BLEU is the score of the initial professional dialogue model on the BLEU indicator
  • Score ROUGE is the score of the initial professional dialogue model on the ROUGE indicator
  • Score PPL is the score of the initial professional dialogue model on the PPL indicator, which is the inverse form of the PPL indicator score
  • Score distinct is the score of the initial professional dialogue model on the DISTINCT indicator
  • Score val is the verification score.
  • the training device of the dialogue model may further include:
  • the score calculation module based on the BLEU indicator is used to calculate the score Score BLEU of the initial professional dialogue model based on the BLEU indicator using the following formula:
  • lc is the length of the machine translation
  • lr is the length of the shortest reference translation sentence
  • Pn is the precision of n-gram
  • Wn is the weight of n-gram, for any n
  • Wn 1/N
  • BP is the penalty factor.
  • the training device of the dialogue model may further include:
  • the score calculation module based on the ROUGE indicator is used to calculate the score of the initial professional dialogue model on ROUGE using the following formula: Score ROUGE on the indicator:
  • ⁇ reference translation ⁇ represents the reference translation set
  • gram N represents the combination of N words
  • Count(gram N ) represents the number of N-grams in the calculated translation.
  • the denominator of the formula is the number of N-grams in all reference translations
  • the numerator is the number of N-grams shared by all reference translations and machine translations.
  • the training device of the dialogue model may further include:
  • the score calculation module based on the PPL indicator is used to calculate the score Score PPL of the initial professional dialogue model based on the PPL indicator using the following formula:
  • x1 , x2 , ..., xi-1 ) represents the probability of predicting the i-th word based on the previous words
  • N represents the length of the sentence.
  • the training device of the dialogue model may further include:
  • the score calculation module based on the DISTINCT indicator is used to calculate the score of the initial professional dialogue model based on the DISTINCT indicator using the following formula:
  • Count(unique ngram) represents the number of unique ngrams in the reply
  • Count(word) represents the total number of ngram words in the reply.
  • the training device of the dialogue model may further include:
  • the data filtering module is used to filter the question-answering data and the small talk data in the general conversation dataset before training the original conversation model with the pre-acquired general conversation dataset.
  • the general dialogue model acquisition module 41 includes:
  • An iterative training submodule is used to input the general dialogue dataset into the original dialogue model for iterative model training
  • the loss standard deviation acquisition submodule is used to obtain the current iteration number and the loss standard deviation obtained in this round of iterative training;
  • the training cutoff judgment submodule is used to determine whether the model training cutoff condition is reached based on the current number of iterations and the loss standard deviation;
  • the general dialogue model determination submodule is used to determine the dialogue model obtained in this round of iterative training as the general dialogue model when it is determined that the model training cutoff condition is reached according to the current number of iterations and the loss standard deviation.
  • the training cutoff judgment submodule is specifically a module for judging whether the current iteration number is greater than a first preset value and the loss standard deviation is less than a second preset value.
  • the training device of the dialogue model may further include:
  • the iteration number statistics submodule is used to determine whether the current iteration number is greater than a third preset value when it is determined that the current iteration number is greater than the first preset value and the loss standard deviation is greater than or equal to the second preset value; wherein the third preset value is greater than the first preset value;
  • the general dialogue model determination submodule is further used to determine the dialogue model obtained by the current round of iterative training as the general dialogue model when the current iteration number is greater than a third preset value;
  • the iterative training submodule is also used to input the general dialogue data set into the dialogue model obtained by this round of iterative training for model iterative training when the current iteration number is less than or equal to the third preset value, and repeatedly execute the steps of obtaining the current iteration number and the loss standard deviation obtained by this round of iterative training.
  • the initial annotated data set determination module 42 is specifically a module that uses the DFA algorithm to perform data screening on the general dialogue data set according to the professional keyword group.
  • the present application also provides a dialogue response device.
  • the dialogue response device described below and the dialogue response method described above can be referred to in correspondence with each other.
  • FIG. 5 is a structural block diagram of a conversation response device in an embodiment of the present application.
  • the conversation response device may include:
  • a question voice receiving module 51 is used to receive a target question voice to be responded to
  • a response speech generation module 52 is used to generate a target response speech corresponding to a target question speech by using a target professional dialogue model obtained by training a general dialogue model;
  • the response voice output module 53 is used to output the target response voice.
  • the dialogue response device may further include:
  • An answer search module is used to search for relevant answers from a database based on a preset retrieval algorithm when the target professional dialogue model fails to respond to the target question voice;
  • the voice output module is used to output the relevant answers in voice.
  • FIG. 6 is a schematic diagram of an electronic device provided by the present application, and the device may include:
  • the processor 322 is configured to implement the steps of the dialogue model training method or the dialogue response method of the above method embodiment when executing the computer program.
  • FIG. 7 is a schematic diagram of a specific structure of an electronic device provided in an embodiment of the present application.
  • the sub-devices may have relatively large differences due to different configurations or performances, and may include a processor (central processing unit, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344.
  • the memory 332 can be a temporary storage or a permanent storage.
  • the program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device.
  • the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device 301.
  • the electronic device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and/or one or more operating systems 341 .
  • the steps in the dialog response method described above may be implemented by the structure of an electronic device.
  • the present application further provides a non-volatile readable storage medium, on which a computer program is stored.
  • a computer program is stored on a non-volatile readable storage medium, on which a computer program is stored.
  • the original dialogue model is trained using the pre-acquired general dialogue data set to obtain a general dialogue model; a preset professional keyword group is obtained, and the general dialogue data set is screened according to the professional keyword group, and the screened data set is determined as the initial annotated data set; the general dialogue model is trained using the initial annotated data set to obtain an initial professional dialogue model; the initial professional dialogue model is verified using the verification data set and the preset natural language processing evaluation index to obtain a verification score; it is determined whether the verification score is greater than a preset score threshold; if the verification score is greater than the preset score threshold, the initial professional dialogue model is determined as the target professional dialogue model;
  • the non-volatile readable storage medium may include: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
  • each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments.
  • the same or similar parts between the embodiments can be referred to each other.
  • the description is relatively simple, and the relevant parts can be referred to the method part.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Machine Translation (AREA)

Abstract

本申请公开了一种对话模型的训练方法,包括:利用通用对话数据集对原始对话模型进行训练,得到通用对话模型;获取预设的专业关键词组,根据专业关键词组对通用对话数据集进行数据筛选;利用筛选到的初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证,得到验证得分;判断验证得分是否大于预设得分阈值;若验证得分大于预设得分阈值,则将初始专业对话模型确定为目标专业对话模型。本申请使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。

Description

一种对话模型的训练方法及装置、对话响应方法及装置
相关申请的交叉引用
本申请要求于2022年11月17日提交中国专利局,申请号为202211441290.4,申请名称为“一种对话模型的训练方法及装置、对话响应方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,特别是涉及一种对话模型的训练方法及装置、对话响应方法及装置、电子设备及存储介质。
背景技术
人机对话作为自然语言处理(Natural Language Processing,NLP)的一项基础应用,一直备受学术界和工业界的重视。随着人工智能技术的发展,基于生成式的对话模型越来越受欢迎,它们专门针对对话数据进行训练,在开放域对话获得了非常好的表现。但是从头开始训练对话大模型,需要大量的多类型对话数据作为训练语料,这需要的成本比较高,训练耗时长。
在专业的人机对话系统中常常也会存在不同的聊天需求,包括:闲聊、常识问答以及专业问答等。如医疗机器人在与病人聊天过程中不仅要回答医疗专业知识,生活中常识问题也会涉及到,还要会闲聊排解病人的情绪。目前专业的对话模型大部分采用检索方式,其主要原理是语义匹配,即在知识库中找到用户提问的问题的答案。虽然技术已比较成熟,但太依赖于语料,知识片面、回复单一生硬,缺乏通用性和多样性,用户体验感差。
发明内容
本申请的目的是提供一种对话模型的训练方法及装置、对话响应方法及装置、电子设备及存储介质,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升用户使用体验。
为解决上述技术问题,本申请提供如下技术方案:
一种对话模型的训练方法,包括:
利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;
获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;
利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;
利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到 验证得分;
判断验证得分是否大于预设得分阈值;
若验证得分大于预设得分阈值,则将初始专业对话模型确定为目标专业对话模型。
本申请一些实施例中,当确定验证得分小于等于预设得分阈值时,还包括:
利用初始专业对话模型针对预设未标记池中各样本数据生成对应的响应数据;
分别计算各响应数据对应的自动评估得分;
对各自动评估得分进行大小排序,从得分较小的一端选取预设数量个自动评估得分;
输出对选取得到的各自动评估得分对应的响应数据进行标注的标注提示信息;
根据标注结果对初始标注数据集进行更新,得到更新后标注数据集;
基于更新后标注数据集对初始专业对话模型进行训练,得到更新后专业对话模型;
利用验证数据集对更新后专业对话模型进行验证操作,得到验证得分,并重复执行判断验证得分是否大于预设得分阈值的步骤。
本申请一些实施例中,在得到更新后标注数据集之后,还包括:
根据更新后标注数据集对预设未标记池进行更新操作。
本申请一些实施例中,利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,包括:
通过以下公式结合验证数据集、BLEU指标、ROUGE指标、PPL指标、DISTINCT指标对初始专业对话模型进行验证操作:
其中,ScoreBLEU为初始专业对话模型在BLEU指标上的得分,ScoreBLEU为初始专业对话模型在ROUGE指标上的得分,ScorePPL为初始专业对话模型在PPL指标上的得分,采用PPL指标得分的倒数形式,Scoredistinct为初始专业对话模型在DISTINCT指标上的得分,Scoreval为验证得分。
本申请一些实施例中,还包括初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程,初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程包括:
通过以下公式计算初始专业对话模型在BLEU指标上的得分ScoreBLEU
其中,lc为机器译文的长度,lr为最短的参考翻译句子的长度,Pn为n-gram的精确率,Wn为n-gram的权重,对于任意n都有Wn=1/N,BP为惩罚因子。
本申请一些实施例中,还包括初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程,初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程包括:
通过以下公式计算初始专业对话模型在ROUGE指标上的得分ScoreROUGE
其中,{参考译文}表示参考译文集合,gramN表示N个字的组合,Count(gramN)表示计算译文中N-gram的数目,公式的分母是统计在所有的参考译文中N-gram的个数,分子是统计所有参考译文与机器译文共有的N-gram个数。
本申请一些实施例中,还包括初始专业对话模型在PPL指标上的得分ScorePPL的计算过程,初始专业对话模型在PPL指标上的得分ScorePPL的计算过程:
其中,P(xi|x1,x2,…,xi-1)表示根据上文词语预测第i个词的概率,N代表句子长度。
本申请一些实施例中,还包括初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程,初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程包括:
通过以下公式计算初始专业对话模型在DISTINCT指标上的得分Scoredistinct
其中,Count(unique ngram)表示回复中不重复的ngram数量,Count(word)表示回复中ngram词语的总数量。
本申请一些实施例中,在利用预获取的通用对话数据集对原始对话模型进行训练之前,还包括:
分别对通用对话数据集中的问答数据和闲聊数据进行过滤。
本申请一些实施例中,利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型,包括:
将通用对话数据集输入至原始对话模型进行模型迭代训练;
获取当前迭代数和本轮迭代训练得到的损失标准差;
根据当前迭代数和损失标准差确定是否达到模型训练截止条件;
若达到模型训练截止条件,则将本轮迭代训练得到的对话模型确定为通用对话模型。
本申请一些实施例中,根据当前迭代数和损失标准差确定是否达到模型训练截止条件,包括:
判断当前迭代数是否大于第一预设值且损失标准差小于第二预设值。
本申请一些实施例中,当确定当前迭代数大于第一预设值且损失标准差大于等于第二预设值时,还包括:
判断当前迭代数是否大于第三预设值;其中,第三预设值大于第一预设值;
若是,则执行将本轮迭代训练得到的对话模型确定为通用对话模型的步骤;
若否,则将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并重复执行获取当前迭代数和本轮迭代训练得到的损失标准差的步骤。
本申请一些实施例中,根据专业关键词组对通用对话数据集进行数据筛选,包括:
利用DFA算法根据专业关键词组对通用对话数据集进行数据筛选。
一种对话响应方法,应用于包含如前训练得到的目标专业对话模型的对话系统,包括:
接收待响应的目标提问语音;
利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音;
对目标响应语音进行输出操作。
本申请一些实施例中,还包括:
当目标专业对话模型对目标提问语音响应失败时,基于预设检索算法从数据库中搜索相关答案;
对相关答案进行语音输出。
一种对话模型的训练装置,包括:
通用对话模型获得模块,用于利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;
初始标注数据集确定模块,用于获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;
初始专业对话模型获得模块,用于利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;
验证得分获得模块,用于利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分;
判断模块,用于判断验证得分是否大于预设得分阈值;
目标专业对话模型确定模块,用于当验证得分大于预设得分阈值时,将初始专业对话模型确定为目标专业对话模型。
一种对话响应装置,包括:
提问语音接收模块,用于接收待响应的目标提问语音;
响应语音生成模块,用于利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音;
响应语音输出模块,用于对目标响应语音进行输出操作。
一种电子设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序时实现如前对话模型的训练方法或对话响应方法的步骤。
一种非易失性可读存储介质,非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如前对话模型的训练方法或对话响应方法的步骤。
本申请所提供的对话模型的训练方法,利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分;判断验证得分是否大于预设得分阈值;若验证得分大于预设得分阈值,则将初始专业对话模型确定为目标专业对话模型。
由上述技术方案可知,通过预先基于通用对话模型训练得到应用于特定对话场景的目标专业对话模型,大大减少了对数据量和计算力的需求,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。
相应的,本申请还提供了与上述对话模型的训练方法相对应的对话模型的训练装置、对话响应方法及装置、电子设备及存储介质,具有上述技术效果,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例中对话模型的训练方法的一种实施流程图;
图2为本申请实施例中对话模型的训练方法的另一种实施流程图;
图3为本申请实施例中一种对话响应方法的实施流程图;
图4为本申请实施例中一种对话模型的训练装置的结构框图;
图5为本申请实施例中一种对话响应装置的结构框图;
图6为本申请实施例中一种电子设备的结构框图;
图7为本申请实施例提供的一种电子设备的具体结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参见图1,图1为本申请实施例中对话模型的训练方法的一种实施流程图,该方法可以包括以下步骤:
S101:利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型。
预先在公开数据集中收集通用对话数据集,通用对话数据集可以分为问答和闲聊两大类。问答数据可以涉及常识、实事、母婴、医疗、法律、保险、航空、心理、中医以及疫情等多领域。闲聊数据可以包括微博讨论、电视剧对白、贴吧讨论、豆瓣评论、电商对话等多个数据集,可以涉及历史、电影、天气、娱乐、体育等日常生活的各种话题讨论。
构建通用对话数据集的具体示例如下:
词条解释类prompt格式为标题:“title”,文章:“text”。原始语料示例{"id":"0","url":https://xxx,"title":"经济学","text":"经济学是一门对产品和服务的生产、分配以及消费进行研究的社会科学……"},按prompt格式组成后:标题:“经济学”,文章:“经济学是一门对产品和服务的生产、分配以及消费进行研究的社会科学……”。
问答类prompt格式:问:“title+desc”答:“answer”。原始语料示例{"qid":0,"title":"AlphaGo只会下围棋吗,阿法狗能写小说吗","desc":"现在会不会有智能机器人能从事文学创作,<br>如果有,能写出什么水平的作品","answer":"AlphaGo只会下围棋,因为它的设计目的,架构,技术方案以及训练数据,都是围绕下围棋这个核心进行的……"},按prompt格式组成:问:“AlphaGo只会下围棋吗,阿法狗能写小说吗,现在会不会有智能机器人能从事文学创作,如果有,能写出什么水平的作品”答:“AlphaGo只会下围棋,因为它的设计目的,架构,技术方案以及训练数据,都是围绕下围棋这个核心进行的……”。
阅读理解类prompt格式:context问:“question”答:“answer”。原始语料示例{"id":"0","context":"胆石症的治疗应区别不同情况分别处理,无症状胆囊结石可不作治疗,但应定期观察并注意良好的饮食习惯……,","question":"什么类型的胆囊结石可不作治疗","answer","无症状胆囊结石"},按prompt格式组成后:胆石症的治疗应区别不同情况分别处理,无症状胆囊结石可不作治疗,但应定期观察并注意良好的饮食习惯……问:“什么类型的胆囊结石可不作治疗”答:“无症状胆囊结石”。
单轮或多轮对话类prompt格式:对话:“dialog1”“dialog2”“dialog3”……。按prompt格式组成后:对话:“怎么不直播了,我都看不到你人”“不播了”“可惜我这么喜欢 你”……
利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型。
S102:获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集。
专业对话数据集一般由专家标记,虽然数据需求量远小于通用对话数据集,但是只靠专家标注的话也非常耗时耗力,因此预先设置专业关键词组。在利用通用对话数据集对原始对话模型进行训练,得到通用对话模型之后,获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集,记为L0。通过设置专业关键词组从通用对话数据集中筛选得到初始标注数据集,相较于单纯的人工标注方法,较大地提升了专业对话数据集的生成效率。
本申请一些实施例中,根据专业关键词组对通用对话数据集进行数据筛选,可以包括以下步骤:
利用DFA算法根据专业关键词组对通用对话数据集进行数据筛选。
当从通用对话数据集中筛选专业对话数据集时,利用DFA算法根据专业关键词组对通用对话数据集进行数据筛选。从而充分利用DFA算法可以实现高效的关键词匹配的同时,也可以实现敏感词过滤的优势。
本申请实施例采用DFA算法实现关键词匹配,从通用对话数据集中筛选出专业对话数据的流程可以包括以下步骤:
(1)专家提供专业关键词组;
(2)将专业关键词组通过建立嵌套字典的方式构建专业词链表(以一个特定字符‘\x00’作为结束);
(3)遍历通用对话数据集中的每组对话,将其作为输入遍历专业词链表,如果遇到特定字符\x00,说明该组对话包含专业关键词,筛选出来。
专业对话数据虽然可以通过如上关键词匹配筛选出一部分,但是通常通用话数据集中涉及的专业对话有限,特别是一些偏门的专业,所以还是需要专家标注。专家标注的数据如涉及隐私,需添加脱敏处理(隐藏对话中姓名、手机号、邮箱等私密信息)。与构建通用对话数据集一样,将专业对话数据集按表1的prompt格式组成。
构建服务器专业对话数据集的具体示例如下:
如服务器智能客服属于多轮对话,对话内容:“您好,请问有什么可以帮您。”“status灯红就是跟电源有关是嘛,这个不影响服务器正常运行吧”“status是一个总的灯,机器有问题就会亮,建议把4路电都插上。”“现场没条件插4路电源,有没有办法不让status灯亮”“有,用指令,把电源策略刷成双电。”
S103:利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型。
在得到初始标注数据集之后,利用初始标注数据集L0对通用对话模型进行训练,得到初始专业对话模型,记为G0
S104:利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分。
在训练得到初始专业对话模型G0之后,利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分,记为Scoreval。通过验证得分预估初始专业对话模型对语音提问的响应性能。
S105:判断验证得分是否大于预设得分阈值,若验证得分大于预设得分阈值,则执行步骤S106,若验证得分不大于预设得分阈值,则对初始专业对话模型继续训练。
预先设置得分阈值,在利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作之后,判断验证得分是否大于预设得分阈值,若验证得分大于预设得分阈值,则说明模型已经训练好,执行步骤S106,若验证得分不大于预设得分阈值,则说明需要对初始专业对话模型继续训练。
S106:将初始专业对话模型确定为目标专业对话模型。
当确定验证得分大于预设得分阈值时,说明模型已经训练好,将初始专业对话模型确定为目标专业对话模型。还可以输出目标专业对话模型和当前所有专家标注数据集。通过根据预设得分阈值判别专业对话模型是否已训练完成,保证了训练得到的目标专业对话模型能够对提问语音有较好的答案生成能力。
由上述技术方案可知,通过预先基于通用对话模型训练得到应用于特定对话场景的目标专业对话模型,大大减少了对数据量和计算力的需求,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。
参见图2,图2为本申请实施例中对话模型的训练方法的另一种实施流程图,该方法可以包括以下步骤:
S201:利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型。
本申请一些实施例中,在步骤S201之前,该对话模型的训练方法还可以包括以下步骤:
分别对通用对话数据集中的问答数据和闲聊数据进行过滤。
在获取到通用对话数据集之后,分别对通用对话数据集中的问答数据和闲聊数据进行过滤。例如,由于问答数据集整体噪音较小,可以只进行简单过滤,包括去除包含敏感词的对话、去除不足m(m≤10)个字的对话、去除问题与答案相同的对话、去除语料中无意义字符等。由于闲聊数据集整体噪音较大,需进行严格过滤。采用的过滤方式包括去除包含敏感词的对话、去除不足m(m≤10)个字的对话、去除只有一句的对话、去除不包含中文字符的对话、删除广告对话、删除重复对话、去除语料中无意义字符等。通过利用经过滤后的通用对话数据集对原始对话模型进行训练,避免了无用数据的干扰,降低了模型训练复杂度,提升了模型训练效率,提升了训练得到的模型的准确性。
为了使训练效果更好,还可以将数据集按不同类别分别按一定的prompt(提示)格式组成,如下:
表1
通过固定的prompt格式,减少后续处理工作。
本申请一些实施例中,步骤S201可以包括以下步骤:
步骤一:将通用对话数据集输入至原始对话模型进行模型迭代训练;
步骤二:获取当前迭代数和本轮迭代训练得到的损失标准差;
步骤三:根据当前迭代数和损失标准差确定是否达到模型训练截止条件,若达到模型训练截止条件,则执行步骤四,若未达到模型训练截止条件,则执行步骤五;
步骤四:将本轮迭代训练得到的对话模型确定为通用对话模型;
步骤五:将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并返回执行步骤二。
为方便描述,可以将上述五个步骤结合起来进行说明。
利用通用对话数据集对原始对话模型进行训练得到通用对话模型的过程可以包括将通用对话数据集输入至原始对话模型进行模型迭代训练,获取当前迭代数和本轮迭代训练得到的损失标准差,根据当前迭代数和损失标准差确定是否达到模型训练截止条件,若达到模型训练截止条件,则说明当前训练得到的模型已经能够对通用提问给出较好的语音响应,将本轮迭代训练得到的对话模型确定为通用对话模型,若未达到模型训练截止条件,则说明当前训练得到的模型还不能对通用提问给出较好的语音响应,将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并再次获取当前迭代数和本轮迭代训练得到的损失标准差,通过多次训练迭代,使得模型得到不断优化。
需要说明的是,模型训练截止条件可以根据实际情况进行设定和调整,本申请实施例对此不做限定,如可以设置为迭代次数上限,还可以设置为损失阈值。
本申请一些实施例中,根据当前迭代数和损失标准差确定是否达到模型训练截止条件,可以包括以下步骤:
步骤一:将通用对话数据集输入至原始对话模型进行模型迭代训练;
步骤二:获取当前迭代数和本轮迭代训练得到的损失标准差;
步骤三:判断当前迭代数是否大于第一预设值且损失标准差小于第二预设值,若当前迭代数大于第一预设值且损失标准差小于第二预设值,则执行步骤四,若不满足当前迭代数大于第一预设值且损失标准差小于第二预设值,则当确定当前迭代数大于第一预设值且损失标准差大于等于第二预设值时,执行步骤五;
步骤四:将本轮迭代训练得到的对话模型确定为通用对话模型;
步骤五:判断当前迭代数是否大于第三预设值,若当前迭代数大于第三预设值,则返回执行步骤四,若当前迭代数不大于第三预设值,则执行步骤六;
其中,第三预设值大于第一预设值;
步骤六:将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并返回执行步骤二。
为方便描述,可以将上述六个步骤结合起来进行说明。
预先设置模型训练中的超参数,超参数可以包括对迭代数iters进行预训练得到的预训练最小迭代数N1(即第一预设值)、损失标准差Δloss的标准差阈值T(即第二预设值),损失标准差Δloss表示最新十个迭代loss的标准差。在获取当前迭代数和本轮迭代训练得到的损失标准差之后,通过判断当前迭代数是否大于第一预设值且损失标准差小于第二预设值,即iters>N1andΔloss<T,从而确定是否已经达到模型训练截止条件。通过结合当前迭代数和损失标准差进行模型训练阶段判定,保证了已对满足训练截止条件的模型进行了一定次数的迭代,提升了模型性能。
预先设置的模型训练中的超参数还可以包括对迭代数iters进行预训练得到的预训练最大迭代数N2(即第三预设值),第三预设值大于第一预设值,即N2>N1。当确定当前迭代数大于第一预设值且损失标准差大于等于第二预设值时,判断当前迭代数是否大于第三预设值,若当前迭代数大于第三预设值,则说明认为损失值下降缓慢,模型已训练至接近全局最优,将本轮迭代训练得到的对话模型确定为通用对话模型,若当前迭代数不大于第三预设值,则说明需要对模型继续训练,将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并再次获取当前迭代数和本轮迭代训练得到的损失标准差,基于本轮迭代的数据判断是否达到模型训练截止条件,如此往复直到达到预设的模型训练截止条件,从而得到能够对通用提问语音进行良好响应的通用对话模型。
S202:获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集。
S203:利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型。
S204:利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分。
本申请一些实施例中,利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,可以包括以下步骤:
通过以下公式结合验证数据集、BLEU指标、ROUGE指标、PPL指标、DISTINCT指标对初始专业对话模型进行验证操作:
其中,ScoreBLEU为初始专业对话模型在BLEU指标上的得分,ScoreROUGE为初始专业对话模型在ROUGE指标上的得分,ScorePPL为初始专业对话模型在PPL指标 上的得分,采用PPL指标得分的倒数形式,Scoredistinct为初始专业对话模型在DISTINCT指标上的得分,Scoreval为验证得分。
在对初始专业对话模型进行验证时,可以结合验证数据集、BLEU指标、ROUGE指标、PPL指标、DISTINCT指标对初始专业对话模型进行验证操作。如可以通过以下公式进行计算验证得分:
其中,ScoreBLEU为初始专业对话模型在BLEU指标上的得分,ScoreROUGE为初始专业对话模型在ROUGE指标上的得分,ScorePPL为初始专业对话模型在PPL指标上的得分,采用PPL指标得分的倒数形式,越小说明模型生成效果越差,Scoredistinct初始专业对话模型在DISTINCT指标上的得分。
通过采用BLEU、ROUGE、PPL、DISTINCT四个指标综合评判模型在验证数据集上的表现。在保证模型生成的通顺性和多样性的同时,保证生成答案的精确率和召回率。
本申请一些实施例中,该对话模型的训练方法还可以包括初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程,初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程可以包括可以步骤:
通过以下公式计算初始专业对话模型在BLEU指标上的得分ScoreBLEU
其中,lc为机器译文的长度,lr为最短的参考翻译句子的长度,Pn为n-gram的精确率,Wn为n-gram的权重,对于任意n都有Wn=1/N,BP为惩罚因子。
BLEU的核心思想是比较候选译文和参考译文里的n-gram的重合程度,重合程度越高 就认为译文质量越高。实践中,通常是取N=1~4,然后进行加权平均。
其中,lc为机器译文的长度,lr为最短的参考翻译句子的长度,Pn为n-gram的精确率,Wn为n-gram的权重,一般设为均匀权重,即对于任意n都有Wn=1/N。BP为惩罚因子,如果译文的长度小于最短的参考译文,则BP小于1。BLEU的1-gram精确率表示译文忠于原文的程度,而其他n-gram表示翻译的流畅程度。
本申请一些实施例中,该对话模型的训练方法还可以包括初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程,初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程可以包括:
通过以下公式计算初始专业对话模型在ROUGE指标上的得分ScoreROUGE
其中,{参考译文}表示参考译文集合,gramN表示N个字的组合,Count(gramN)表示计算译文中N-gram的数目,公式的分母是统计在所有的参考译文中N-gram的个数,分子是统计所有参考译文与机器译文共有的N-gram个数。
ROUGE-N专注于召回率而非精度。查看有多少个参考译句中的n元词组出现在了输出之中。“N”指的是N-gram,其计算方式与BLEU类似,只是BLEU基于精确率,而ROUGE基于召回率。ROUGE-N主要统计N-gram上的召回率,对于N-gram,可以计算得到ROUGE-N分数,计算公式如下:
其中,{参考译文}表示参考译文集合,在实际应用中参考译文可能是多个。
gramN表示N个字的组合,Count(gramN)表示计算译文中N-gram的数目。公式的分母是统计在所有的参考译文中N-gram的个数,而分子是统计所有参考译文与机器译文共有的N-gram个数。
本申请一些实施例中,该对话模型的训练方法还可以包括初始专业对话模型在PPL指标上的得分ScorePPL的计算过程,初始专业对话模型在PPL指标上的得分ScorePPL的计算过程:
其中,P(xi|x1,x2,…,xi-1)表示根据上文词语预测第i个词的概率,N代表句子长度。
PPL指的是语言模型中的perplexity,困惑度(Perplexity)是衡量一句话是否通顺的指标。定义为:
其中,P(xi|x1,x2,…,xi-1)表示根据上文词语预测第i个词的概率,N代表句子长度。PPL值越小,说明模型生成的回复越自然、语句越通顺。通过PPL来评价回复质量,可以避免模型生成的回复有乱序、前后颠倒的情形。
本申请一些实施例中,该方法还可以包括初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程,初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程包括:
通过以下公式计算初始专业对话模型在DISTINCT指标上的得分Scoredistinct
其中,Count(unique ngram)表示回复中不重复的ngram数量,Count(word)表示回复中ngram词语的总数量。
Distinct评价指标判断机器回复的多样性,Distinct指标判断是否出现大量的通用性、重复性回复。Distinct的定义如下:
其中,Count(unique ngram)表示回复中不重复的ngram数量,Count(word)表示回复中ngram词语的总数量。Count(unique ngram)越大表示生成回复的多样性越高。
S205:判断验证得分是否大于预设得分阈值,若验证得分大于预设得分阈值,则执行步骤S106,若验证得分不大于预设得分阈值,则执行步骤S207。
S206:将初始专业对话模型确定为目标专业对话模型。
S207:利用初始专业对话模型针对预设未标记池中各样本数据生成对应的响应数据。
当确定验证得分小于等于预设得分阈值时,说明需要对模型进行继续训练,利用初始专业对话模型G0针对预设未标记池中各样本数据生成对应的响应数据。
S208:分别计算各响应数据对应的自动评估得分。
在利用初始专业对话模型针对预设未标记池中各样本数据生成对应的响应数据之后,分别计算各响应数据对应的自动评估得分。如可以根据PPL指标和Distinct指标计算各响应数据对应的自动评估得分,计算公式如下:
从而得到每个响应数据分别对应的自动评估得分。
S209:对各自动评估得分进行大小排序,从得分较小的一端选取预设数量个自动评估得分。
在分别计算得到各响应数据对应的自动评估得分之后,对各自动评估得分进行大小排序,从得分较小的一端选取预设数量个自动评估得分,如选择最低的N个ScoreU得分。
S210:输出对选取得到的各自动评估得分对应的响应数据进行标注的标注提示信息。
在从得分较小的一端选取预设数量个自动评估得分之后,输出对选取得到的各自动评估得分对应的响应数据进行标注的标注提示信息,从而提示对最低的N个ScoreU得分对应的响应数据进行专家标注。
S211:根据标注结果对初始标注数据集进行更新,得到更新后标注数据集。
在输出对选取得到的各自动评估得分对应的响应数据进行标注的标注提示信息之后,获取标注结果,根据标注结果对初始标注数据集进行更新,得到更新后标注数据集,从而实现对当前专业对话模型生成响应数据效果不好的数据的有效标注。
本申请一些实施例中,在步骤S211之后,该对话模型的训练方法还可以包括以下步骤:
根据更新后标注数据集对预设未标记池进行更新操作。
在得到更新后标注数据集之后,根据更新后标注数据集对预设未标记池进行更新操作,从而实现对预设未标记池中未标记样本数据的及时更新。
S212:基于更新后标注数据集对初始专业对话模型进行训练,得到更新后专业对话模型。
在根据标注结果对初始标注数据集进行更新,得到更新后标注数据集之后,基于更新后标注数据集对初始专业对话模型进行训练,得到更新后专业对话模型。
本申请实施例通过采用主动学习的方式,尽可能减少了专家标注样本量,降低了对模型性能的影响。不断从预设未标记池中选择对模型性能提升最大的“困难样本”,提升了模型性能。
S213:利用验证数据集对更新后专业对话模型进行验证操作,得到验证得分,并返回执行步骤S205。
在基于更新后标注数据集对初始专业对话模型进行训练,得到更新后专业对话模型之后,利用验证数据集对更新后专业对话模型进行验证操作,得到验证得分,并返回执行判断验证得分是否大于预设得分阈值的步骤,如此往复直到计算得到的验证得分大于预设得分阈值,从而得到能够对接收到的提问语音进行良好响应的目标专业对话模型。
参见图3,图3为本申请实施例中一种对话响应方法的实施流程图,应用于包含如前训练得到的目标专业对话模型的对话系统,该方法可以包括以下步骤:
S301:接收待响应的目标提问语音。
当用户需要进行情景对话时,向对话响应控制中心输出目标提问语音,对话响应控制中心接收待响应的目标提问语音。
对话响应控制中心可以为部署有对话模型的处理器。
目标提问语音可以为闲聊、常识问答以及专业问答等。
S302:利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音。
预先训练通用对话模型,如可以基于大模型在通用对话数据集上进行模型训练,获得通用对话模型,其中大模型可以是基于Transformer结构,适用于生成任务,诸如GPT(Generative Pre-Training)模型、BERT(Bidirectional Encoder Representation from Transformers)模型等。再基于通用对话模型训练得到目标专业对话模型。在接收到待响应的目标提问语音之后,利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音。
通过在大模型的基础上进行再训练,大大减少了对数据量和计算力的需求,并且采用两阶段训练模型方式,使得训练出来的目标专业对话模型同时拥有通用性和专业性。
S303:对目标响应语音进行输出操作。
在利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音之后,对目标响应语音进行输出操作,从而实现对目标提问语音的响应。
由于模型训练过程相较于模型应用过程需要较多的资源,因此可以预先为模型训练过程分配较多的资源,为模型应用过程分配相对较少的资源。如可以预先划分8块及以上80G大小的GPU(Graphics Processing Unit,图像处理器)用于进行模型训练,划分1块及以上 80G大小的GPU用于模型应用。
由上述技术方案可知,通过预先基于通用对话模型训练得到应用于特定对话场景的目标专业对话模型,大大减少了对数据量和计算力的需求,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。
本申请一些实施例中,该对话响应方法还可以包括以下步骤:
步骤一:当目标专业对话模型对目标提问语音响应失败时,基于预设检索算法从数据库中搜索相关答案;
步骤二:对相关答案进行语音输出。
为方便描述,可以将上述两个步骤结合起来进行说明。
本申请实施例预先设置兜底方案,利用专业数据集构建专业数据库,当目标专业对话模型对目标提问语音响应失败时,即当目标专业对话模型输出为空时,基于预设检索算法从数据库中搜索相关答案,对相关答案进行语音输出。从而优化专业对话模型应用流程,进一步保证用户提问语音不会落空,提升用户体验。
相应于上面的方法实施例,本申请还提供了一种对话模型的训练装置,下文描述的对话模型的训练装置与上文描述的对话模型的训练方法可相互对应参照。
参见图4,图4为本申请实施例中一种对话模型的训练装置的结构框图,该对话模型的训练装置可以包括:
通用对话模型获得模块41,用于利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;
初始标注数据集确定模块42,用于获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;
初始专业对话模型获得模块43,用于利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;
验证得分获得模块44,用于利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分;
判断模块45,用于判断验证得分是否大于预设得分阈值;
目标专业对话模型确定模块46,用于当验证得分大于预设得分阈值时,将初始专业对话模型确定为目标专业对话模型。
由上述技术方案可知,通过预先基于通用对话模型训练得到应用于特定对话场景的目标专业对话模型,大大减少了对数据量和计算力的需求,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。
本申请一些实施例中,该对话模型的训练装置还可以包括:
响应数据生成模块,用于当确定验证得分小于等于预设得分阈值时,利用初始专业对话模型针对预设未标记池中各样本数据生成对应的响应数据;
自动评估得分计算模块,用于分别计算各响应数据对应的自动评估得分;
自动评估得分选取模块,用于对各自动评估得分进行大小排序,从得分较小的一端选取预设数量个自动评估得分;
标注提示信息输出模块,用于输出对选取得到的各自动评估得分对应的响应数据进行标注的标注提示信息;
标注数据集更新模块,用于根据标注结果对初始标注数据集进行更新,得到更新后标注数据集;
专业对话模型更新模块,用于基于更新后标注数据集对初始专业对话模型进行训练,得到更新后专业对话模型;
重复执行模块,用于利用验证数据集对更新后专业对话模型进行验证操作,得到验证得分,并重复执行判断验证得分是否大于预设得分阈值的步骤。
本申请一些实施例中,该对话模型的训练装置还可以包括:
未标记池更新模块,用于在得到更新后标注数据集之后,根据更新后标注数据集对预设未标记池进行更新操作。
本申请一些实施例中,验证得分获得模块44,具体用于通过以下公式结合验证数据集、BLEU指标、ROUGE指标、PPL指标、DISTINCT指标对初始专业对话模型进行验证操作:
其中,ScoreBLEU为初始专业对话模型在BLEU指标上的得分,ScoreROUGE为初始专业对话模型在ROUGE指标上的得分,ScorePPL为初始专业对话模型在PPL指标上的得分,采用PPL指标得分的倒数形式,Scoredistinct为初始专业对话模型在DISTINCT指标上的得分,Scoreval为验证得分。
本申请一些实施例中,该对话模型的训练装置还可以包括:
BLEU指标上的得分计算模块,用于通过以下公式计算初始专业对话模型在BLEU指标上的得分ScoreBLEU
其中,lc为机器译文的长度,lr为最短的参考翻译句子的长度,Pn为n-gram的精确率,Wn为n-gram的权重,对于任意n都有Wn=1/N,BP为惩罚因子。
本申请一些实施例中,该对话模型的训练装置还可以包括:
ROUGE指标上的得分计算模块,用于通过以下公式计算初始专业对话模型在ROUGE 指标上的得分ScoreROUGE
其中,{参考译文}表示参考译文集合,gramN表示N个字的组合,Count(gramN)表示计算译文中N-gram的数目,公式的分母是统计在所有的参考译文中N-gram的个数,分子是统计所有参考译文与机器译文共有的N-gram个数。
本申请一些实施例中,该对话模型的训练装置还可以包括:
PPL指标上的得分计算模块,用于通过以下公式计算初始专业对话模型在PPL指标上的得分ScorePPL
其中,P(xi|x1,x2,…,xi-1)表示根据上文词语预测第i个词的概率,N代表句子长度。
本申请一些实施例中,该对话模型的训练装置还可以包括:
DISTINCT指标上的得分计算模块,用于通过以下公式计算初始专业对话模型在DISTINCT指标上的得分Scoredistinct
其中,Count(unique ngram)表示回复中不重复的ngram数量,Count(word)表示回复中ngram词语的总数量。
本申请一些实施例中,该对话模型的训练装置还可以包括:
数据过滤模块,用于在利用预获取的通用对话数据集对原始对话模型进行训练之前,分别对通用对话数据集中的问答数据和闲聊数据进行过滤。
本申请一些实施例中,通用对话模型获得模块41包括:
迭代训练子模块,用于将通用对话数据集输入至原始对话模型进行模型迭代训练;
损失标准差获取子模块,用于获取当前迭代数和本轮迭代训练得到的损失标准差;
训练截止判断子模块,用于根据当前迭代数和损失标准差确定是否达到模型训练截止条件;
通用对话模型确定子模块,用于当根据当前迭代数和损失标准差确定达到模型训练截止条件时,将本轮迭代训练得到的对话模型确定为通用对话模型。
本申请一些实施例中,训练截止判断子模块具体为判断当前迭代数是否大于第一预设值且损失标准差小于第二预设值的模块。
本申请一些实施例中,该对话模型的训练装置还可以包括:
迭代数统计子模块,用于当确定当前迭代数大于第一预设值且损失标准差大于等于第二预设值时,判断当前迭代数是否大于第三预设值;其中,第三预设值大于第一预设值;
通用对话模型确定子模块,还用于当当前迭代数大于第三预设值时,将本轮迭代训练得到的对话模型确定为通用对话模型;
迭代训练子模块,还用于当当前迭代数小于等于第三预设值时,将通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并重复执行获取当前迭代数和本轮迭代训练得到的损失标准差的步骤。
本申请一些实施例中,初始标注数据集确定模块42具体为利用DFA算法根据专业关键词组对通用对话数据集进行数据筛选的模块。
相应于上面的方法实施例,本申请还提供了一种对话响应装置,下文描述的对话响应装置与上文描述的对话响应方法可相互对应参照。
参见图5,图5为本申请实施例中一种对话响应装置的结构框图,该对话响应装置可以包括:
提问语音接收模块51,用于接收待响应的目标提问语音;
响应语音生成模块52,用于利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音;
响应语音输出模块53,用于对目标响应语音进行输出操作。
由上述技术方案可知,通过预先基于通用对话模型训练得到应用于特定对话场景的目标专业对话模型,大大减少了对数据量和计算力的需求,使得训练出来的目标专业对话模型同时拥有通用性和专业性,提升了用户使用体验。
本申请一些实施例中,该对话响应装置还可以包括:
答案搜索模块,用于当目标专业对话模型对目标提问语音响应失败时,基于预设检索算法从数据库中搜索相关答案;
语音输出模块,用于对相关答案进行语音输出。
相应于上面的方法实施例,参见图6,图6为本申请所提供的电子设备的示意图,该设备可以包括:
存储器332,用于存储计算机程序;
处理器322,用于执行计算机程序时实现上述方法实施例的对话模型的训练方法或对话响应方法的步骤。
具体的,请参考图7,图7为本申请实施例提供的一种电子设备的具体结构示意图,该电 子设备可因配置或性能不同而产生比较大的差异,可以包括处理器(central processing units,CPU)322(例如,一个或一个以上处理器)和存储器332,存储器332存储有一个或一个以上的计算机程序342或数据344。其中,存储器332可以是短暂存储或持久存储。存储在存储器332的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对数据处理设备中的一系列指令操作。更进一步地,处理器322可以设置为与存储器332通信,在电子设备301上执行存储器332中的一系列指令操作。
电子设备301还可以包括一个或一个以上电源326,一个或一个以上有线或无线网络接口350,一个或一个以上输入输出接口358,和/或,一个或一个以上操作系统341。
上文所描述的对话响应方法中的步骤可以由电子设备的结构实现。
相应于上面的方法实施例,本申请还提供一种非易失性可读存储介质,非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时可实现如下步骤:
利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;获取预设的专业关键词组,并根据专业关键词组对通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;利用初始标注数据集对通用对话模型进行训练,得到初始专业对话模型;利用验证数据集和预设自然语言处理评价指标对初始专业对话模型进行验证操作,得到验证得分;判断验证得分是否大于预设得分阈值;若验证得分大于预设得分阈值,则将初始专业对话模型确定为目标专业对话模型;
或,
接收待响应的目标提问语音;利用基于对通用对话模型训练得到的目标专业对话模型生成目标提问语音对应的目标响应语音;对目标响应语音进行输出操作。
该非易失性可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
对于本申请提供的存储介质的介绍请参照上述方法实施例,本申请在此不做赘述。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置、电子设备及存储介质而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的技术方案及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。

Claims (20)

  1. 一种对话模型的训练方法,其特征在于,包括:
    利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;
    获取预设的专业关键词组,并根据所述专业关键词组对所述通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;
    利用所述初始标注数据集对所述通用对话模型进行训练,得到初始专业对话模型;
    利用验证数据集和预设自然语言处理评价指标对所述初始专业对话模型进行验证操作,得到验证得分;
    判断所述验证得分是否大于预设得分阈值;
    若所述验证得分大于所述预设得分阈值,则将所述初始专业对话模型确定为目标专业对话模型。
  2. 根据权利要求1所述的对话模型的训练方法,其特征在于,当确定所述验证得分小于等于所述预设得分阈值时,还包括:
    利用所述初始专业对话模型针对预设未标记池中各样本数据生成对应的响应数据;
    分别计算各所述响应数据对应的自动评估得分;
    对各所述自动评估得分进行大小排序,从得分较小的一端选取预设数量个自动评估得分;
    输出对选取得到的各所述自动评估得分对应的响应数据进行标注的标注提示信息;
    根据标注结果对初始标注数据集进行更新,得到更新后标注数据集;
    基于所述更新后标注数据集对所述初始专业对话模型进行训练,得到更新后专业对话模型;
    利用所述验证数据集对所述更新后专业对话模型进行验证操作,得到验证得分,并重复执行所述判断所述验证得分是否大于预设得分阈值的步骤。
  3. 根据权利要求2所述的对话模型的训练方法,其特征在于,在得到更新后标注数据集之后,还包括:
    根据所述更新后标注数据集对所述预设未标记池进行更新操作。
  4. 根据权利要求1所述的对话模型的训练方法,其特征在于,利用验证数据集和预设自然语言处理评价指标对所述初始专业对话模型进行验证操作,包括:
    通过以下公式结合所述验证数据集、BLEU指标、ROUGE指标、PPL指标、DISTINCT指标对所述初始专业对话模型进行验证操作:
    其中,ScoreBLEU为所述初始专业对话模型在BLEU指标上的得分,ScoreROUGE为所述初始专业对话模型在ROUGE指标上的得分,ScorePPL为所述初始专业对话模型在PPL指标上的得分,采用PPL指标得分的倒数形式, Scoredistinct为所述初始专业对话模型在DISTINCT指标上的得分,Scoreval为验证得分。
  5. 根据权利要求4所述的对话模型的训练方法,其特征在于,还包括所述初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程,所述初始专业对话模型在BLEU指标上的得分ScoreBLEU的计算过程包括:
    通过以下公式计算所述初始专业对话模型在BLEU指标上的得分ScoreBLEU
    其中,lc为机器译文的长度,lr为最短的参考翻译句子的长度,Pn为n-gram的精确率,Wn为n-gram的权重,对于任意n都有Wn=1/N,BP为惩罚因子。
  6. 根据权利要求4所述的对话模型的训练方法,其特征在于,还包括所述初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程,所述初始专业对话模型在ROUGE指标上的得分ScoreROUGE的计算过程包括:
    通过以下公式计算所述初始专业对话模型在ROUGE指标上的得分ScoreROUGE
    其中,{参考译文}表示参考译文集合,gramN表示N个字的组合,Count(gramN)表示计算译文中N-gram的数目,公式的分母是统计在所有的参考译文中N-gram的个数,分子是统计所有参考译文与机器译文共有的N-gram个数。
  7. 根据权利要求4所述的对话模型的训练方法,其特征在于,还包括所述初始专业对话模型在PPL指标上的得分ScorePPL的计算过程,所述初始专业对话模型在PPL 指标上的得分ScorePPL的计算过程:
    其中,P(xi|x1,x2,…,xi-1)表示根据上文词语预测第i个词的概率,N代表句子长度。
  8. 根据权利要求4所述的对话模型的训练方法,其特征在于,还包括所述初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程,所述初始专业对话模型在DISTINCT指标上的得分Scoredistinct的计算过程包括:
    通过以下公式计算所述初始专业对话模型在DISTINCT指标上的得分Scoredistinct
    其中,Count(unique ngram)表示回复中不重复的ngram数量,Count(word)表示回复中ngram词语的总数量。
  9. 根据权利要求1所述的对话模型的训练方法,其特征在于,在利用预获取的通用对话数据集对原始对话模型进行训练之前,还包括:
    分别对所述通用对话数据集中的问答数据和闲聊数据进行过滤。
  10. 根据权利要求1所述的对话模型的训练方法,其特征在于,利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型,包括:
    将所述通用对话数据集输入至所述原始对话模型进行模型迭代训练;
    获取当前迭代数和本轮迭代训练得到的损失标准差;
    根据所述当前迭代数和所述损失标准差确定是否达到模型训练截止条件;
    若达到模型训练截止条件,则将本轮迭代训练得到的对话模型确定为所述通用对话模型。
  11. 根据权利要求10所述的对话模型的训练方法,其特征在于,根据所述当前迭代数和所述损失标准差确定是否达到模型训练截止条件,包括:
    判断所述当前迭代数是否大于第一预设值且所述损失标准差小于第二预设值。
  12. 根据权利要求11所述的对话模型的训练方法,其特征在于,当确定所述当前迭 代数大于所述第一预设值且所述损失标准差大于等于所述第二预设值时,还包括:
    判断所述当前迭代数是否大于第三预设值;其中,所述第三预设值大于所述第一预设值;
    若所述当前迭代数大于第三预设值,则执行所述将本轮迭代训练得到的对话模型确定为所述通用对话模型的步骤;
    若所述当前迭代数不大于第三预设值,则将所述通用对话数据集输入至本轮迭代训练得到的对话模型进行模型迭代训练,并重复执行所述获取当前迭代数和本轮迭代训练得到的损失标准差的步骤。
  13. 根据权利要求1所述的对话模型的训练方法,其特征在于,根据所述专业关键词组对所述通用对话数据集进行数据筛选,包括:
    利用DFA算法根据所述专业关键词组对所述通用对话数据集进行数据筛选。
  14. 根据权利要求13所述的对话模型的训练方法,其特征在于,利用DFA算法根据所述专业关键词组对所述通用对话数据集进行数据筛选,包括:
    获取专业关键词组;
    将所述专业关键词组通过建立嵌套字典的方式构建专业词链表;
    遍历所述通用对话数据集中的每组对话,将每组对话作为输入遍历所述专业词链表,筛选出包含专业关键词的对话。
  15. 一种对话响应方法,其特征在于,应用于包含如权利要求1至14任一项训练得到的目标专业对话模型的对话系统,包括:
    接收待响应的目标提问语音;
    利用基于对通用对话模型训练得到的目标专业对话模型生成所述目标提问语音对应的目标响应语音;
    对所述目标响应语音进行输出操作。
  16. 根据权利要求15所述的对话响应方法,其特征在于,还包括:
    当所述目标专业对话模型对所述目标提问语音响应失败时,基于预设检索算法从数据库中搜索相关答案;
    对所述相关答案进行语音输出。
  17. 一种对话模型的训练装置,其特征在于,包括:
    通用对话模型获得模块,用于利用预获取的通用对话数据集对原始对话模型进行训练,得到通用对话模型;
    初始标注数据集确定模块,用于获取预设的专业关键词组,并根据所述专业关键词组对所述通用对话数据集进行数据筛选,将筛选得到的数据集确定为初始标注数据集;
    初始专业对话模型获得模块,用于利用所述初始标注数据集对所述通用对话模型进行训练,得到初始专业对话模型;
    验证得分获得模块,用于利用验证数据集和预设自然语言处理评价指标对所述初始专业对话模型进行验证操作,得到验证得分;
    判断模块,用于判断所述验证得分是否大于预设得分阈值;
    目标专业对话模型确定模块,用于当所述验证得分大于预设得分阈值时,将所述初始专业对话模型确定为目标专业对话模型。
  18. 一种对话响应装置,其特征在于,包括:
    提问语音接收模块,用于接收待响应的目标提问语音;
    响应语音生成模块,用于利用基于对通用对话模型训练得到的目标专业对话模型生成所述目标提问语音对应的目标响应语音;
    响应语音输出模块,用于对所述目标响应语音进行输出操作。
  19. 一种电子设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至14任一项所述对话模型的训练方法或权利要求15至16任一项所述对话响应方法的步骤。
  20. 一种非易失性可读存储介质,其特征在于,所述非易失性可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至14任一项所述对话模型的训练方法或权利要求15至16任一项所述对话响应方法的步骤。
PCT/CN2023/086071 2022-11-17 2023-04-04 一种对话模型的训练方法及装置、对话响应方法及装置 Ceased WO2024103609A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211441290.4 2022-11-17
CN202211441290.4A CN115495568B (zh) 2022-11-17 2022-11-17 一种对话模型的训练方法及装置、对话响应方法及装置

Publications (1)

Publication Number Publication Date
WO2024103609A1 true WO2024103609A1 (zh) 2024-05-23

Family

ID=85116091

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/086071 Ceased WO2024103609A1 (zh) 2022-11-17 2023-04-04 一种对话模型的训练方法及装置、对话响应方法及装置

Country Status (2)

Country Link
CN (1) CN115495568B (zh)
WO (1) WO2024103609A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118536542A (zh) * 2024-07-25 2024-08-23 杭州心智医联科技有限公司 一种图神经网络最优架构构建方法及系统
CN120162796A (zh) * 2025-03-11 2025-06-17 北京奇虎科技有限公司 风险检测方法、装置、设备、存储介质及产品
CN120525487A (zh) * 2025-05-09 2025-08-22 安徽省数字江淮中心 项目评分方法、装置、电子设备和存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115495568B (zh) * 2022-11-17 2023-08-22 苏州浪潮智能科技有限公司 一种对话模型的训练方法及装置、对话响应方法及装置
CN116127035B (zh) * 2023-01-03 2023-12-08 北京百度网讯科技有限公司 对话方法、对话模型的训练方法及装置
CN116432665B (zh) * 2023-06-15 2023-10-10 北京中关村科金技术有限公司 对话模型构建方法、文本生成方法、装置、系统及设备
TWI843624B (zh) * 2023-07-10 2024-05-21 亞太智能機器股份有限公司 機器閱讀理解方法及機器閱讀理解系統
CN116992283A (zh) * 2023-07-21 2023-11-03 深圳复临科技有限公司 语言模型动态更新方法、装置、电子设备及存储介质
CN117312844A (zh) * 2023-08-28 2023-12-29 合肥马道信息科技有限公司 一种定制化客服机器人模型的训练方法
CN117828063B (zh) * 2024-01-10 2024-05-17 广东数业智能科技有限公司 一种心理领域数据生成、模型训练方法、装置及存储介质
CN119092087B (zh) * 2024-08-28 2025-12-16 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) 一种基于消化内镜的大型语言和视觉助手的辅助检查方法
CN119539006A (zh) * 2024-11-12 2025-02-28 北京沐言智语科技有限公司 一种虚拟人物训练数据生成方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897797A (zh) * 2018-06-12 2018-11-27 腾讯科技(深圳)有限公司 对话模型的更新训练方法、装置、存储介质及电子设备
CN110188331A (zh) * 2019-06-03 2019-08-30 腾讯科技(深圳)有限公司 模型训练方法、对话系统评价方法、装置、设备及存储介质
US20210303555A1 (en) * 2020-03-30 2021-09-30 Adobe Inc. Utilizing logical-form dialogue generation for multi-turn construction of paired natural language queries and query-language representations
CN114968788A (zh) * 2022-05-27 2022-08-30 浙江大学 人工智能算法编程能力自动评估方法、装置、介质及设备
CN115495568A (zh) * 2022-11-17 2022-12-20 苏州浪潮智能科技有限公司 一种对话模型的训练方法及装置、对话响应方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11264009B2 (en) * 2019-09-13 2022-03-01 Mitsubishi Electric Research Laboratories, Inc. System and method for a dialogue response generation system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897797A (zh) * 2018-06-12 2018-11-27 腾讯科技(深圳)有限公司 对话模型的更新训练方法、装置、存储介质及电子设备
CN110188331A (zh) * 2019-06-03 2019-08-30 腾讯科技(深圳)有限公司 模型训练方法、对话系统评价方法、装置、设备及存储介质
US20210303555A1 (en) * 2020-03-30 2021-09-30 Adobe Inc. Utilizing logical-form dialogue generation for multi-turn construction of paired natural language queries and query-language representations
CN114968788A (zh) * 2022-05-27 2022-08-30 浙江大学 人工智能算法编程能力自动评估方法、装置、介质及设备
CN115495568A (zh) * 2022-11-17 2022-12-20 苏州浪潮智能科技有限公司 一种对话模型的训练方法及装置、对话响应方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118536542A (zh) * 2024-07-25 2024-08-23 杭州心智医联科技有限公司 一种图神经网络最优架构构建方法及系统
CN120162796A (zh) * 2025-03-11 2025-06-17 北京奇虎科技有限公司 风险检测方法、装置、设备、存储介质及产品
CN120525487A (zh) * 2025-05-09 2025-08-22 安徽省数字江淮中心 项目评分方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN115495568B (zh) 2023-08-22
CN115495568A (zh) 2022-12-20

Similar Documents

Publication Publication Date Title
WO2024103609A1 (zh) 一种对话模型的训练方法及装置、对话响应方法及装置
Chao et al. Emerging Technologies of Natural Language‐Enabled Chatbots: A Review and Trend Forecast Using Intelligent Ontology Extraction and Patent Analytics
CN108962224B (zh) 口语理解和语言模型联合建模方法、对话方法及系统
CN107944027B (zh) 创建语义键索引的方法及系统
CN111090727B (zh) 语言转换处理方法、装置及方言语音交互系统
WO2022252636A1 (zh) 基于人工智能的回答生成方法、装置、设备及存储介质
JP2023535709A (ja) 言語表現モデルシステム、事前訓練方法、装置、機器及び媒体
TW202009749A (zh) 人機對話方法、裝置、電子設備及電腦可讀媒體
CN112799747A (zh) 智能助理评价、推荐方法、系统、终端及可读存储介质
CN112633010A (zh) 基于多头注意力和图卷积网络的方面级情感分析方法及系统
CN110188362A (zh) 文本处理方法及装置
CN108846138B (zh) 一种融合答案信息的问题分类模型构建方法、装置和介质
CN105608218A (zh) 智能问答知识库的建立方法、建立装置及建立系统
CN110069612B (zh) 一种回复生成方法及装置
JP2017010528A (ja) 意味情報生成方法、意味情報生成装置、およびプログラム
CN106202010A (zh) 基于深度神经网络构建法律文本语法树的方法和装置
CN101075435A (zh) 一种智能聊天系统及其实现方法
WO2020191828A1 (zh) 基于图的上下文关联回复生成方法、计算机及介质
WO2023040493A1 (zh) 事件检测
WO2024066920A1 (zh) 虚拟场景的对话方法、装置、电子设备、计算机程序产品及计算机存储介质
CN110555203A (zh) 文本复述方法、装置、服务器及存储介质
US20250117714A1 (en) Method for generating text training sample based on large model, and electronic device
CN110245349B (zh) 一种句法依存分析方法、装置及一种电子设备
CN114791950A (zh) 基于词性位置与图卷积网络的方面级情感分类方法及装置
CN106294460A (zh) 一种基于字和词混合语言模型的汉语语音关键词检索方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23890054

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23890054

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 23890054

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.10.2025)