Training data construction method and device for multi-round dialogue model and electronic equipment
By classifying and processing the dialogue data in the educational scenario in the multi-turn dialogue model, the problem of insufficient generalization ability of the existing technology in the educational scenario is solved, and a higher quality dialogue experience and understanding of user needs are achieved.
Patent Information
- Application Number
- CN202410720575.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
AI Technical Summary
Existing multi-turn dialogue training data construction methods have insufficient generalization capabilities and adaptability in educational scenarios, making it difficult to provide a stable and high-quality dialogue experience. In particular, the complexity and diversity of dialogues prevent the model from effectively processing it in practical applications. Complex multi-turn dialogue tasks.
By obtaining dialogue data in educational scenarios, different processing branches are entered according to the length of questions in the continued dialogue, and keywords, grammatical structures and contextual relationships are used for classification, and classification training data is generated for multi-round dialogue model training to enhance the model's Ability to understand user needs and provide personalized responses.
By comprehensively considering multiple factors to classify dialogue data in educational scenarios, more accurate training data can be constructed so that the model can better understand user needs, provide higher-quality answers and better user experience, and improve teaching effects.
Smart Images

Figure CN118569337A
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of artificial intelligence technology, and in particular, to a method, device, and electronic device for constructing training data for a multi-round dialogue model. Background Art
[0002] In the field of artificial intelligence, especially in the development of natural language processing (NLP) technology, the application of large models in multi-round dialogue scenarios has become a hot topic in research and practice. The core of multi-round dialogue technology is to enable the model to understand and adapt to the user's intentions and context through continuous interaction, thereby providing more accurate and personalized responses.
[0003] At present, the technology for constructing multi-round dialogue training data mainly relies on rule-driven methods and supervised learning based on a small amount of labeled data. However, in educational scenarios, due to the complexity and diversity of dialogues, the above methods lack generalization and adaptability in practical applications, making it difficult to provide a stable and high-quality dialogue experience. Summary of the invention
[0004] In view of this, one or more embodiments of the present specification provide a method, device, and electronic device for constructing training data for a multi-round dialogue model to construct training data for a multi-round dialogue model that meets the diverse needs of users in educational scenarios.
[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a method for constructing training data for a multi-round dialogue model is proposed, including:
[0007] Obtain conversation data in educational scenarios;
[0008] In the case where the dialogue data is multi-round dialogue data, if the length of the question asked in the subsequent dialogue is less than the first set threshold, enter the first processing branch, otherwise enter the second processing branch;
[0009] In the first processing branch, a classification result of the subsequent dialogue is obtained according to the keywords contained in the question; in the second processing branch, a classification result of the subsequent dialogue is obtained according to the grammatical structure of the question, the contextual relationship between the question and the previous answer, and the keywords contained therein;
[0010] Determining the classification result of the dialogue data according to the classification result of the subsequent dialogue round;
[0011] Classification training data is obtained according to the classification result, and the classification training data is used to train the multi-round dialogue model under the corresponding category.
[0012] In some embodiments, obtaining the classification result of the subsequent dialogue according to the first set keyword included in the question includes:
[0013] In the case where the keyword includes a word representing a requirement for repetition, determining that the classification result indicates a category of requirement for restatement;
[0014] In a case where the keyword includes a spoken response word, it is determined that the classification result indicates a meaningless spoken category.
[0015] In some embodiments, obtaining the classification result of the subsequent round of dialogue according to at least one of the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and the keywords included includes:
[0016] If the question contains subject, predicate and object components, enter the first sub-processing branch; otherwise, enter the second sub-processing branch;
[0017] In the first sub-processing branch, the questions are classified according to the keywords contained in the questions;
[0018] In the second sub-processing branch, the question is classified according to the contextual relationship between the question and the previous round of answers and the keywords contained therein.
[0019] In some embodiments, in the first sub-processing branch, classification is performed according to keywords contained in the question, including:
[0020] If the keyword includes a self-referential pronoun and a word representing evaluation, it is determined that the classification result indicates a user self-evaluation category; otherwise, it is determined that the classification result indicates a multi-round single question and answer category.
[0021] In some embodiments, in the second sub-processing branch, classification is performed according to the contextual relationship between the question and the previous round of answers and the keywords included, including:
[0022] If the repetition ratio between the question and the previous round of answers is higher than a second set threshold, determining that the classification result indicates a meaningless repetition category;
[0023] If the number of times the words or short sentences in the previous round of answers appear in the question meets the set requirements and the keywords include words representing the required description, then determining that the classification result indicates the detailed question category;
[0024] Otherwise, it is determined whether the keywords contain words representing evaluation, and if so, it is determined that the classification result indicates the evaluation model response category, otherwise it is determined that the classification result indicates the multi-round single question and answer category.
[0025] In some embodiments, the method further includes: when there are subsequent rounds of dialogue with different classification results in the dialogue data, taking the classification result with the largest number of occurrences as the classification result of the dialogue data.
[0026] In some embodiments, the method further includes: when the conversation data is single-round conversation data or multi-round single question-and-answer data, obtaining a classification result of the conversation data according to the type of question asked, the question type including at least one of knowledge point inquiry, homework help, and learning strategy.
[0027] According to a second aspect of one or more embodiments of this specification, a training data construction device for a multi-round dialogue model is proposed, including:
[0028] An acquisition unit, used to acquire conversation data in an educational scenario;
[0029] A judgment unit, configured to, when the dialogue data is multi-round dialogue data, enter a first processing branch if the length of the question asked in the subsequent dialogue is less than a first set threshold, otherwise enter a second processing branch;
[0030] a classification unit, configured to obtain, in the first processing branch, a classification result of the subsequent dialogue according to the keywords contained in the question; and, in the second processing branch, obtain a classification result of the subsequent dialogue according to the grammatical structure of the question, the contextual relationship between the question and the previous answer, and the keywords contained therein;
[0031] A determination unit, configured to determine a classification result of the dialogue data according to the classification result of the subsequent dialogue round;
[0032] A construction unit is used to obtain classification training data according to the classification result, and the classification training data is used to train the multi-round dialogue model under the corresponding category.
[0033] In some embodiments, the classification unit is specifically used to:
[0034] In the case where the keyword includes a word representing a requirement for repetition, determining that the classification result indicates a category of requirement for restatement;
[0035] In a case where the keyword includes a spoken response word, it is determined that the classification result indicates a meaningless spoken category.
[0036] In some embodiments, the classification unit is specifically used to:
[0037] If the question contains subject, predicate and object components, enter the first sub-processing branch; otherwise, enter the second sub-processing branch;
[0038] In the first sub-processing branch, the questions are classified according to the keywords contained in the questions;
[0039] In the second sub-processing branch, the question is classified according to the contextual relationship between the question and the previous round of answers and the keywords contained therein.
[0040] In some embodiments, when the classification unit is used to classify according to the keywords contained in the question, it is specifically used for:
[0041] If the keyword includes a self-referential pronoun and a word representing evaluation, it is determined that the classification result indicates a user self-evaluation category; otherwise, it is determined that the classification result indicates a multi-round single question and answer category.
[0042] In some embodiments, when the classification unit is used to classify the question according to the contextual relationship between the question and the previous round of answers and the keywords contained therein, it is specifically used to:
[0043] If the repetition ratio between the question and the previous round of answers is higher than a second set threshold, determining that the classification result indicates a meaningless repetition category;
[0044] If the number of times the words or short sentences in the previous round of answers appear in the question meets the set requirements and the keywords include words representing the required description, then determining that the classification result indicates the detailed question category;
[0045] Otherwise, it is determined whether the keywords contain words representing evaluation, and if so, it is determined that the classification result indicates the evaluation model response category, otherwise it is determined that the classification result indicates the multi-round single question and answer category.
[0046] In some embodiments, the apparatus further comprises an updating unit, configured to:
[0047] In the case where there are subsequent rounds of dialogue with different classification results in the dialogue data, the classification result with the largest number of occurrences is used as the classification result of the dialogue data.
[0048] In some embodiments, the apparatus further comprises a refinement unit configured to:
[0049] In the case that the dialogue data is single-round dialogue data or multi-round single question-and-answer data, a classification result of the dialogue data is obtained according to the type of question asked, and the question type includes at least one of knowledge point inquiry, homework help, and learning strategy.
[0050] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:
[0051] processor;
[0052] a memory for storing processor-executable instructions;
[0053] The processor implements the steps of the method proposed in the above embodiment by running the executable instructions.
[0054] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method provided in the above embodiment are implemented.
[0055] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is proposed, comprising a computer program / instruction, which implements the steps of the method proposed in the above embodiment when executed by a processor.
[0056] In the embodiments of the present specification, the conversation data in the educational scenario is first obtained. In the case of multiple rounds of conversation, different processing branches are entered according to the length of the questions in the subsequent rounds of conversation. In the first processing branch, the subsequent round of conversation is classified according to the first set keyword contained in the question; in the second processing branch, the subsequent round of conversation is classified according to the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and the keywords contained. Thereafter, based on the classification result of the subsequent round of conversation, the classification result of the acquired conversation data is determined, and based on the classification result, training data for training the multiple rounds of conversation model under the corresponding category is obtained. By comprehensively considering multiple factors to classify the conversation data in the educational scenario to obtain training data, the trained model can more accurately understand the specific needs of users in the educational scenario, provide higher quality answers, and thus provide better user experience and teaching effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flowchart of a method for constructing training data for a multi-round dialogue model according to an exemplary embodiment of this specification.
[0058] Figure 2 It is a schematic diagram of a method for constructing training data for a multi-round dialogue model according to an exemplary embodiment of this specification.
[0059] Figure 3 It is a schematic diagram of another method for constructing training data for a multi-round dialogue model according to an exemplary embodiment of the present specification.
[0060] Figure 4 It is a block diagram of a training data construction device for a multi-round dialogue model according to an exemplary embodiment of the present specification.
[0061] Figure 5 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of this specification. DETAILED DESCRIPTION
[0062] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0063] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0064] In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0065] In the field of artificial intelligence, especially in the development of natural language processing (NLP) technology, the application of large models in multi-round dialogue scenarios has become a hot topic in research and practice. The core of multi-round dialogue technology is to enable the model to understand and adapt to the user's intentions and context through continuous interaction, thereby providing more accurate and personalized responses.
[0066] At present, the technology for constructing multi-round dialogue training data mainly relies on rule-driven methods and supervised learning based on a small amount of labeled data. However, in educational scenarios, due to the complexity and diversity of dialogues, the above methods lack generalization and adaptability in practical applications, making it difficult to provide a stable and high-quality dialogue experience.
[0067] The specific reason is that the rule-driven method usually presets a series of dialogue modes and responses. Although this method is simple and easy to implement, it lacks flexibility and adaptability, and it is difficult to cope with the changing dialogue needs in educational scenarios. The supervised learning-based method, due to insufficient labeled data and lack of in-depth understanding of user behavior in educational scenarios, often leads to insufficient generalization ability of the model in practical applications and cannot effectively handle complex multi-round dialogue tasks.
[0068] In view of this, this specification implements a solution for constructing training data for a multi-round dialogue model to construct training data for a multi-round dialogue model that meets the diverse needs of users in educational scenarios. The multi-round dialogue model in an educational scenario can be used, for example, in an online education platform. Students can interact with the system through multi-round dialogues to get personalized learning guidance. Students may need help understanding complex math problems, seeking homework help, preparing for exams, guidance on learning strategies, and so on. For another example, a multi-round dialogue model can be used for career development consulting. Job seekers can obtain information about career planning, skill improvement, or industry trends through multi-round dialogues, which can help users make more informed career decisions. Figure 1 This is a flowchart of a method for constructing training data for a multi-round dialogue model according to an exemplary embodiment of this specification. The method may include:
[0069] Step 101: Obtain conversation data in an educational scenario.
[0070] By collecting a large number of question-answer pairs in educational scenarios and structuring them to ensure that each question-answer pair can clearly reflect the correspondence between the question and the answer, we can obtain conversation data.
[0071] In the embodiments of this specification, question-answer pairs in educational scenarios can be collected in the following ways:
[0072] Obtain question-answer pair data through public datasets;
[0073] Capture question-answer data from education-related websites, forums, platforms, etc.
[0074] Collect question-answer pair data through educational institutions, schools, or educational technology companies;
[0075] Professional question and answer sessions are provided by teachers, students or education experts;
[0076] Use natural language processing technology to extract question-answer pairs from educational text materials such as textbooks, academic papers, and educational blogs.
[0077] Those skilled in the art should understand that the above is merely an exemplary description of obtaining question-answer pairs in an educational scenario, and this specification does not limit the specific method of obtaining the pairs.
[0078] In this step, the acquired dialogue data can be single-round dialogue data or multi-round dialogue data. A single-round dialogue refers to a question-and-answer format, and the dialogue only involves the question and answer of the current round, not the previous answers; while a multi-round dialogue includes multiple questions and answers, and the multiple questions and answers are related or coherent.
[0079] Step 102: When the dialogue data is multi-round dialogue data, if the length of the question asked in the subsequent dialogue is less than a first set threshold, enter the first processing branch; otherwise, enter the second processing branch.
[0080] For dialogue data containing more than two question-answer pairs, it is determined whether the dialogue data is multi-round dialogue data.
[0081] For example, the judgment can be made through timestamps or dialogue identifiers. If the timestamps between multiple question-answer pairs are within a certain range, or the question-answer pairs have the same identifier, then these question-answer pairs are likely to belong to the same round of dialogue.
[0082] For another example, judgment can also be made by analyzing the contextual information between question-answer pairs, such as the topic of the question, semantic association, etc. If multiple question-answer pairs are consistent in topic or closely related in semantics, then these question-answer pairs are likely to belong to the same round of dialogue.
[0083] For another example, we can also make a judgment by analyzing whether the user's intention remains consistent in the conversation. If the user's intention remains unchanged in multiple question-answer pairs, then these questions and answers are likely to belong to the same round of conversation.
[0084] In multi-round dialogue data, the first round of dialogue can be called the first round of dialogue, and the following rounds of dialogue can be called the subsequent rounds of dialogue. Each round of dialogue contains a question (also called a question, from the user) and an answer (also called an answer, from the model).
[0085] In this step, for each group of follow-up dialogues in the acquired multi-round dialogue data, the length of the questions in the follow-up dialogue is determined. The length usually refers to the number of words contained in the question, and punctuation marks are also counted. When the length of the question is less than the first set threshold, the first processing branch is entered, otherwise the second processing branch is entered. That is, for each group of follow-up dialogues, the corresponding processing flow is entered according to the length of the question to obtain the classification result. Through statistical analysis of question and answer pairs in educational scenarios, it is found that setting the first set threshold to 7 can achieve better performance. Those skilled in the art should understand that the first set threshold can be determined according to actual needs, and this specification does not limit the specific number.
[0086] Step 103: In the first processing branch, a classification result of the subsequent dialogue is obtained based on the keywords contained in the question; in the second processing branch, a classification result of the subsequent dialogue is obtained based on the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and at least one of the keywords contained.
[0087] In the first processing branch, keywords can be extracted from the question, and the keywords contained can be compared with some set words to classify the subsequent dialogue according to whether there are keywords matching these set words. Since the number of words in the question is small in this processing branch, and the types of questions and answers that can be involved in the educational scenario are also small, the classification of the subsequent dialogue can be achieved by judging whether the question contains some keywords matching the set words, and obtaining the classification result.
[0088] In the second branch, when the number of words in the question is large, the types of questions and answers involved increase. Therefore, the grammatical structure of the question, the contextual relationship between the question and the previous round of answers, and the keywords included are comprehensively considered to classify the subsequent round of dialogue and obtain the classification result.
[0089] Specifically, different sub-processing branches may be entered according to the grammatical structure of the question, and in different sub-processing branches, classification may be performed in combination with keywords, or in combination with keywords and the contextual relationship between the question and the previous round of answers.
[0090] Step 104: Determine the classification result of the dialogue data according to the classification result of the subsequent dialogue round.
[0091] For multi-round dialogue data, the classification result of the multi-round dialogue data can be determined according to the classification result of the subsequent dialogue. For example, if a multi-round dialogue data includes a subsequent dialogue whose classification result is "details questioning", the classification result of the multi-round dialogue data can be determined as "details questioning".
[0092] Step 105: Obtain classification training data according to the classification result, wherein the classification training data is used to train the multi-round dialogue model under the corresponding category.
[0093] When the classification results of a plurality of rounds of dialogue data are determined, the plurality of rounds of dialogue data may be used as classification training data to train a plurality of rounds of dialogue model under the category.
[0094] For the large amount of dialogue data obtained in educational scenarios, by aggregating the dialogue data of the same classification result, a training data set of this category can be obtained. The multi-turn dialogue model can be trained with the training data set to enhance the dialogue performance and effect of the multi-turn dialogue model in this category.
[0095] For example, by aggregating the conversation data classified as "questioning for details" from the large amount of conversation data obtained, and using the obtained training data set to train the model, the detail-questioning capability of the multi-round conversation model will be improved, and answers that better meet the user's questions about details can be provided.
[0096] In the embodiments of the present specification, firstly, the dialogue data in the educational scenario is obtained. In the case of multiple rounds of dialogue, different processing branches are entered according to the length of the questions in the subsequent rounds of dialogue. In the first processing branch, the subsequent round of dialogue is classified according to the first set keywords contained in the question; in the second processing branch, the subsequent round of dialogue is classified according to the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and at least one of the second set keywords contained. Then, according to the classification result of the subsequent round of dialogue, the classification result of the acquired dialogue data is determined, and according to the classification result, the training data for training the multi-round dialogue model under the corresponding category is obtained. By comprehensively considering multiple factors to classify the dialogue data in the educational scenario to obtain training data, the trained model can more accurately understand the specific needs of users in the educational scenario, provide higher quality answers, and thus provide better user experience and teaching effect.
[0097] In addition, through the method proposed in the embodiments of this specification, the acquired conversation data of the educational scenario is automatically classified, which can more effectively manage the data set and facilitate subsequent maintenance and updating.
[0098] See also Figure 2 Schematic diagram of the method for constructing training data for the multi-round dialogue model shown.
[0099] like Figure 2 As shown, in step 201, multiple rounds of dialogue data are obtained. One set of multiple rounds of dialogue data may be obtained each time, or multiple sets of multiple rounds of dialogue data may be obtained. For each set of multiple rounds of dialogue data, step 202 is executed to determine whether the length of the question in the subsequent round of dialogue is less than a first set threshold. If less than, step 203 is executed to enter the first processing branch. The first set threshold may be determined according to actual needs, and this specification does not limit the specific number.
[0100] In some embodiments, the first processing branch may be classified by the following method.
[0101] Determine whether the keywords included in the question contain words that represent the requirement to repeat. If the keywords contain words that represent the requirement to repeat, determine that the classification result indicates a category of requirement to repeat. The words that represent the requirement to repeat are, for example, "repeat", "again", "say again", etc. Those skilled in the art should understand that the above are only examples, and this specification does not intend to limit the specific words that represent the requirement to repeat.
[0102] During the conversation between the user and the model, when the user does not hear or see the model's response clearly for various reasons, the user usually asks the model to repeat it again. If the conversation data obtained in the "request for restatement" category contains a large number of answers expressed in a more concise or different way, then the model can be trained using such training data, and the model can learn to repeat previously answered questions in a more concise or different way of expression. Different ways of expression may help users better understand the content of the answer, and using a more concise way of expression can improve communication efficiency and help reduce ambiguity.
[0103] Determine whether the keywords included in the question include spoken response words. In the case that the keywords include spoken response words, determine that the classification result indicates a meaningless spoken category. Among them, spoken response words can also be called spoken filler words, which can be repeated words, such as "hmm", "ah, ah", etc., or some other common spoken response words such as "oh good", "hmm yes", etc. Those skilled in the art should understand that the above are only examples, and this specification does not intend to limit the specific vocabulary included in the spoken response words.
[0104] By collecting conversation data that provides appropriate feedback on these spoken filler words, training data is generated to train the model. This allows the model to give appropriate feedback when users use some meaningless verbal responses or replies in subsequent conversations, such as answering "OK, please continue asking questions" or "I'm here, how can I help you?" This prevents users from being left in a daze and improves user experience.
[0105] In one example, it can be first determined whether the keywords contained in the questions of the follow-up dialogue do not contain words that represent the request for repetition. If they do, the category of the follow-up dialogue is determined to be "request for repetition"; if not, it is further determined whether the keywords contain spoken response words. If they do, the category of the follow-up dialogue is determined to be "meaningless spoken language". If not, the follow-up dialogue may not be classified, or the dialogue may be set to "no specific category".
[0106] Continue to refer to Figure 2 When it is determined in step 202 that the length of the question in the subsequent dialogue is not less than the first set threshold, step 204 is executed to enter the second processing branch. In the second processing branch, different branches can be entered for processing according to the grammatical structure of the question. The grammatical structure can be whether the question contains subject, predicate, and object components, whether it is an interrogative sentence, etc.
[0107] Taking whether the grammatical structure contains a subject, a predicate, and an object as an example, the processing steps in the second processing branch include:
[0108] In step 2041, it is determined whether the question in the next round of dialogue contains subject, predicate and object components. A natural language processing tool can be used to perform grammatical analysis on the question. Specifically, it can be determined whether the question contains subject, predicate and object components by performing word segmentation, part-of-speech tagging, syntactic analysis, syntax tree construction, and subject, predicate and object identification.
[0109] When it is determined that the question contains subject, predicate, and object components, step 2042 is executed to enter the first sub-processing branch. In the first sub-processing branch, the classification result of the subsequent dialogue can be obtained according to the keywords contained in the question;
[0110] When it is determined that the question does not contain subject, predicate, or object components, step 2043 is executed to enter the second sub-processing branch. In the second sub-processing branch, the classification result of the subsequent round of dialogue can be obtained based on the contextual relationship between the question and the previous round of answers and the keywords contained in the question.
[0111] In some embodiments, the first sub-processing branch may be classified by the following method.
[0112] Determine whether the keywords contained in the question include self-introduction pronouns and words representing evaluation. If the keywords include self-introduction pronouns and words representing evaluation, determine that the classification result indicates the user self-evaluation category, otherwise determine that the classification result indicates a multi-round single question and answer category. Among them, self-introduction pronouns are, for example, "I", "my", "we", "our", etc.; words representing evaluation include positive evaluation or negative evaluation, positive evaluations are, for example, "good", "successful", "clear", etc., and negative evaluations are, for example, "bad", "failed", "confused", etc. Those skilled in the art should understand that the above are only examples, and this specification does not intend to limit the specific words for self-introduction pronouns and representing evaluations.
[0113] In an educational scenario, users may self-evaluate their knowledge or performance of other methods, for example, "My math grades are very poor," "My grades this time are not bad," and so on.
[0114] By obtaining the conversation data of the "self-evaluation" category as training data to train the model, the model can learn to provide reasonable and appropriate feedback on the user's self-evaluation and pay attention to the communication on the user's situation. For example, a comprehensive analysis and judgment of the user's learning situation or other aspects can be made, and the user's self-evaluation can be described or emotionally comforted.
[0115] The model is trained by using the training data constructed under this category. For the user's self-evaluation "My math grades are very poor", the model can learn to provide encouraging responses and give specific learning suggestions or resource recommendations.
[0116] Since the existing training methods of multi-round dialogue models rely on simple question-answer pairs, the models cannot effectively capture the real intentions and emotional states of users in practical applications. The embodiments of this specification enhance the model's empathy and personalized response capabilities in dialogues by deeply analyzing and comprehensively classifying user needs in educational scenarios and constructing a data set that includes emotional and personalized factors.
[0117] In some embodiments, the contextual relationship between the question and the last round of answer may include the repetition ratio between the question and the last round of answer, and the number of times the words or short sentences of the last round of answer appear in the question. In this case, for the second sub-processing branch, classification can be performed by the following method.
[0118] If the repetition ratio between the question and the answer in the previous round is higher than the second set threshold, it is determined that the classification result indicates a meaningless repetition category. The repetition ratio can be obtained by calculating the ratio of the similar part to the entire question text. In one example, the second set threshold can be set to 70%. That is, if the question asked by the user in the subsequent round has a repetition ratio higher than 70% with the answer in the previous round, it can be considered that the user is performing meaningless repetition.
[0119] By training the model with the training data constructed under this category, the model can give appropriate feedback to the user's repeated content to avoid conversation stagnation and maintain the continuity of the conversation.
[0120] If the number of times the words or short sentences in the previous round of answers appear in the question meets the set requirements and the keywords include words that represent the requirements, then it is determined that the classification result indicates the category of detailed questioning. Among them, the set conditions can be, for example, that the number of times the words or short sentences in the previous round of answers appear is not less than 1; words that represent the requirements, such as "example", "explanation", "description", etc. Those skilled in the art should understand that the above are only examples, and this specification does not intend to limit the specific words that represent the requirements.
[0121] For example, the multi-round conversation between user A and model B is as follows:
[0122] User A: What is a derivative?
[0123] Model B: The derivative is the slope of the tangent line to a function at a certain point.
[0124] User A: Please explain how the slope is calculated.
[0125] Model B: The slope is usually used to describe the inclination of a straight line on the coordinate axis, that is, the ratio of the change in the ordinate to the change in the abscissa between two points on the straight line.
[0126] In this example, the follow-up question contains the word "slope" from the previous answer, and also contains the word "explanation" which represents the request for explanation. Therefore, it can be judged that this follow-up dialogue belongs to the category of "questioning for details".
[0127] If the questions in the subsequent round of dialogue do not have the above two contextual relationships with the answers in the previous round, it is determined whether the keywords contain words that represent the evaluation. If so, it is determined that the classification result indicates the evaluation model reply category, otherwise it is determined that the classification result indicates the multi-round single question and answer category. Among them, the words that represent the evaluation include positive evaluation or negative evaluation. Positive evaluations are such as "good", "successful", "clear", etc., and negative evaluations are such as "bad", "failed", "confused", etc. Those skilled in the art should understand that the above are only examples, and this specification does not intend to limit the specific words that represent the evaluation.
[0128] By training the model with the training data constructed under this category, the model can combine the previous round of replies and the user's evaluation to make a second reply. For example, if the user's evaluation of the model's previous round of answers is "your answer is too simple", the model will provide a more detailed explanation or additional relevant information.
[0129] In one example, it can be first determined whether the repetition ratio between the question and the previous round of answers is higher than a second set threshold. If it is higher, it is determined that the classification result indicates a meaningless repetition category; otherwise, it is determined whether the number of words or short sentences in the previous round of answers in the question meets the set requirements and whether the keywords contain words that represent the requirements, if so, it is determined that the classification result indicates a detailed question category; otherwise, it is determined whether the keywords contain words that represent evaluation, if so, it is determined that the classification result indicates an evaluation model reply category, otherwise, it is determined that the classification result indicates a multi-round single question and answer category.
[0130] In some embodiments, when the acquired conversation data is single-round conversation data or multi-round single question-and-answer data, a classification result of the conversation data is obtained according to the type of question asked, and the question type includes at least one of knowledge point inquiry, homework help, and learning strategy.
[0131] By refining the question types and building training data sets for each refined question type, we can provide the model with rich single-round question-answering training samples.
[0132] In some embodiments, for multi-round dialogue data including multiple groups of continuous dialogues, if there are continuous dialogues with different classification results, the classification result with the largest number of occurrences is used as the classification result of the dialogue data. If there are multiple classification results with the largest number of occurrences, the classification result that appears first can be used as the final classification result of the dialogue data.
[0133] For example, if in the acquired multi-round dialogue data, the classification results of the first group of follow-up dialogues indicate "questioning for details", the classification results of the second group of follow-up dialogues also indicate "questioning for details", and the classification results of the third group of follow-up dialogues indicate "evaluation model reply", then the classification result "questioning for details" that appears the most times will be used as the classification result of the multi-round dialogue data.
[0134] Figure 3 FIG. 1 is a schematic diagram of another method for constructing training data for a multi-round dialogue model according to an exemplary embodiment of this specification. Figure 3 As shown, the method includes:
[0135] Step 301: Obtain conversation data in an educational scenario.
[0136] Step 302: Determine whether the conversation data is multi-round conversation data. If there is only one round of conversation, determine that the conversation data is single-round conversation data; if it is determined that the conversation data is multi-round conversation data, execute step 303.
[0137] Step 303, determine whether the length of the question in the subsequent dialogue is less than the first set threshold, if so, enter the first processing branch indicated by 304; if not, enter the second processing branch indicated by 305.
[0138] In the first processing branch, step 3041 is first executed to determine whether the question of the follow-up dialogue contains a keyword that indicates a request for repetition. If so, the category of the follow-up dialogue is determined to be "request for repetition". If not, step 3042 is executed to determine whether the keyword contains a spoken response word. If it does, the category of the follow-up dialogue is determined to be "meaningless spoken language". If not, the follow-up dialogue may not be classified, or the dialogue may be set to "no specific category".
[0139] In the second processing branch, firstly execute step 3051 to determine whether the question contains subject, predicate and object components. If so, execute step 3052 to determine whether it contains self-referential pronouns and keywords representing evaluation. If so, determine that the category of the continued dialogue is "count me as an evaluation", if not, determine that the category of the continued dialogue is "multi-round single question and answer". If in step 3051, it is determined that the question does not contain subject, predicate and object components, then execute step 3053 to determine whether the repetition ratio between the question and the previous round of answers is higher than the second set threshold. If so, determine that the category of the continued dialogue is "meaningless repetition"; if not, execute step 3054 to determine whether the number of times the words or short sentences of the previous round of answers appear in the question meets the set requirements and whether it contains keywords representing the requirements. If so, it is determined that the category of the follow-up dialogue is "asking for details"; if not, execute step 3055 to determine whether it contains keywords representing evaluation. If so, it is determined that the category of the follow-up dialogue is "evaluation model reply"; if not, it is determined that the category of the follow-up dialogue is "multi-round single question and answer".
[0140] According to the training data construction method proposed in the embodiments of this specification and the use of corresponding training strategies, the multi-round dialogue model's ability to process unseen data is improved, enabling the model to more flexibly respond to various complex and changing educational scenarios.
[0141] See also Figure 4 , Figure 4 1 is a block diagram of a training data construction device for a turn-based dialogue model provided by an exemplary embodiment, the device comprising:
[0142] An acquisition unit 401 is used to acquire conversation data in an educational scenario;
[0143] A judgment unit 402, configured to, when the dialogue data is multi-round dialogue data, enter a first processing branch if the length of the question in the subsequent dialogue is less than a first set threshold, otherwise enter a second processing branch;
[0144] The classification unit 403 is used to obtain the classification result of the subsequent dialogue according to the keywords contained in the question in the first processing branch; in the second processing branch, obtain the classification result of the subsequent dialogue according to the grammatical structure of the question, the contextual relationship between the question and the previous answer, and the keywords contained in the question;
[0145] A determination unit 404, configured to determine a classification result of the dialogue data according to the classification result of the subsequent dialogue round;
[0146] The construction unit 405 is used to obtain classification training data according to the classification result, and the classification training data is used to train the multi-round dialogue model under the corresponding category.
[0147] In some embodiments, the classification unit is specifically used to:
[0148] In the case where the keyword includes a word representing a requirement for repetition, determining that the classification result indicates a category of requirement for restatement;
[0149] In a case where the keyword includes a spoken response word, it is determined that the classification result indicates a meaningless spoken category.
[0150] In some embodiments, the classification unit is specifically used to:
[0151] If the question contains subject, predicate and object components, enter the first sub-processing branch; otherwise, enter the second sub-processing branch;
[0152] In the first sub-processing branch, the questions are classified according to the keywords contained in the questions;
[0153] In the second sub-processing branch, the question is classified according to the contextual relationship between the question and the previous round of answers and the keywords contained therein.
[0154] In some embodiments, when the classification unit is used to classify according to the keywords contained in the question, it is specifically used for:
[0155] If the keyword includes a self-referential pronoun and a word representing evaluation, it is determined that the classification result indicates a user self-evaluation category; otherwise, it is determined that the classification result indicates a multi-round single question and answer category.
[0156] In some embodiments, when the classification unit is used to classify the question according to the contextual relationship between the question and the previous round of answers and the keywords contained therein, it is specifically used to:
[0157] If the repetition ratio between the question and the previous round of answers is higher than a second set threshold, determining that the classification result indicates a meaningless repetition category;
[0158] If the number of times the words or short sentences in the previous round of answers appear in the question meets the set requirements and the keywords include words representing the required description, then determining that the classification result indicates the detailed question category;
[0159] Otherwise, it is determined whether the keywords contain words representing evaluation, and if so, it is determined that the classification result indicates the evaluation model response category, otherwise it is determined that the classification result indicates the multi-round single question and answer category.
[0160] In some embodiments, the apparatus further comprises an updating unit, configured to:
[0161] In the case where there are subsequent rounds of dialogue with different classification results in the dialogue data, the classification result with the largest number of occurrences is used as the classification result of the dialogue data.
[0162] In some embodiments, the apparatus further comprises a refinement unit configured to:
[0163] In the case that the dialogue data is single-round dialogue data or multi-round single question-and-answer data, a classification result of the dialogue data is obtained according to the type of question asked, and the question type includes at least one of knowledge point inquiry, homework help, and learning strategy.
[0164] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other tasks. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0165] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0166] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0167] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0168] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0169] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0170] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0171] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0172] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0173] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A method for constructing training data for a multi-round dialogue model. It is characterized in that include: Obtain conversation data in educational scenarios; In the case where the dialogue data is multi-round dialogue data, if the length of the question asked in the subsequent dialogue is less than the first set threshold, enter the first processing branch, otherwise enter the second processing branch; In the first processing branch, a classification result of the subsequent dialogue is obtained according to the keywords contained in the question; In the second processing branch, a classification result of the subsequent round of dialogue is obtained according to the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and the keywords contained therein; Determining the classification result of the dialogue data according to the classification result of the subsequent dialogue round; Classification training data is obtained according to the classification result, and the classification training data is used to train the multi-round dialogue model under the corresponding category.
2. The method according to claim 1, It is characterized in that The step of obtaining the classification result of the subsequent dialogue according to the keywords contained in the question includes: In the case where the keyword includes a word representing a requirement for repetition, determining that the classification result indicates a category of requirement for restatement; In a case where the keyword includes a spoken response word, it is determined that the classification result indicates a meaningless spoken category.
3. The method according to claim 1, It is characterized in that The classification result of the subsequent dialogue is obtained according to the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and the keywords contained therein, including: If the question contains subject, predicate and object components, enter the first sub-processing branch; otherwise, enter the second sub-processing branch; In the first sub-processing branch, the questions are classified according to the keywords contained in the questions; In the second sub-processing branch, the question is classified according to the contextual relationship between the question and the previous round of answers and the keywords contained therein.
4. The method according to claim 3, It is characterized in that In the first sub-processing branch, classification is performed according to the keywords contained in the question, including: If the keyword includes a self-referential pronoun and a word representing evaluation, it is determined that the classification result indicates a user self-evaluation category; otherwise, it is determined that the classification result indicates a multi-round single question and answer category.
5. The method according to claim 3, It is characterized in that In the second sub-processing branch, classification is performed according to the contextual relationship between the question and the previous round of answers and the keywords contained, including: If the repetition ratio between the question and the previous round of answers is higher than a second set threshold, determining that the classification result indicates a meaningless repetition category; If the number of times the words or short sentences in the previous round of answers appear in the question meets the set requirements and the keywords include words representing the required description, then determining that the classification result indicates the detailed question category; Otherwise, it is determined whether the keywords contain words representing evaluation, and if so, it is determined that the classification result indicates the evaluation model response category, otherwise it is determined that the classification result indicates the multi-round single question and answer category.
6. The method according to any one of claims 1 to 5, It is characterized in that The method further includes: when there are subsequent rounds of dialogue with different classification results in the dialogue data, taking the classification result with the largest number of occurrences as the classification result of the dialogue data.
7. The method according to any one of claims 1 to 5, It is characterized in that The method also includes: when the dialogue data is single-round dialogue data or multi-round single question-and-answer data, obtaining a classification result of the dialogue data according to the type of question asked, the question type including at least one of knowledge point inquiry, homework help, and learning strategy.
8. A training data construction device for a multi-round dialogue model, It is characterized in that include: An acquisition unit, used to acquire conversation data in an educational scenario; A judgment unit, configured to, when the dialogue data is multi-round dialogue data, enter a first processing branch if the length of the question asked in the subsequent dialogue is less than a first set threshold, otherwise enter a second processing branch; A classification unit, configured to obtain a classification result of the subsequent dialogue according to the keywords contained in the question in the first processing branch; In the second processing branch, a classification result of the subsequent round of dialogue is obtained according to the grammatical structure of the question, the contextual relationship between the question and the previous round of answer, and the keywords contained therein; A determination unit, configured to determine a classification result of the dialogue data according to the classification result of the subsequent dialogue round; A construction unit is used to obtain classification training data according to the classification result, and the classification training data is used to train the multi-round dialogue model under the corresponding category.
9. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the steps of the method according to any one of claims 1 to 7 by running the executable instructions.
10. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-round dialogue method and system fusing context information
CN112818105A
Open dialogue method and device, electronic equipment and medium
CN116501846A
Intelligent question answering method and device based on large model, electronic equipment and storage medium
CN117648408A
Customer service dialogue text classification method and device, electronic equipment and medium
CN117932051A
Conversation breakdown feature quantity extraction device, conversation breakdown feature quantity extraction method, and program
JP2019204117A
