Question and answer data generation method and device, equipment and storage medium
By calculating the importance and diversity of questions, generating answers using a large-scale language model, and conducting multi-dimensional evaluation, the problems of accuracy and comprehensiveness in question-and-answer data generation are solved, and the stability of question-and-answer data generation quality is achieved.
Patent Information
- Application Number
- CN202410998328.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Existing technologies for generating question-and-answer data lack accuracy and comprehensiveness, resulting in unstable quality of the generated data.
By calculating the importance and diversity of each question in the question set, answers are generated using a large-scale language model, and multi-dimensional evaluation is performed using a quality assessment model to filter out question-and-answer data that meet the threshold conditions.
This generates more accurate and comprehensive question-and-answer data, ensuring the stability of the quality of the generated data.
Smart Images

Figure CN118966336B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of big data technology, and in particular relates to a question-and-answer data generation method, apparatus, device, storage medium and computer program product. Background Technology
[0002] Log-based question-and-answer data refers to a dataset containing questions and corresponding answers, which is typically used to train and evaluate question-and-answer systems, dialogue systems, and natural language processing models.
[0003] Existing technologies rely on a single method for generating question-and-answer data, directly generating data based on a pre-set model. This results in the generated question-and-answer data lacking accuracy and comprehensiveness compared to the original logs, and exhibiting inconsistent quality. Summary of the Invention
[0004] This application provides a question-and-answer data generation method, apparatus, device, storage medium, and computer program product, which can optimize three aspects: question generation, answer generation, and question-and-answer data filtering. It can generate more accurate and comprehensive question-and-answer data and ensure the stability of the quality of question-and-answer data generation.
[0005] In a first aspect, embodiments of this application provide a question-and-answer data generation method, the method comprising:
[0006] Obtain log data and a set of questions; the log data includes key log information; the set of questions is generated based on the key log information; the set of questions includes the frequency of each question in the set, the importance of the key information of each question, the similarity of the questions, and the vector entropy of the key information of each question.
[0007] Based on the frequency of occurrence of problems in the problem set, the importance of key information of problems, the similarity of problems, and the vector entropy of key information of problems, the target value of each problem in the problem set is calculated. The target value represents the importance and diversity of the problem. Problems whose target values meet the first threshold condition are regarded as the first problem.
[0008] The first question and log data are input into a large-scale language model. Based on the log data, the second key information that is relevant to the first question and meets the second threshold condition is extracted. The second key information is integrated to obtain the answer corresponding to the first question.
[0009] The first question and answer are input into a pre-trained answer correction model. Based on the correspondence between questions and answers in the answer correction model, the target answer for the first question is determined. Answer correction suggestions are generated based on the target answer and the answer. The answer is corrected according to the answer correction suggestions to obtain the first answer corresponding to the first question.
[0010] Based on the first question and the first answer corresponding to the first question, we obtain the question-and-answer data;
[0011] Input the question-and-answer data and log data into the pre-built quality assessment model. Based on the question-and-answer data, or the question-and-answer data and log data, determine the target assessment parameters. Based on the correspondence between the assessment parameters and the quality score, obtain the quality score corresponding to the target assessment parameters. Output the target question-and-answer data whose quality score meets the preset third threshold condition.
[0012] Secondly, embodiments of this application provide a question-and-answer data generation apparatus, the apparatus comprising:
[0013] The acquisition module is used to acquire log data and a set of issues. The log data includes key log information. The set of issues is generated based on the key log information. The set of issues includes the frequency of each issue in the set, the importance of the key information of each issue, the similarity of the issues, and the vector entropy of the key information of each issue.
[0014] The generation module is used to calculate the target value of each problem in the problem set based on the frequency of occurrence of problems and the importance of key information of problems, the similarity of problems and the vector entropy of key information of problems. The target value represents the importance and diversity of the problem, and the problem whose target value meets the first threshold condition is regarded as the first problem.
[0015] The generation module is further configured to input the first question and log data into a large-scale language model, extract second key information based on the log data whose relevance to the first question meets a second threshold condition, and integrate the second key information to obtain the answer corresponding to the first question.
[0016] The generation module is further configured to input the first question and answer into a pre-trained answer correction model, determine the target answer corresponding to the first question based on the correspondence between questions and answers in the answer correction model, generate answer correction suggestion information based on the target answer and the answer, and correct the answer according to the answer correction suggestion information to obtain the first answer corresponding to the first question;
[0017] The generation module is further configured to obtain question-and-answer data based on the first question and the first answer corresponding to the first question;
[0018] The evaluation module is used to input question-and-answer data and log data into a pre-built quality evaluation model, determine target evaluation parameters based on the question-and-answer data, or question-and-answer data and log data, obtain the quality score corresponding to the target evaluation parameters based on the correspondence between the evaluation parameters and the quality score, and output the target question-and-answer data whose quality score meets the preset third threshold condition.
[0019] Thirdly, embodiments of this application provide a question-and-answer data generation device, the device including: a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the question-and-answer data generation method as described in the first aspect.
[0020] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the question-and-answer data generation method as described in the first aspect.
[0021] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the question-and-answer data generation method as described in the first aspect.
[0022] The question-and-answer data generation method, apparatus, device, storage medium, and computer program product of this application optimize question generation by calculating the importance and diversity of each question in a question set, considering the quality of generated questions based on their importance and diversity. By inputting questions and log data into a large-scale language model to generate answers corresponding to the questions, the model not only focuses on the questions themselves but also searches for answers within the context of the questions, enhancing question understanding through contextual information and thus optimizing answer generation. The quality score of the question-and-answer data is obtained through multiple evaluation parameters in the quality assessment model, and question-and-answer data whose quality scores meet preset threshold conditions are used as target question-and-answer data, achieving multi-dimensional quality assessment of the question-and-answer data and optimizing question-and-answer data filtering. Because optimizations are made in question generation, answer generation, and question-and-answer data filtering, more accurate and comprehensive questions and answers can be generated, effectively ensuring the stability of the quality of generated question-and-answer data. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a question-and-answer data generation method provided in one embodiment of this application;
[0025] Figure 2 This is a flowchart illustrating a method for calculating the importance of each problem in a set of problems according to one embodiment of this application;
[0026] Figure 3 This is a flowchart illustrating a method for calculating the diversity of each problem in a set of problems according to one embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the structure of a question-and-answer data generation device provided in one embodiment of this application;
[0028] Figure 5 This is a schematic diagram of the structure of a question-and-answer data generation device provided in one embodiment of this application. Detailed Implementation
[0029] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0030] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0031] Existing technologies for generating question-and-answer data often employ general-domain question generation models. These models extract answer fragments from logs, then use both the answer fragments and the full log text as input to generate questions related to the answer fragments, thus obtaining log-based question-and-answer data.
[0032] The aforementioned prior art has the following disadvantages:
[0033] (1) The extracted answer fragments may not be accurate or complete, affecting the quality and accuracy of question generation.
[0034] (2) It relies on a question generation model instead of directly using a large-scale language model to generate questions and answers, resulting in generated questions and answers that lack depth and comprehensiveness compared to the original log data.
[0035] (3) The lack of evaluation and filtering of the generated question and answer data leads to unstable quality of the generated question and answer data, which is not conducive to subsequent use and analysis.
[0036] To address the problems of existing technologies, this application provides a question-and-answer data generation method, apparatus, device, storage medium, and computer program product. This application optimizes question generation by calculating the importance and diversity of each question in a question set, considering the quality of generated questions based on their importance and diversity. By inputting questions and log data into a large-scale language model to generate answers corresponding to the questions, the model not only focuses on the questions themselves but also searches for answers within the context of the questions, enhancing question understanding through contextual information and optimizing answer generation. A quality score for the question-and-answer data is obtained through multiple evaluation parameters in a quality assessment model, and question-and-answer data whose quality scores meet preset threshold conditions are used as target question-and-answer data, achieving multi-dimensional quality assessment of the question-and-answer data and optimizing question-and-answer data filtering. Because optimizations are made in question generation, answer generation, and question-and-answer data filtering, more accurate and comprehensive questions and answers can be generated, effectively ensuring the stability of the quality of generated question-and-answer data.
[0037] The question-and-answer data generation method provided in the embodiments of this application will be introduced first below.
[0038] Figure 1 A flowchart illustrating a question-and-answer data generation method according to an embodiment of this application is shown. Figure 1 As shown, the method may include the following steps: S101 to S106.
[0039] S101: Obtain log data and issue set.
[0040] The log data includes key log information;
[0041] The question set is generated based on key information from the logs;
[0042] The problem set includes the frequency of each problem in the problem set, the importance of key information of each problem, the similarity of problems, and the vector entropy of key information of each problem.
[0043] Key information in log data may include the time of the event, the type of the event, the system components involved, and the type of error that occurred. This key information is fundamental to understanding the meaning of the logs and generating questions and answers. Therefore, in the question-and-answer data generation method of this application embodiment, it is first necessary to extract key log information from the acquired logs and generate questions based on the extracted key log information to obtain an initial question set.
[0044] The frequency of each problem in the problem set, the importance of key information of each problem, the similarity of each problem, and the vector entropy of key information of each problem are used to calculate the target value of each problem in the problem set in the next step S102, so as to carry out the next step of optimization filtering based on the problem set.
[0045] In some embodiments, obtaining key log information can be accomplished by using a prompt to invoke a large-scale language model to parse and understand the log data, and then extracting the key information.
[0046] Among them, large-scale language models have learned from a large amount of text data and have gained the ability to understand and generate natural language. They can understand the intent of the question and take the extracted key information from the log as input to generate questions related to the key information in the log.
[0047] S102: Based on the frequency of occurrence of problems in the problem set, the importance of key information of problems, the similarity of problems, and the vector entropy of key information of problems, calculate the target value of each problem in the problem set. The target value represents the importance and diversity of the problem. The problem whose target value meets the preset first threshold condition is taken as the first problem.
[0048] The importance of a question is an important factor in measuring its quality. Questions with high importance can usually reflect key information in log data and have important guiding significance for understanding log data, solving problems, and optimizing systems.
[0049] Meanwhile, the diversity of questions is another important factor in ensuring comprehensive coverage and improving the effectiveness of questions. The generated questions should have sufficient diversity to fully reflect the log data.
[0050] Considering the importance and diversity of the problems, this step uses target values to characterize the importance and diversity of the problems. Based on the frequency of occurrence of problems in the problem set, the importance of key information of the problems, the similarity of the problems, and the vector entropy of key information of the problems, the target value of each problem in the problem set is calculated to obtain the problems whose target values meet the preset threshold conditions.
[0051] By simultaneously considering the importance and diversity of questions and optimizing the filtering of questions, the quality and utility of the generated questions are improved, thereby enhancing the effectiveness and application value of the question-and-answer data generation method.
[0052] The first threshold condition is used to filter out problems with higher importance and diversity by comparing the target value representing the importance and diversity of the problem with the first threshold.
[0053] In some embodiments, the specific value of the first threshold can be set manually according to the actual situation. S103: Input the first question and log data into a large-scale language model, extract the first key information whose relevance to the first question meets the preset second threshold condition based on the log data; integrate the first key information to obtain the answer corresponding to the first question.
[0054] The generated question-and-answer data is only valuable when both the question and the answer are correct. In this step, the ability of a large-scale language model to understand and generate natural language is used to find an accurate answer to the first question.
[0055] Since the answers to questions are often hidden in log data, and large-scale language models need to consider both the content of questions and log data to generate accurate answers, the first question with high importance and high diversity obtained in step S102, along with the log data, is used as input into the large-scale language model.
[0056] Large-scale language models can find key information from log data that meets a threshold condition for relevance to the first question, and then integrate this key information into a natural language answer.
[0057] The above-described answer generation process considers both accuracy and completeness. Accuracy means the answer must correctly address the question, while completeness means the answer must contain all the information necessary to answer the question. By inputting the first question along with log data into a large-scale language model, the model not only searches for the answer based on the first question itself but also within the specific context in which the first question occurs. This contextual information enhances the understanding of the first question, thereby improving the relevance and accuracy of the generated answer.
[0058] The second threshold condition is used to filter out key information with a relevance greater than the second threshold by comparing the relevance of key information and questions with the second threshold, and use this as key information to integrate the answer to the first question.
[0059] In some embodiments, the specific value of the second threshold can be set manually according to actual circumstances.
[0060] S104: Input the first question and answer into the pre-trained answer correction model, determine the target answer corresponding to the first question based on the correspondence between questions and answers in the answer correction model, generate answer correction suggestion information based on the target answer and the answer, and correct the answer according to the answer correction suggestion information to obtain the first answer corresponding to the first question.
[0061] To ensure the accuracy and completeness of the generated answers, the generated answers need to be further verified and corrected based on step S103.
[0062] To accurately and efficiently verify and correct the generated answers, this application embodiment trains an answer correction model using a machine learning algorithm. This model can evaluate and verify the generated answers based on the content of the question and log data. If the answer is inaccurate or incomplete, the model can generate answer correction suggestions and correct the answer based on the suggestions to further improve the quality of the answer.
[0063] This step establishes a self-correction mechanism for answer quality. By introducing a machine learning-driven correction mechanism, the generated answers can be verified in real time to determine their accuracy and completeness. In the event of inaccurate or incomplete answers, correction suggestions are generated, thereby improving the accuracy and completeness of the generated answers and enhancing the efficiency and quality of answer generation.
[0064] In some embodiments, the answer correction model obtained by training the above-mentioned machine learning algorithm may include four processes: feature extraction, model selection, model training, and model validation.
[0065] In some embodiments, during the feature extraction process described above, the features to be extracted may include the text content of the question, the text content of the answer, the semantic similarity between the question and the answer, and the frequency of the answer appearing in the log. These features are designed to capture the correlation between the question, the answer, and the log, thereby helping the answer correction model to judge the accuracy and completeness of the answer.
[0066] In some embodiments, during the model selection process described above, based on considerations of model complexity, interpretability, and performance, the BERT model can be selected for training to obtain the answer correction model.
[0067] S105: Obtain the question-and-answer data based on the first question and the first answer corresponding to the first question.
[0068] The first question and first answer generated in the above steps are organized to obtain question and answer data, which is then used for subsequent multi-dimensional quality assessment.
[0069] S106: Input the question-and-answer data and log data into the pre-built quality assessment model. Based on the question-and-answer data, or the question-and-answer data and log data, determine the target assessment parameters. Based on the correspondence between the assessment parameters and the quality score, obtain the quality score corresponding to the target assessment parameters. Output the target question-and-answer data whose quality score meets the preset third threshold condition.
[0070] Quality assessment can largely ensure the quality of generated question-and-answer data. By using a quality assessment model to conduct a comprehensive quality evaluation of the generated question-and-answer data, lower-quality question-and-answer data can be filtered out, thereby generating more accurate and comprehensive question-and-answer data and ensuring the stability of the quality of generated question-and-answer data.
[0071] The quality assessment model includes multiple assessment parameters for multi-dimensional quality assessment of question-and-answer data. These assessment parameters are determined based on question-and-answer data, or question-and-answer data and log data.
[0072] The aforementioned third threshold condition is used to filter out question-and-answer data whose quality scores are greater than the third threshold by comparing the quality scores of the question-and-answer data with the third threshold, and thus identify them as high-quality question-and-answer data.
[0073] In some embodiments, the specific value of the third threshold can be set manually according to the actual situation.
[0074] This application's embodiments optimize question generation by calculating the importance and diversity of each question in a question set, considering the quality of generated questions based on their importance and diversity. By inputting questions and log data into a large-scale language model to generate answers corresponding to the questions, the model not only focuses on the questions themselves but also searches for answers within the context of the questions, enhancing question understanding through contextual information and thus optimizing answer generation. Furthermore, by using multiple evaluation parameters in the quality assessment model to obtain quality scores for question-and-answer data, and selecting question-and-answer data whose quality scores meet preset threshold conditions as target question-and-answer data, a multi-dimensional quality assessment of the question-and-answer data is achieved, thereby optimizing question-and-answer data filtering. Because optimizations have been made in question generation, answer generation, and question-and-answer data filtering, more accurate and comprehensive questions and answers can be generated, effectively ensuring the stability of the quality of generated question-and-answer data.
[0075] In some embodiments, the question-and-answer data generation method may further include obtaining the importance of key log information.
[0076] In some embodiments, before obtaining the importance of key log information, the question-and-answer data generation method may further include obtaining the frequency of occurrence of key log information.
[0077] In some embodiments, obtaining the importance of key log information may include the following steps:
[0078] For each key piece of information in the log, the word segments in the key log information and the word segments in the question are converted into the first word vector of the key log information and the second word vector of the question through the word embedding model.
[0079] Calculate the mean of the first word vector and the second word vector respectively to obtain the log key information vector and the question vector;
[0080] Calculate the similarity between the log key information vector and the question vector, and use it as the relevance between the log key information and the question;
[0081] The importance of the log information is obtained by multiplying the relevance between the key log information and the issue, and by the frequency of the key log information.
[0082] Key information is the foundation for understanding the meaning of logs and generating questions and answers. The higher the importance of the key information on which questions are generated, the more accurate the questions will be, and the higher their relevance to the log data will be, thus making them more in-depth.
[0083] The importance of key log information can be compared with a preset threshold. Key log information that meets the preset threshold is input into a large-scale language model to generate questions and obtain a question set.
[0084] The word embedding model mentioned above can be any one of Word2Vec, GloVe, or FastText. The specific model used is not limited in this embodiment.
[0085] In one embodiment, the importance of obtaining key log information can be calculated using the following formula:
[0086] Importance(i) = Frequency(i) * Relevance(i) (1)
[0087] Where Frequency(i) represents the frequency of the log key information i in the log data, and Relevance(i) represents the relevance of the log key information i to the generated question.
[0088] The formula for calculating Frequency(i) above can include:
[0089] Frequency(i)=Count(i) / Length (2)
[0090] Where Count(i) represents the number of times key information i appears in the log data, and Length represents the text length of the log.
[0091] The Relevance(i) mentioned above can be measured by the distance between the log key information i and the generated question in the semantic space. The closer the distance, the higher the relevance, and the larger the value of Relevance(i).
[0092] In some embodiments, the question-and-answer data generation method further includes obtaining the frequency of occurrence of key information in the question.
[0093] In some embodiments, such as Figure 2 As shown, in step S102, the target value for each question in the question set is calculated based on the frequency of occurrence of questions in the question set, the importance of key information of questions, the similarity of questions, and the vector entropy of key information of questions. This may include the following steps:
[0094] For each question:
[0095] S201: Using a word embedding model, the word segments in the key information of the question and the word segments in the question are converted into the first word vector of the key information of the question and the second word vector of the question, respectively.
[0096] S202: Calculate the mean of the first word vector and the second word vector respectively to obtain the key information vector and the question vector;
[0097] S203: Calculate the similarity between the key information vector of the problem and the problem vector, as the relevance between the key information of the problem and the problem;
[0098] S204: Based on the relevance between the key information of the problem and the problem and the frequency of occurrence of the key information of the problem, calculate the product of the relevance and the frequency of occurrence to obtain the importance of the key information of the problem;
[0099] S205: Calculate the product of frequency and importance based on the frequency of occurrence of the problem in the problem set and the importance of the key information of the problem to obtain the importance of the problem.
[0100] The importance of a question is a crucial dimension for measuring its quality. Highly important questions typically reveal key information within log data, providing significant guidance for understanding log data, troubleshooting, and system optimization. For example, in log data related to system failures, questions reflecting the causes and solutions to the failures are usually the most important.
[0101] Therefore, the embodiments of this application take into account the importance of the questions. The importance of the questions is represented by calculating the importance of the questions based on the frequency of occurrence of the questions in the question set and the importance of the key information of the questions. The questions with higher importance are selected to generate question and answer data, thereby improving the value of log question and answer data.
[0102] In one embodiment, the importance of each question in the question set is calculated based on the frequency of occurrence of questions in the question set, the importance of key information about the questions, the similarity of the questions, and the vector entropy of the key information about the questions. This can be done using the following formula:
[0103] Importance(Q) = Frequency(Q) * Importance(I) (3)
[0104] Where Q represents the problem, I represents the key information contained in the problem Q, Frequency(Q) represents the frequency of the occurrence of the problem Q in the problem set, and Importance(I) represents the importance of the key information I contained in the problem Q.
[0105] In some embodiments, such as Figure 3 As shown, in step S102, the target value for each question in the question set is calculated based on the frequency of occurrence of questions in the question set, the importance of key information of questions, the similarity of questions, and the vector entropy of key information of questions. This may include the following steps:
[0106] For each question:
[0107] S301: Convert the word segments in the key information of the question into word vectors of the key information of the question through a word embedding model, calculate the mean of the word vectors of the key information of the question, and obtain the key information vector of the question.
[0108] S302: Calculate the entropy of the key information vector of the problem to obtain the diversity of the key information of the problem;
[0109] S303: Randomly select a problem from the problem set to obtain problem j and problem k;
[0110] S304: Take the average of the word vectors of the key information of question j to obtain the key information vector of question j; take the average of the word vectors of the key information of question k to obtain the key information vector of question k;
[0111] S305: Based on the key information vectors of question j and question k, calculate the similarity between question j and question k, which is used as the diversity of question j.
[0112] The diversity of questions is a crucial factor in ensuring comprehensive coverage and improving the effectiveness of question generation. Large amounts of log data contain a wide variety of events and issues; therefore, the questions generated should also be sufficiently diverse to fully reflect and analyze the log data. For example, for system performance log data, the issues that might need to be addressed include various aspects such as the system's operational status, resource usage, and performance bottlenecks.
[0113] The diversity of questions is represented by calculating the diversity of generated questions based on the similarity of the questions and the vector entropy of the key information of the questions. Questions with more comprehensive diversity are selected to generate question-and-answer data, thereby improving the value of the question-and-answer data.
[0114] By considering the diversity of questions, we can generate more comprehensive and useful questions, thereby improving the utility of log question-and-answer data.
[0115] In one embodiment, the importance of each question in the question set is calculated based on the frequency of occurrence of questions in the question set, the importance of key information about the questions, the similarity of the questions, and the vector entropy of the key information about the questions. This can be done using the following formula:
[0116] Diversity(Q) = 1 - Similarity(Qj,Qk) * Diversity(I) (4)
[0117] Where Qj and Qk represent any two questions in the question set, I represents the key information contained in the question, Similarity(Qj,Qk) represents the similarity between question Qj and question Qk, and Diversity(I) represents the diversity of the key information I contained in the question.
[0118] Diversity(I) can be obtained by calculating the entropy of the problem's key information vector.
[0119] In one embodiment, Diversity(I) can be calculated using the following formula:
[0120] Diversity(I)=-∑(Frequency(i)*log (Frequency(i))) (5)
[0121] Here, Frequency(i) represents the frequency of occurrence of key information i in the problem.
[0122] In some embodiments, based on any of the above embodiments, the question-and-answer data generation method may further include summing the importance and diversity of the questions, and selecting questions whose sum is greater than a preset threshold as the first question of the log data.
[0123] The importance and diversity of questions are complementary. Questions with high importance are not necessarily diverse, and questions with high diversity are not necessarily important. Only by considering both the importance and diversity of questions can we generate questions that are both important and diverse, thereby effectively improving the effectiveness and application value of the automatic construction method for log question-and-answer data.
[0124] Therefore, in the process of generating questions based on large-scale language models and key log information in this application embodiment, the importance and diversity of the questions are considered at the same time. The sum of importance and diversity is used as a reference standard for selecting questions, thereby improving the quality and utility of question generation and thus enhancing the effect and application value of generating log question-and-answer data.
[0125] In one embodiment, selecting issues with sum values greater than a preset threshold as candidate issues for the log data can be done by selecting the top ten issues with sum values as the first issue of the log segment.
[0126] In some embodiments, before step S104: inputting the first question and answer into the pre-trained answer correction model, the question-and-answer data generation method may further include:
[0127] Obtain a training sample set, which includes multiple training samples, each of which includes a question, an answer, and a correct label;
[0128] The pre-defined BERT model is trained using training samples. If the training stopping condition is met, the trained model is determined to be the answer correction model.
[0129] In some embodiments, the above-mentioned method of training a preset BERT model using training samples and determining the trained model as the answer correction model when the training stopping condition is met may include:
[0130] The questions from the training samples are input into the pre-defined BERT model to obtain the predicted answers to the questions;
[0131] Determine the loss function value of the BERT model based on the predicted answer and the correct label;
[0132] If the loss function value satisfies the training stopping condition, the answer is obtained to correct the model.
[0133] In order for the BERT model to learn to predict the correctness of the answer from the features of the question and the answer, the BERT model is trained by using a set of instances containing the question, the answer and the correct label as training samples, where the correct label represents whether the answer is accurate and complete.
[0134] By training the model using training samples, the model learns to predict the correctness of the answer from the features of the question and the answer.
[0135] In some embodiments, after the above-described process of training the BERT model is completed, validation data can also be used to validate the performance of the trained BERT model.
[0136] The BERT model trained above is used to predict the validation data, and then the prediction results are compared with the correct labels to evaluate the performance of the trained BERT model. The trained BERT model that meets the performance requirements is used as the answer correction model expected to be obtained in the embodiments of this application.
[0137] The validation data consists of another set of instances containing questions, answers, and correct labels, but this set of instances was not used to train the model.
[0138] In some embodiments, in step S106, the evaluation parameter may include the answer length; determining the target evaluation parameter based on the question-and-answer data may include: extracting the length of the answer from the question-and-answer data.
[0139] Answer length is used to assess whether an answer is of appropriate length. Appropriate answer length is a key factor in ensuring information is easy to understand and digest. Answers that are too short may omit important information, while answers that are too long may confuse and perplex the reader. An ideal answer length range can be set for evaluation; if the answer falls within this range, it is considered of appropriate length.
[0140] In some embodiments, in step S106, the evaluation parameters may include the ratio of answer segmentation to log segmentation; determining the target evaluation parameters based on question-and-answer data and log data may include:
[0141] Based on the question-and-answer data and log data, the answers in the question-and-answer data and the log data are segmented into words respectively to obtain the first segment of the answer and the second segment of the log data.
[0142] Calculate the ratio of the first segmentation to the second segmentation, and use it as the ratio of the answer segmentation to the log segmentation.
[0143] The ratio of answer segmentation to log segmentation is used to assess whether the information in the answer can be corroborated in the log data. The information in the answer should originate from a reliable source to ensure its accuracy and validity. The information in the answer can be compared with the original log to ensure that all information in the answer can be found in the log.
[0144] In some embodiments, in step S106, the evaluation parameters may include the similarity between the question vector and the answer vector; determining the target evaluation parameters based on the question-and-answer data may include:
[0145] Based on the question-and-answer data, the word segmentation of the question and the word segmentation of the answer in the question-and-answer data are converted into the first word vector of the question and the second word vector of the answer respectively through the word embedding model;
[0146] Calculate the mean of the first word vector and the second word vector respectively to obtain the question vector and the answer vector;
[0147] Calculate the similarity between the question vector and the answer vector based on the question vector and the answer vector.
[0148] The similarity between question and answer vectors is used to evaluate the semantic consistency of the questions and answers. Ensuring semantic consistency means that the answer must address the content of the question and cannot contain information irrelevant to the question. This consistency can be evaluated by calculating the semantic similarity between the questions and answers.
[0149] In some embodiments, in step S106, the evaluation parameters may include the similarity between the answer vector and the log data vector; determining the target evaluation parameters based on the question-and-answer data and the log data may include:
[0150] Based on question-and-answer data and log data, word embedding models are used to convert the word segments of the answers in the question-and-answer data and the word segments of the log data into the first word vector of the answers and the second word vector of the log data, respectively.
[0151] Calculate the mean of the first word vector and the second word vector respectively to obtain the answer vector and the log data vector;
[0152] Calculate the similarity between the answer vector and the log data vector based on the answer vector and the log data vector.
[0153] The similarity between the answer vector and the log data vector is used to assess whether the answer accurately reflects the content of the log. The similarity between the answer and the log data can be calculated using methods such as cosine similarity or Jaccard similarity.
[0154] In some embodiments, in step S106, obtaining the quality score corresponding to the target evaluation parameter based on the correspondence between the evaluation parameter and the quality score may include:
[0155] Based on the question-and-answer data, the evaluation scores corresponding to each evaluation parameter of the question-and-answer data are summed to obtain the quality score.
[0156] By combining the scores corresponding to each evaluation parameter, a quality score is obtained for the question-and-answer data. This score can be used to assess the quality of the generated question-and-answer data. Question-and-answer data whose quality scores meet the preset threshold conditions are selected as the final desired question-and-answer data, thereby improving the quality of the generated question-and-answer data.
[0157] In some embodiments, a length function L(A) can be defined to represent the correspondence between the evaluation parameter of answer length and the evaluation score, where A is the answer.
[0158] If the length of the answer A is within a predefined range [min, max], then L(A) = 1; otherwise, L(A) = 0.
[0159] In one embodiment, the min in the above predefined range can be 1, and the max can be 10.
[0160] In some embodiments, a source function S(A,D) can be defined to represent the correspondence between the evaluation parameter of the ratio of answer segmentation to log segmentation and the evaluation score, where A is the answer and D is the log data.
[0161] If all the information in answer A can be found in log data D, then S(A,D) = 1; otherwise, S(A,D) < 1.
[0162] Segment the answer A and log data D into words, resulting in an answer word list A_list and a log word list D_list. Then, for each word in A_list, check if it appears in D_list. If it appears in both, then S(A,D) = 1; otherwise, S(A,D) < 1.
[0163] In one embodiment, S(A,D) can be defined as the proportion of words in A_list that appear in D_list, i.e.:
[0164] S(A,D) = count(A_list ∩ D_list) / count(A_list) (6)
[0165] Thus, the value of S(A,D) is between [0,1], which fully reflects the coverage of the information in the answer in the log data.
[0166] In some embodiments, a consistency function C(A,Q) can be defined to represent the correspondence between the evaluation parameter of the similarity between the question vector and the answer vector and the evaluation score, where A is the answer and Q is the question.
[0167] If the answer A is semantically consistent with question Q, then C(A,Q) = 1; otherwise, C(A,Q) < 1.
[0168] Each word in question Q and answer A is converted into a word vector using a pre-trained word embedding model.
[0169] The average of all word vectors in question Q is used to obtain the question vector Q_vec; the average of all word vectors in answer A is used to obtain the answer vector A_vec.
[0170] Calculate the cosine similarity between the question vector Q_vec and the answer vector A_vec, i.e., C(A,Q)=cos(Q_vec,A_vec).
[0171] The resulting C(A,Q) value is between [-1,1]. The larger the value, the stronger the semantic consistency between the answer A and the question Q.
[0172] In some embodiments, a similarity function F(A,D) can be defined to represent the correspondence between the evaluation parameter (similarity between the answer vector and the log data vector) and the evaluation score, where A is the answer and D is the log data. F(A,D) can be calculated using methods such as Jaccard similarity.
[0173] In one embodiment, a pre-trained word embedding model is used to convert each word in the answer A and log data D into a word vector.
[0174] The average of all word vectors in answer A is taken to obtain the answer vector A_vec; the average of all word vectors in log data D is taken to obtain the log data vector D_vec.
[0175] Calculate the cosine similarity between the answer vector A_vec and the log data vector D_vec, i.e., F(A,D)=cos(A_vec,D_vec).
[0176] The resulting F(A,D) value is between [-1,1], and the larger the value, the higher the similarity between answer A and log data D.
[0177] In one embodiment, the quality score is obtained by summing the scores corresponding to each evaluation parameter of the question-and-answer data, which can be expressed by the following formula:
[0178] Q(A,Q,D) = L(A) + S(A,D) + C(A,Q) + F(A,D) (7)
[0179] Where Q(A,Q,D) represents the quality fraction.
[0180] Figure 4 This is a schematic diagram of the structure of a question-and-answer data generation device 400 provided in an embodiment of this application. Figure 4 As shown, the device may include a data acquisition module 410, a generation module 420, and an evaluation module 430.
[0181] The acquisition module 410 is used to acquire log data and a set of questions; the log data includes key log information; the set of questions is generated based on the key log information; the set of questions includes the frequency of each question in the set, the importance of the key information of the questions, the similarity of the questions, and the vector entropy of the key information of the questions.
[0182] The generation module 420 is used to calculate the target value of each problem in the problem set based on the frequency of occurrence of problems and the importance of key information of problems, the similarity of problems and the vector entropy of key information of problems. The target value represents the importance and diversity of the problem, and the problem whose target value meets the preset first threshold condition is taken as the first problem.
[0183] The generation module 420 is also used to input the first question and log data into a large-scale language model, extract second key information based on the log data whose relevance to the first question meets a preset second threshold condition, and integrate the second key information to obtain the answer corresponding to the first question.
[0184] The generation module 420 is also used to input the first question and answer into a pre-trained answer correction model, determine the target answer corresponding to the first question based on the correspondence between questions and answers in the answer correction model, generate answer correction suggestion information based on the target answer and the answer, and correct the answer according to the answer correction suggestion information to obtain the first answer corresponding to the first question;
[0185] The generation module 420 is also used to obtain question-and-answer data based on the first question and the first answer corresponding to the first question;
[0186] The evaluation module 430 is used to input question-and-answer data and log data into a pre-built quality evaluation model, determine target evaluation parameters based on question-and-answer data, or question-and-answer data and log data, obtain the quality score corresponding to the target evaluation parameters based on the correspondence between the evaluation parameters and the quality score, and output target question-and-answer data whose quality score meets the preset third threshold condition.
[0187] This application's embodiments optimize question generation by calculating the importance and diversity of each question in a question set, considering the quality of generated questions based on their importance and diversity. By inputting questions and log data into a large-scale language model to generate answers corresponding to the questions, the model not only focuses on the questions themselves but also searches for answers within the context of the questions, enhancing question understanding through contextual information and thus optimizing answer generation. Furthermore, by using multiple evaluation parameters in the quality assessment model to obtain quality scores for question-and-answer data, and selecting question-and-answer data whose quality scores meet preset threshold conditions as target question-and-answer data, a multi-dimensional quality assessment of the question-and-answer data is achieved, thereby optimizing question-and-answer data filtering. Because optimizations have been made in question generation, answer generation, and question-and-answer data filtering, more accurate and comprehensive questions and answers can be generated, effectively ensuring the stability of the quality of generated question-and-answer data.
[0188] The acquisition module 410 is also used to acquire the frequency of occurrence of key information about the problem.
[0189] The question-and-answer data generation device 400 also includes a computing module;
[0190] The computation module is used to convert, for each question, word segments in the key information of the question and word segments in the question into the first word vector of the key information of the question and the second word vector of the question, respectively, through a word embedding model.
[0191] Calculate the mean of the first word vector and the second word vector respectively to obtain the key information vector and the question vector;
[0192] Calculate the similarity between the key information vector of the problem and the problem vector, and use it as the relevance between the key information of the problem and the problem;
[0193] The importance of the key information is obtained by multiplying the relevance between the key information and the question and the frequency of occurrence of the key information.
[0194] The importance of a problem is calculated by multiplying its frequency of occurrence in the problem set with the importance of the key information within the problem.
[0195] The calculation module is also used to convert the word segments in the key information of the question into word vectors of the key information of the question through a word embedding model for each question, calculate the mean of the word vectors of the key information of the question, and obtain the key information vector of the question.
[0196] Calculate the entropy of the key information vector of the problem to obtain the diversity of the key information of the problem;
[0197] Randomly select problems from the set of problems to obtain problem j and problem k;
[0198] The key information vector for question j is obtained by averaging the word vectors of the key information for question j.
[0199] The average of the word vectors of the key information of question k is taken to obtain the key information vector of question k;
[0200] Based on the key information vectors of question j and question k, the similarity between question j and question k is calculated, which serves as the diversity of question j.
[0201] The question-and-answer data generation device 400 also includes a training module;
[0202] The training module is used to obtain a training sample set, which includes multiple training samples, each of which includes a question, an answer, and a correct label.
[0203] The pre-defined BERT model is trained using training samples. If the training stopping condition is met, the trained model is determined to be the answer correction model.
[0204] The training module is also used to input the questions from the training samples into the preset BERT model to obtain the predicted answers to the questions;
[0205] Determine the loss function value of the BERT model based on the predicted answer and the correct label;
[0206] If the loss function value satisfies the training stopping condition, the answer is obtained to correct the model.
[0207] The question-and-answer data generation device 400 also includes a determination module;
[0208] The determination module is used to extract the length of the answers from the question-and-answer data.
[0209] The determination module is also used to segment the answers in the question-and-answer data and the log data into words based on the question-and-answer data and the log data, respectively, to obtain the first word segment of the answer and the second word segment of the log data;
[0210] Calculate the ratio of the first segmentation to the second segmentation, and use it as the ratio of the answer segmentation to the log segmentation.
[0211] The determination module is also used to convert the word segments of the question and the word segments of the answer in the question and answer data into the first word vector of the question and the second word vector of the answer, respectively, based on the question and answer data and through the word embedding model;
[0212] Calculate the mean of the first word vector and the second word vector respectively to obtain the question vector and the answer vector;
[0213] Calculate the similarity between the question vector and the answer vector based on the question vector and the answer vector.
[0214] The determination module is also used to convert the word segments of the answers in the question-and-answer data and the word segments of the log data into the first word vector of the answer and the second word vector of the log data respectively through the word embedding model, based on the question-and-answer data and the log data.
[0215] Calculate the mean of the first word vector and the second word vector respectively to obtain the answer vector and the log data vector;
[0216] Calculate the similarity between the answer vector and the log data vector based on the answer vector and the log data vector.
[0217] Figure 4 The various modules in the illustrated device can achieve Figure 1 The various steps involved, and the corresponding technical effects achieved, will not be elaborated upon here for the sake of brevity.
[0218] Figure 5 A schematic diagram of the hardware structure of the question-and-answer data generation device provided in an embodiment of this application is shown.
[0219] The question-and-answer data generation device may include a processor 501 and a memory 502 storing computer program instructions.
[0220] Specifically, the processor 501 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0221] Memory 502 may include mass storage for data or instructions. For example, and not limitingly, memory 502 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 502 may include removable or non-removable (or fixed) media. Where appropriate, memory 502 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 502 is non-volatile solid-state memory.
[0222] In certain embodiments, the memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Thus, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0223] The processor 501 reads and executes computer program instructions stored in the memory 502 to implement any of the question-and-answer data generation methods in the above embodiments.
[0224] In one example, the question-and-answer data generation device may further include a communication interface 503 and a bus 510. For example, Figure 5 As shown, the processor 501, memory 502, and communication interface 503 are connected through bus 510 and complete communication with each other.
[0225] The communication interface 503 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0226] Bus 510 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 510 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0227] Furthermore, in conjunction with the question-and-answer data generation methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the question-and-answer data generation methods in the above embodiments.
[0228] This application also provides a computer program product, including a computer program, which, when executed, implements any of the question-and-answer data generation methods described in the above embodiments.
[0229] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0230] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0231] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0232] The foregoing flowcharts and / or block diagrams of methods, apparatuses, devices, storage media, and computer program products according to embodiments of this application have described various aspects of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0233] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for generating question-and-answer data, characterized in that, include: Obtain log data and a set of issues; the log data includes key log information. The question set is generated based on the key information in the logs; the question set includes the frequency of each question in the question set, the importance of the key information of the question, the similarity of the questions, and the vector entropy of the key information of the question; Based on the frequency of occurrence of questions in the question set, the importance of key information of the questions, the similarity of the questions, and the vector entropy of key information of the questions, a target value is calculated for each question in the question set. The target value represents the importance and diversity of the questions. Questions whose target values meet a preset first threshold condition are designated as the first questions. The importance of the problem is calculated from the frequency of occurrence and the importance of the key information of the problem; the diversity of the problem is calculated from the similarity of the problem and the vector entropy of the key information of the problem. The first question and the log data are input into a large-scale language model, and the first key information whose relevance to the first question meets a preset second threshold condition is extracted based on the log data. By integrating the first key information, the answer corresponding to the first question is obtained; The first question and the answer are input into a pre-trained answer correction model. Based on the correspondence between questions and answers in the answer correction model, the target answer corresponding to the first question is determined. Answer correction suggestion information is generated based on the target answer and the answer. The answer is corrected according to the answer correction suggestion information to obtain the first answer corresponding to the first question. Based on the first question and the first answer corresponding to the first question, question-and-answer data is obtained; The question-and-answer data and the log data are input into a pre-built quality assessment model. Based on the question-and-answer data, or the question-and-answer data and the log data, target assessment parameters are determined. Based on the correspondence between the assessment parameters and the quality score, the quality score corresponding to the target assessment parameters is obtained. Target question-and-answer data whose quality score meets the preset third threshold condition is output.
2. The question-and-answer data generation method according to claim 1, characterized in that, Also includes: Obtain the frequency of occurrence of key information related to the problem; The target value includes the importance of the problem; The step of calculating the target value for each question in the question set based on the frequency of occurrence of questions in the question set, the importance of key information of the questions, the similarity of the questions, and the vector entropy of the key information of the questions includes: For each question, the word segments in the key information of the question and the word segments in the question are converted into the first word vector of the key information of the question and the second word vector of the question, respectively, through the word embedding model; Calculate the mean values of the first word vector and the second word vector respectively to obtain the key information vector and the question vector. Calculate the similarity between the key information vector of the problem and the problem vector, and use this as the relevance between the key information of the problem and the problem; The importance of the key information about the problem is obtained by multiplying the relevance between the key information about the problem and the problem and the frequency of occurrence of the key information about the problem. The importance of a problem is obtained by calculating the product of its frequency of occurrence in the problem set and the importance of its key information.
3. The question-and-answer data generation method according to claim 1, characterized in that, The target value includes the diversity of the questions; the calculation of the target value for each question in the question set based on the frequency of occurrence of questions in the question set, the importance of key information of the questions, the similarity of the questions, and the vector entropy of key information of the questions includes: For each question, the word segments in the key information of the question are converted into word vectors of the key information of the question through a word embedding model, and the mean of the word vectors of the key information of the question is calculated to obtain the key information vector of the question. Calculate the entropy of the problem's key information vector to obtain the diversity of the problem's key information; Problems j and k are randomly selected from the set of problems. The key information vector for question j is obtained by averaging the word vectors of the key information for question j. The average of the word vectors of the key information of question k is taken to obtain the key information vector of question k; Based on the key information vectors of question j and question k, the similarity between question j and question k is calculated, which is used as the diversity of question j.
4. The question-and-answer data generation method according to claim 1, characterized in that, Before inputting the first question and the answer into the pre-trained answer correction model, the method further includes: Obtain a training sample set, which includes multiple training samples, each of which includes a question, an answer, and a correct label; The pre-defined BERT model is trained using the training samples. If the training stopping condition is met, the trained model is determined to be the answer correction model.
5. The question-and-answer data generation method according to claim 4, characterized in that, The step of training a pre-defined BERT model using the training samples, and determining the trained model as the answer correction model when the training stopping condition is met, includes: The questions from the training samples are input into a pre-defined BERT model to obtain the predicted answers to the questions. Based on the predicted answer and the correct label, determine the loss function value of the BERT model; If the loss function value satisfies the training stopping condition, the corrected model is obtained.
6. The question-and-answer data generation method according to claim 1, characterized in that, The evaluation parameters include the answer length; determining the target evaluation parameters based on the question-and-answer data includes: Based on the question-and-answer data, the length of the answer in the question-and-answer data is extracted.
7. The question-and-answer data generation method according to claim 1, characterized in that, The evaluation parameters include the ratio of answer segmentation to log segmentation; the determination of target evaluation parameters based on the question-and-answer data and the log data includes: Based on the question-and-answer data and the log data, the answers in the question-and-answer data and the log data are segmented into words respectively to obtain the first segment of the answer and the second segment of the log data; Calculate the ratio of the first word segmentation to the second word segmentation, and use it as the ratio of the answer word segmentation to the log word segmentation.
8. The question-and-answer data generation method according to claim 1, characterized in that, The evaluation parameters include the similarity between the question vector and the answer vector; determining the target evaluation parameters based on the question-and-answer data includes: Based on the question-and-answer data, the word segments of the question and the answer in the question-and-answer data are converted into the first word vector of the question and the second word vector of the answer respectively through the word embedding model; Calculate the mean of the first word vector and the second word vector respectively to obtain the question vector and the answer vector; Based on the question vector and the answer vector, calculate the similarity between the question vector and the answer vector.
9. The question-and-answer data generation method according to claim 1, characterized in that, The evaluation parameters include the similarity between the answer vector and the log data vector; the determination of the target evaluation parameters based on the question-and-answer data and the log data includes: Based on the question-and-answer data and the log data, the word segments of the answers in the question-and-answer data and the word segments of the log data are converted into the first word vector of the answers and the second word vector of the log data respectively through the word embedding model; Calculate the mean of the first word vector and the second word vector respectively to obtain the answer vector and the log data vector; Based on the answer vector and the log data vector, calculate the similarity between the answer vector and the log data vector.
10. A question-and-answer data generation device, characterized in that, The device includes: An acquisition module is used to acquire log data and a set of questions; the log data includes key log information; the set of questions is generated based on the key log information; the set of questions includes the frequency of occurrence of each question in the set, the importance of the key information of the questions, the similarity of the questions, and the vector entropy of the key information of the questions. A generation module is used to calculate a target value for each question in the question set based on the frequency of occurrence of questions in the question set, the importance of key information of the questions, the similarity of the questions, and the vector entropy of key information of the questions. The target value represents the importance and diversity of the questions. Questions whose target values satisfy a preset first threshold condition are designated as first questions. The importance of a question is calculated from the frequency of occurrence and the importance of key information of the questions. The diversity of a question is calculated from the similarity of the questions and the vector entropy of key information of the questions. The generation module is further configured to input the first question and the log data into a large-scale language model, extract second key information based on the log data whose relevance to the first question meets a preset second threshold condition, and integrate the second key information to obtain the answer corresponding to the first question. The generation module is further configured to input the first question and the answer into a pre-trained answer correction model, determine the target answer corresponding to the first question based on the correspondence between questions and answers in the answer correction model, generate answer correction suggestion information based on the target answer and the answer, and correct the answer according to the answer correction suggestion information to obtain a first answer corresponding to the first question; The generation module is further configured to obtain question-and-answer data based on the first question and the first answer corresponding to the first question; The evaluation module is used to input the question-and-answer data and the log data into a pre-built quality evaluation model, determine target evaluation parameters based on the question-and-answer data, or the question-and-answer data and the log data, obtain the quality score corresponding to the target evaluation parameters based on the correspondence between the evaluation parameters and the quality score, and output the target question-and-answer data whose quality score meets the preset third threshold condition.
11. A question-and-answer data generation device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the question-and-answer data generation method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the question-and-answer data generation method as described in any one of claims 1-9.
13. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the question-and-answer data generation method as described in any one of claims 1-9.
Citation Information
Patent Citations
Question and answer processing method and device, electronic equipment and storage medium
CN111125335A
Computer system, method of managing a client computer, and storage medium
US20130066869A1
