Question and answer data generation method and device, equipment and storage medium

By calculating the importance and diversity of questions, combining large-scale language models and answer correction models, the generation of Q&A data is optimized, and the problem of unstable Q&A data quality in the existing technology is solved, and more accurate and comprehensive Q&A data generation is achieved.

CN118966336APending Publication Date: 2024-11-15CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +2
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410998328.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing technology lacks accuracy and comprehensiveness when generating Q&A data, resulting in unstable quality of the generated Q&A data and cannot be effectively utilized and analyzed.

Method used

Optimize problem generation by calculating the importance and diversity of each question in the question set; input the question and log data into a large-scale language model to obtain answers, and use pre-trained answer correction models and quality evaluation models to ensure the accuracy of the answers , and completeness; filter the Q&A data through multi-dimensional quality evaluation, and data that meets the preset threshold conditions are used as the target Q&A data.

Benefits of technology

Generate more accurate and comprehensive Q&A data, improve the quality stability of Q&A data generation, ensure the depth and comprehensiveness of the data, and is suitable for training and evaluation of Q&A systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118966336A_ABST
    Figure CN118966336A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer data generation method and device, equipment and a storage medium, and the method comprises the steps: obtaining log data and a question set, calculating a target value of each question in the question set, and taking the question with the target value meeting a first threshold condition as a first question; inputting the first question and the log data into a large-scale language model to obtain an answer corresponding to the first question; inputting the first question and the answer into a pre-trained answer correction model to generate answer correction suggestion information, and correcting the answer according to the answer correction suggestion information to obtain a first answer corresponding to the first question; obtaining question and answer data according to the first question and the first answer corresponding to the first question; and inputting the question and answer data and the log data into a pre-constructed quality evaluation model, determining a target evaluation parameter, and obtaining target question and answer data according to the evaluation parameter. According to the embodiment of the invention, more accurate and comprehensive question and answer data can be generated, and the stability of the generation quality of the question and answer data is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of big data technology, and in particular, relates to a method, device, equipment, storage medium and computer program product for generating question and answer data. Background Art

[0002] Log question-answering data refers to a data set containing questions and corresponding answers, which is usually used to train and evaluate question-answering systems, dialogue systems, and natural language processing models.

[0003] The existing technology has a single method for generating question and answer data, which is directly based on a preset model. The generated question and answer data lacks accuracy and comprehensiveness compared with the original logs, and has unstable quality. Summary of the invention

[0004] The embodiments of the present application provide a question and answer data generation method, apparatus, device, storage medium and computer program product, which can optimize the three aspects of question generation, answer generation and question and answer data filtering, and can generate more accurate and comprehensive question and answer data, thereby ensuring the stability of the quality of question and answer data generation.

[0005] In a first aspect, an embodiment of the present application provides a method for generating question and answer data, the method comprising:

[0006] Obtain log data and question sets; the log data includes log key information; the question set is generated based on the log key information; the question set includes the frequency of occurrence of each question in the question set, the importance of the question key information, the similarity of the question and the vector entropy of the question key information;

[0007] According to the frequency of occurrence of questions in the question set and the importance of key information of the questions, the similarity of the questions and the vector entropy of the key information of the questions, the target value of each question in the question set is calculated, and the target value represents the importance and diversity of the question, and the question whose target value meets the first threshold condition is taken as the first question;

[0008] Inputting the first question and the log data into a large-scale language model, extracting second key information whose relevance to the first question satisfies a second threshold condition based on the log data; integrating the second key information to obtain an answer corresponding to the first question;

[0009] Inputting the first question and the answer into a pre-trained answer correction model, determining a target answer corresponding to the first question based on the correspondence between the question and the answer in the answer correction model, generating answer correction suggestion information based on the target answer and the answer, and correcting the answer according to the answer correction suggestion information to obtain a first answer corresponding to the first question;

[0010] Obtaining question-and-answer data according to the first question and a first answer corresponding to the first question;

[0011] The question and answer data and log data are input into a pre-built quality assessment model, and the target evaluation parameters are determined based on the question and answer data, or the question and answer data and the log data. Based on the correspondence between the evaluation parameters and the quality scores, the quality scores corresponding to the target evaluation parameters are obtained, and the target question and answer data whose quality scores meet the preset third threshold condition are output.

[0012] In a second aspect, an embodiment of the present application provides a question-answer data generating device, the device comprising:

[0013] The acquisition module is used to acquire log data and question sets; the log data includes log key information; the question set is generated based on the log key information; the question set includes the frequency of occurrence of each question in the question set, the importance of the question key information, the similarity of the question and the vector entropy of the question key information;

[0014] A generation module is used to calculate the target value of each question in the question set according to the frequency of occurrence of the questions in the question set and 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, the target value represents the importance and diversity of the questions, and the questions whose target values ​​meet the first threshold condition are taken as the first questions;

[0015] The generation module is further used to input the first question and the log data into the large-scale language model, extract second key information whose relevance to the first question meets the second threshold condition based on the log data; integrate the second key information to obtain an answer corresponding to the first question;

[0016] The generation module is further used to input the first question and the answer into a pre-trained answer correction model, determine a target answer corresponding to the first question based on the correspondence between the question and the answer 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;

[0017] The generating module is further configured to obtain question-answer data according to the first question and the first answer corresponding to the first question;

[0018] The evaluation module is used to input the question and answer data and log data into a pre-built quality evaluation model, determine the target evaluation parameters based on the question and answer data, or the question and answer data and log data, obtain the quality score corresponding to the target evaluation parameter 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] In a third aspect, an embodiment of the present application provides a question and answer data generating device, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the question and answer data generating method as in the first aspect is implemented.

[0020] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the question and answer data generating method of the first aspect is implemented.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the question and answer data generating method as in the first aspect.

[0022] The question and answer data generation method, apparatus, device, storage medium and computer program product of the embodiments of the present application can consider the quality of generated questions based on the importance and diversity of the questions by calculating the importance and diversity of each question in the question set, thereby achieving optimization in question generation; by inputting the questions and log data together into a large-scale language model to generate answers corresponding to the questions, the model is not only based on the questions themselves, but also looks for answers in the context information of the questions, and enhances the understanding of the questions through the context information, thereby achieving optimization in answer generation; the quality score of the question and answer data is obtained through multiple evaluation parameters in the quality evaluation model, and the question and answer data whose quality score meets the preset threshold conditions is used as the target question and answer data, thereby achieving multi-dimensional quality evaluation of the question and answer data, thereby achieving optimization in question and answer data filtering; since optimization is performed in the three aspects of question generation, answer generation and question and answer data filtering, more accurate and comprehensive questions and answers can be generated, thereby effectively ensuring the stability of the quality of question and answer data generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] Figure 1 It is a flowchart of a method for generating question and answer data provided by an embodiment of the present application;

[0025] Figure 2 is a flowchart of a method for calculating the importance of each question in a question set provided by an embodiment of the present application;

[0026] Figure 3 is a flowchart of a method for calculating the diversity of each question in a question set provided by an embodiment of the present application;

[0027] Figure 4 It is a structural diagram of a question and answer data generating device provided by an embodiment of the present application;

[0028] Figure 5 It is a structural diagram of a question and answer data generating device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0029] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0030] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0031] The existing technology for generating question and answer data mostly adopts a general field question generation model, extracts answer fragments from logs, and then uses the answer fragments and the full text of the log as model input to generate questions related to the answer fragments, thereby obtaining log question and answer data.

[0032] The above 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) Relying on question generation models instead of directly using large-scale language models to generate questions and answers, resulting in the generated questions and answers lacking depth and comprehensiveness compared to the original log data.

[0035] (3) There is no evaluation and filtering of the generated question and answer data, which results in unstable quality of the generated question and answer data, which is not conducive to subsequent use and analysis.

[0036] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and computer program product for generating question and answer data. The embodiments of the present application can consider the quality of generated questions based on the importance and diversity of the questions by calculating the importance and diversity of each question in the question set, thereby optimizing the question generation; by inputting the questions and log data into a large-scale language model to generate answers corresponding to the questions, the model is not only based on the questions themselves, but also looks for answers in the context information in which the questions are located, and enhances the understanding of the questions through the context information, thereby optimizing the answer generation; the quality score of the question and answer data is obtained through multiple evaluation parameters in the quality evaluation model, and the question and answer data whose quality score meets the preset threshold conditions is used as the target question and answer data, thereby optimizing the multi-dimensional quality evaluation of the question and answer data filtering; since the three aspects of question generation, answer generation and question and answer data filtering are optimized, more accurate and comprehensive questions and answers can be generated, thereby effectively ensuring the stability of the quality of question and answer data generation.

[0037] The following first introduces the question and answer data generation method provided in the embodiment of the present application.

[0038] Figure 1 FIG. 1 is a flow chart of a method for generating question and answer data provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps: S101 to S106.

[0039] S101: Obtain log data and question set.

[0040] Among them, the log data includes key log information;

[0041] The question set is generated based on the key information in the log;

[0042] The question set includes the frequency of occurrence of each question in the question set, the importance of the key information of the question, the similarity of the question and the vector entropy of the key information of the question.

[0043] In log data, key information may include the time when an event occurred, the type of event, the system components involved, the type of error that occurred, etc. Key information is the basis for understanding the meaning of logs and generating questions and answers. Therefore, in the question and answer data generation method of the embodiment of the present application, it is first necessary to extract log key information from the acquired logs, and generate questions based on the extracted log key information to obtain an initial question set.

[0044] Among them, the frequency of occurrence of each question in the question set, the importance of the key information of the question, the similarity of the question and the vector entropy of the key information of the question are used to calculate the target value of each question in the question set in the next step S102, so as to perform the next step of optimization filtering based on the question set.

[0045] In some embodiments, obtaining key information of the log can be accomplished by using a prompt to call a large-scale language model, parsing and understanding the log data, and then extracting key information.

[0046] Among them, the large-scale language model has acquired the ability to understand and generate natural language after learning a large amount of text data. It can understand the intention of the question and use the extracted key information of the log as the input of the large-scale language model to generate questions related to the key information of the log.

[0047] S102: Calculate the target value of each question in the question set based on the frequency of occurrence of questions in the question set and the importance of key information of the questions, the similarity of the questions and the vector entropy of the key information of the questions. The target value represents the importance and diversity of the questions. The question whose target value meets the preset first threshold condition is taken as the first question.

[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 play an important guiding role in understanding log data, solving problems, and optimizing systems.

[0049] At the same time, the diversity of questions is another important factor in ensuring question coverage and improving question effectiveness. The generated questions should be diverse enough to fully reflect the log data.

[0050] Based on the consideration of the importance and diversity of the questions, this step characterizes the importance and diversity of the questions through target values, and calculates the target value of each question in the question set according to the frequency of occurrence of the questions in the question set and 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, and obtains the questions whose target values ​​meet the preset threshold conditions.

[0051] By considering the importance and diversity of questions at the same time, the questions are optimized and filtered, thereby improving the quality and utility of generated questions, thereby enhancing the effect and application value of the question-answering data generation method.

[0052] The first threshold condition is used to screen out problems with a target value greater than the first threshold by comparing the target value representing the importance and diversity of the problems with the first threshold, thereby screening out problems with higher importance and diversity.

[0053] In some embodiments, the specific value of the first threshold can be manually set according to actual conditions. S103: Input the first question and log data into a large-scale language model, extract first key information whose relevance to the first question meets a preset second threshold condition based on the log data; integrate the first key information to obtain an answer corresponding to the first question.

[0054] The generated question-and-answer data is valuable only when both the question and the answer are correct. In this step, the ability of large-scale language models to understand and generate natural language is used to find an accurate answer to the first question.

[0055] Since the answer to the question is usually hidden in the log data, and the large-scale language model needs to consider the contents of both the question and the log data to generate an accurate answer, the first question with high importance and high diversity obtained in step S102 and the log data are taken as input and input into the large-scale language model.

[0056] The large-scale language model can find key information from the log data whose relevance to the first question meets the threshold condition, and then integrate this key information into a natural language answer.

[0057] The above process of generating answers takes into account the accuracy and completeness of the answers. Accuracy means that the answer must correctly answer the question, and completeness means that the answer must contain all the information required to answer the question. By inputting the first question together with the log data into the large-scale language model, the model not only looks for answers based on the first question itself, but also in the specific context of the first question. The understanding of the first question is enhanced through contextual information, thereby improving the relevance and accuracy of the generated answers.

[0058] The second threshold condition is used to screen out key information with a relevance greater than the second threshold by comparing the relevance between the key information and the question with the second threshold, as key information for integrating the answer corresponding to the first question.

[0059] In some embodiments, the specific value of the second threshold can be manually set according to actual conditions.

[0060] S104: 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 the question and the answer in the answer correction model, generate answer correction suggestion information based on the target answer and the answer, correct the answer according to the answer correction suggestion information, and obtain a first answer corresponding to the first question.

[0061] In order to ensure the accuracy and completeness of the generated answers, based on step S103, the generated answers need to be further verified and corrected.

[0062] In order to accurately and efficiently verify and correct the generated answers, the embodiment of the present application obtains an answer correction model through machine learning algorithm training. The model can evaluate and verify the generated answers according to the content of the questions and log data. If the answers are inaccurate or incomplete, the model can generate answer correction suggestion information, and correct the answers based on the answer correction suggestion information to further improve the quality of the answers.

[0063] This step establishes a self-correction mechanism for answer quality. By introducing a machine learning-driven correction mechanism, it can verify the generated answers in real time to determine their accuracy and completeness. In the case of inaccurate or incomplete answers, it can generate answer correction suggestion information, thereby improving the accuracy and completeness of the generated answers and improving the efficiency and quality of answer generation.

[0064] In some embodiments, the answer correction model obtained by training the machine learning algorithm may include four processes: feature extraction, model selection, model training, and model verification.

[0065] In some embodiments, in the above-mentioned feature extraction process, 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 occurrence of the answer in the log; these features are intended 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, in the above model selection process, based on considerations of model complexity, interpretability, and performance, a BERT model can be selected for training to obtain an answer correction model.

[0067] S105: Obtain question-answer data according to the first question and the first answer corresponding to the first question.

[0068] The first question and the first answer generated in the above steps are sorted to obtain question and answer data to facilitate subsequent multi-dimensional quality evaluation operations.

[0069] S106: Input the question and answer data and log data into a pre-built quality assessment model, determine the target evaluation parameters based on the question and answer data, or the question and answer data and log data, obtain the quality scores corresponding to the target evaluation parameters based on the correspondence between the evaluation parameters and the quality scores, and output the target question and answer data whose quality scores meet the preset third threshold condition.

[0070] Quality assessment can ensure the quality of question and answer data generation to a large extent. By performing a comprehensive quality assessment on the generated question and answer data through the quality assessment model, low-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 question and answer data generation.

[0071] The quality assessment model includes multiple assessment parameters for performing multi-dimensional quality assessment on question and answer data. These assessment parameters are determined based on question and answer data, or question and answer data and log data.

[0072] Among them, the above-mentioned third threshold condition is used to screen out question and answer data with a quality score greater than the third threshold as high-quality question and answer data by comparing the quality score of the above-mentioned question and answer data with the third threshold.

[0073] In some embodiments, the specific value of the third threshold can be manually set according to actual conditions.

[0074] The embodiments of the present application calculate the importance and diversity of each question in the question set, and can consider the quality of generated questions based on the importance and diversity of the questions, thereby achieving optimization in question generation; by inputting questions and log data together into a large-scale language model to generate answers corresponding to the questions, the model is not only based on the questions themselves, but also looks for answers in the context information of the questions, and enhances the understanding of the questions through the context information, thereby achieving optimization in answer generation; the quality score of the question and answer data is obtained through multiple evaluation parameters in the quality evaluation model, and the question and answer data whose quality score meets the preset threshold conditions is used as the target question and answer data, thereby achieving multi-dimensional quality evaluation of the question and answer data, thereby achieving optimization in question and answer data filtering; since optimization is performed in the three aspects of question generation, answer generation and question and answer data filtering, more accurate and comprehensive questions and answers can be generated, thereby effectively ensuring the stability of the quality of question and answer data generation.

[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 the key log information, the question and answer data generation method may further include obtaining the occurrence frequency of the key log information.

[0077] In some embodiments, obtaining the importance of key log information may include the following steps:

[0078] For each key information in the log, the word embedding model is used to convert the word segmentation in the key information in the log and the word segmentation in the question into the first word vector of the key information in the log and the second word vector of the question.

[0079] Calculate the mean of the first word vector and the second word vector respectively to obtain the log key information vector and question vector;

[0080] Calculate the similarity between the log key information vector and the question vector as the correlation between the log key information and the question;

[0081] According to the correlation between the key information in the log and the question and the occurrence frequency of the key information in the log, the product of the correlation and the occurrence frequency is calculated to obtain the importance of the key information in the log.

[0082] Key information is the basis for understanding the meaning of logs and generating questions and answers. The higher the importance of the key information on which the questions are generated, the more accurate the corresponding questions will be, and the higher the correlation with the log data will be, thus making them more in-depth.

[0083] The importance of the key log information can be compared with a preset threshold, and the key log information that meets the preset threshold condition is input into a large-scale language model to generate questions to obtain a question set.

[0084] The word embedding model may be any one of Word2Vec, GloVe, and FastText, and the specific model used is not limited in this embodiment.

[0085] In one embodiment, the importance of key log information can be calculated using the following formula:

[0086] Importance(i) = Frequency(i) * Relevance(i) (1)

[0087] Among them, Frequency(i) represents the frequency of occurrence of log key information i in the log data, and Relevance(i) represents the relevance between log key information i and the generated question.

[0088] The calculation formula of the above Frequency(i) may include:

[0089] Frequency(i)=Count(i) / Length (2)

[0090] Wherein, Count(i) indicates the number of times key information i appears in the log data, and Length indicates the text length of the log.

[0091] The above Relevance(i) 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 of the question.

[0093] In some embodiments, Figure 2 As shown, in step S102, according to the frequency of occurrence of questions in the question set and the importance of key information of the questions, the similarity of the questions and the vector entropy of the key information of the questions, the target value of each question in the question set is calculated, which may include the following steps:

[0094] For each question:

[0095] S201: Convert the word segmentation in the key information of the question and the word segmentation 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 the word embedding model;

[0096] S202: Calculate the mean of the first word vector and the second word vector respectively to obtain the question key information vector and the question vector;

[0097] S203: Calculate the similarity between the question key information vector and the question vector as the correlation between the question key information and the question;

[0098] S204: Calculate the product of the relevance and the frequency of occurrence of the key information of the problem according to the relevance between the key information of the problem and the problem, and obtain the importance of the key information of the problem;

[0099] S205: According to the frequency of occurrence of the question in the question set and the importance of the key information of the question, the product of the frequency of occurrence and the importance is calculated to obtain the importance of the question.

[0100] The importance of a question is an important dimension for measuring the quality of a question. Questions with high importance can usually reflect key information in the log data, and play an important guiding role in understanding log data, solving problems, optimizing systems, etc. For example, for log data of system failures, questions that reflect the cause of the failure and the solution are usually the most important.

[0101] Therefore, the embodiment of the present application takes into account the importance of the question, and characterizes the importance of the question by calculating the importance of the question based on the frequency of occurrence of the question in the question set and the importance of the key information of the question, and selects questions with higher importance to generate question and answer data, thereby improving the value of the 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 the questions in the question set and 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. The following formula can be used for calculation:

[0103] Importance(Q) = Frequency(Q) * Importance(I) (3)

[0104] Among them, Q represents the question, I represents the key information contained in question Q, Frequency(Q) represents the frequency of occurrence of question Q in the question set, and Importance(I) represents the importance of the key information I contained in question Q.

[0105] In some embodiments, Figure 3 As shown, in step S102, according to the frequency of occurrence of questions in the question set and the importance of key information of the questions, the similarity of the questions and the vector entropy of the key information of the questions, the target value of each question in the question set is calculated, which may include the following steps:

[0106] For each question:

[0107] S301: converting word segments in the key information of the question into word vectors of the key information of the question through a word embedding model, calculating the mean of the word vectors of the key information of the question, and obtaining the vector of the key information 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 selecting a question from the question set to obtain question j and question k;

[0110] S304: taking the mean of the word vectors of the key information of question j to obtain the key information vector of question j; taking the mean of the word vectors of the key information of question k to obtain the key information vector of question k;

[0111] S305: Calculate the similarity between question j and question k based on the key information vector of question j and the key information vector of question k as the diversity of question j.

[0112] The diversity of questions is an important factor in ensuring the coverage of questions and improving the effectiveness of questions. In a large amount of log data, there are various events and problems. The questions that need to be generated should also be diverse enough to fully reflect and analyze the log data. For example, for the log data of system performance, the issues that may need to be concerned include the system's operating status, resource usage, performance bottlenecks, and other aspects.

[0113] The diversity of questions is generated by calculating the diversity of questions based on the similarity of questions and the vector entropy of the key information of the questions to characterize the diversity of questions, and questions with more comprehensive diversity are selected to generate question and answer data, thereby improving the value of 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 answering data.

[0115] In one embodiment, the importance of each question in the question set is calculated based on the frequency of occurrence of the questions in the question set and 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. The following formula can be used for calculation:

[0116] Diversity(Q) = 1 - Similarity(Qj,Qk) * Diversity(I) (4)

[0117] Among them, 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] Among them, Diversity (I) can be obtained by calculating the entropy of the key information vector of the problem.

[0119] In one embodiment, Diversity (I) can be calculated using the following formula:

[0120] Diversity(I)=-∑(Frequency(i)*log (Frequency(i))) (5)

[0121] Among them, Frequency(i) represents the frequency of occurrence of key information i in the question.

[0122] In some embodiments, based on any of the above embodiments, the question and answer data generation method may further include adding 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 complement each other. Questions with high importance are not necessarily diverse, and questions with high diversity are not necessarily important. Only by considering the importance and diversity of questions at the same time can we generate questions that are both important and diverse, thereby effectively improving the effect and application value of the automatic construction method of log question and answer data.

[0124] Therefore, in the process of generating questions based on a large-scale language model and log key information in the embodiment of the present application, the importance and diversity of the questions are taken into consideration at the same time, and the sum of the importance and diversity is used as a reference standard for selecting questions, thereby improving the quality utility of question generation, and further improving the effect and application value of generating log question and answer data.

[0125] In one embodiment, the above-mentioned selection of questions with sum values ​​greater than a preset threshold as candidate questions for the log data may be selecting the top ten questions with sum values ​​as the first question of the log segment.

[0126] In some embodiments, before step S104: inputting the first question and the answer into a pre-trained answer correction model, the question and answer data generation method may further include:

[0127] Obtain a training sample set, where the training sample set includes multiple training samples, and each training sample includes a question, an answer, and a correct label;

[0128] The preset BERT model is trained using the training samples, and when the training stop condition is met, the model obtained by the training is determined to be the answer correction model.

[0129] In some embodiments, the above-mentioned use of training samples to train a preset BERT model, when a training stop condition is met, determining that the model obtained by training is an answer correction model may include:

[0130] Input the questions in the training sample into the preset BERT model to obtain the predicted answers corresponding to the questions;

[0131] Determine the loss function value of the BERT model based on the predicted answer and the correct label;

[0132] When the loss function value meets the training stop condition, the answer is obtained and the model is corrected.

[0133] In order to enable the BERT model to learn to predict the correctness of the answer from the characteristics of the question and answer, the BERT model is trained by using a set of instances containing questions, answers and correct labels as training samples, where the correct label represents whether the answer is accurate and complete.

[0134] By using training samples to train the model, the model learns to predict the correctness of the answer from the characteristics of the question and the answer.

[0135] In some embodiments, after the above-mentioned process of training the BERT model is completed, verification data can also be used to verify the performance of the trained BERT model.

[0136] The verification data is predicted by using the trained BERT model, 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 by the embodiment of the present application.

[0137] The validation data is another set of instances that contains questions, answers, and correct labels, but this set of instances is not used to train the model.

[0138] In some embodiments, in step S106, the evaluation parameter may include the length of the answer; determining the target evaluation parameter based on the question and answer data may include: based on the question and answer data, extracting the length of the answer in the question and answer data.

[0139] Answer length is used to assess whether the answer is of appropriate length. Appropriate answer length is a key factor in ensuring that information is easy to understand and digest. Answers that are too short may miss important information, while answers that are too long may cause confusion and confusion to readers. This can be assessed by setting an ideal answer length range. If the answer is within this range, it is considered to be of appropriate length.

[0140] In some embodiments, in step S106, the evaluation parameter may include a ratio of the answer segmentation to the log segmentation; determining the target evaluation parameter based on the question and answer data and the log data may include:

[0141] According to the question-and-answer data and the log data, the answers in the question-and-answer data and the log data are segmented to obtain the first segmentation of the answer and the second segmentation of the log data;

[0142] The ratio of the first and second participles is calculated as the ratio of the answer participle to the log participle.

[0143] The ratio of answer segmentation to log segmentation is used to evaluate whether the information in the answer can be found in the log data. The information in the answer should come 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 the information in the answer can be found in the log.

[0144] In some embodiments, in step S106, the evaluation parameter may include the similarity between the question vector and the answer vector; determining the target evaluation parameter based on the question and answer data may include:

[0145] According to the question-answering data, the word segmentation of the question and the word segmentation of the answer in the question-answering 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 get the question vector and the answer vector;

[0147] Based on the question vector and the answer vector, the similarity between the question vector and the answer vector is calculated.

[0148] The similarity between the question vector and the answer vector is used to evaluate the semantic consistency of the question and answer. Ensuring that the question and answer are semantically consistent means that the answer needs to answer the content of the question and cannot contain information irrelevant to the question. The consistency of the question and answer can be evaluated by calculating their semantic similarity.

[0149] In some embodiments, in step S106, the evaluation parameter may include the similarity between the answer vector and the log data vector; determining the target evaluation parameter based on the question and answer data and the log data may include:

[0150] According to the question-and-answer data and the log data, the word segmentation of the answer in the question-and-answer data and the word segmentation of the log data are converted into the first word vector of the answer and the second word vector of the log data respectively through the word embedding model;

[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] Based on the answer vector and the log data vector, the similarity between the answer vector and the log data vector is calculated.

[0153] The similarity between the answer vector and the log data vector is used to evaluate whether the answer can accurately reflect the content of the log. The similarity between the answer and the log data can be evaluated by calculating the similarity between the answer and the log data, for example, 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 corresponding relationship 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 up to obtain the quality score.

[0156] By combining the scores corresponding to each evaluation parameter, we can obtain the quality score of the question and answer data, which can evaluate the quality of the generated question and answer data and select the question and answer data whose quality score meets the preset threshold conditions 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) may 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 value in the above predefined range may be 1, and the max value may be 10.

[0160] In some embodiments, a source function S(A, D) may be defined to represent the correspondence between an evaluation parameter, i.e., the ratio of answer segmentation to log segmentation, and an 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 the log data D, then S(A,D)=1, otherwise S(A,D)<1.

[0162] Segment the answer A and log data D to get the answer word list A_list and log word list D_list. Then for each word in A_list, check whether it appears in D_list. If both appear, then S(A,D)=1, otherwise S(A,D)<1.

[0163] In one embodiment, S(A,D) can be defined as the ratio of words in A_list that appear in D_list, that is:

[0164] S(A,D) = count(A_list ∩ D_list) / count(A_list) (6)

[0165] In this way, the value of S(A,D) is between [0,1], which fully reflects the degree of coverage of the information in the answer in the log data.

[0166] In some embodiments, a consistency function C(A,Q) may be defined to represent the correspondence between an evaluation parameter, i.e., the similarity between a question vector and an answer vector, and an evaluation score, where A is the answer and Q is the question.

[0167] If the answer A is semantically consistent with the question Q, then C(A,Q)=1, otherwise C(A,Q)<1.

[0168] Use a pre-trained word embedding model to convert each word in question Q and answer A into a word vector.

[0169] Take the average of all word vectors in question Q to get the question vector Q_vec; take the average of all word vectors in answer A to get the answer vector A_vec.

[0170] Calculate the cosine similarity between the question vector Q_vec and the answer vector A_vec, that is, C(A,Q)=cos(Q_vec,A_vec).

[0171] The value of C(A,Q) obtained in this way is between [-1,1]. The larger the value, the stronger the semantic consistency between answer A and question Q.

[0172] In some embodiments, a similarity function F(A, D) may be defined to represent the correspondence between the evaluation parameter of the 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) may 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 the log data D into a word vector.

[0174] Take the average of all word vectors in answer A to get the answer vector A_vec; take the average of all word vectors in log data D to get the log data vector D_vec.

[0175] Calculate the cosine similarity between the answer vector A_vec and the log data vector D_vec, that is, F(A,D)=cos(A_vec,D_vec).

[0176] The value of F(A,D) obtained in this way is between [-1,1]. The larger the value, the higher the similarity between the answer A and the log data D.

[0177] In one embodiment, the scores corresponding to each evaluation parameter of the question and answer data are summed to obtain a quality score, 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] Among them, Q(A,Q,D) represents the quality score.

[0180] Figure 4 4 is a schematic diagram of the structure of a question and answer data generating device 400 provided in an embodiment of the present application. Figure 4 As shown, the apparatus 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 question set; the log data includes log key information; the question set is generated based on the log key information; the question set includes the frequency of occurrence of each question in the question set, the importance of the question key information, the similarity of the question and the vector entropy of the question key information;

[0182] A generating module 420 is used to calculate a target value for each question in the question set according to the frequency of occurrence of the questions in the question set and 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, wherein the target value represents the importance and diversity of the questions, and the questions whose target values ​​meet the preset first threshold condition are taken as the first questions;

[0183] The generation module 420 is further configured to input the first question and the log data into the large-scale language model, extract second key information whose relevance to the first question satisfies a preset second threshold condition based on the log data, and integrate the second key information to obtain an answer corresponding to the first question;

[0184] The generating module 420 is further configured to input the first question and the answer into a pre-trained answer correction model, determine a target answer corresponding to the first question based on the correspondence between the question and the answer 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;

[0185] The generating module 420 is further configured to obtain question-answer data according to the first question and the first answer corresponding to the first question;

[0186] 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 the question and answer data, or the question and answer data and log data, obtain the quality score corresponding to the target evaluation parameter based on the correspondence between the evaluation parameter and the quality score, and output the target question and answer data whose quality score meets the preset third threshold condition.

[0187] The embodiments of the present application calculate the importance and diversity of each question in the question set, and can consider the quality of generated questions based on the importance and diversity of the questions, thereby achieving optimization in question generation; by inputting questions and log data together into a large-scale language model to generate answers corresponding to the questions, the model is not only based on the questions themselves, but also looks for answers in the context information of the questions, and enhances the understanding of the questions through the context information, thereby achieving optimization in answer generation; the quality score of the question and answer data is obtained through multiple evaluation parameters in the quality evaluation model, and the question and answer data whose quality score meets the preset threshold conditions is used as the target question and answer data, thereby achieving multi-dimensional quality evaluation of the question and answer data, thereby achieving optimization in question and answer data filtering; since optimization is performed in the three aspects of question generation, answer generation and question and answer data filtering, more accurate and comprehensive questions and answers can be generated, thereby effectively ensuring the stability of the quality of question and answer data generation.

[0188] The acquisition module 410 is also used to acquire the occurrence frequency of key information of the problem.

[0189] The question and answer data generating device 400 further includes a calculation module;

[0190] A calculation module, for converting, for each question, the word segmentation in the key information of the question and the word segmentation in the question into a first word vector of the key information of the question and a 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 question key information vector and the question vector;

[0192] Calculate the similarity between the key information vector and the question vector as the correlation between the key information and the question;

[0193] According to the relevance between the key information of the problem and the problem and the frequency of occurrence of the key information of the problem, the product of the relevance and the frequency of occurrence is calculated to obtain the importance of the key information of the problem;

[0194] According to the frequency of occurrence of the question in the question set and the importance of the key information in the question, the product of the frequency of occurrence and the importance is calculated to obtain the importance of the question.

[0195] The calculation module is also used to convert the word segmentation in the key information of the question into the word vector of the key information of the question through the word embedding model for each question, calculate the mean of the word vector 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 questions from the question set to obtain question j and question k;

[0198] Take the mean of the word vectors of the key information of question j to obtain the key information vector of question j;

[0199] Take the mean of the word vectors of the key information of question k to obtain the key information vector of question k;

[0200] According to the key information vector of question j and the key information vector of question k, the similarity between question j and question k is calculated as the diversity of question j.

[0201] The question and answer data generating device 400 further includes a training module;

[0202] A training module is used to obtain a training sample set, where the training sample set includes multiple training samples, and each training sample includes a question, an answer, and a correct label;

[0203] The preset BERT model is trained using the training samples, and when the training stop condition is met, the model obtained by the training is determined to be the answer correction model.

[0204] The training module is also used to input the questions in the training samples into the preset BERT model to obtain the predicted answers corresponding to the questions;

[0205] Determine the loss function value of the BERT model based on the predicted answer and the correct label;

[0206] When the loss function value meets the training stop condition, the answer is obtained and the model is corrected.

[0207] The question and answer data generating device 400 further includes a determination module;

[0208] A determination module is used to extract the length of the answer in the question and answer data based on the question and answer data.

[0209] The determination module is further used to segment the answers in the question and answer data and the log data according to the question and answer data and the log data, respectively, to obtain a first segmentation of the answer and a second segmentation of the log data;

[0210] The ratio of the first and second participles is calculated as the ratio of the answer participle to the log participle.

[0211] The determination module is further used to convert the word segmentation of the question and the word segmentation of the answer in the question and answer data into a first word vector of the question and a second word vector of the answer respectively through a word embedding model according to the question and answer data;

[0212] Calculate the mean of the first word vector and the second word vector respectively to get the question vector and the answer vector;

[0213] Based on the question vector and the answer vector, the similarity between the question vector and the answer vector is calculated.

[0214] The determination module is further used to convert the word segmentation of the answer in the question and answer data and the word segmentation of the log data into a first word vector of the answer and a second word vector of the log data respectively through a word embedding model according to 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] Based on the answer vector and the log data vector, the similarity between the answer vector and the log data vector is calculated.

[0217] Figure 4 The various modules in the device shown can be implemented Figure 1 Each step in the above steps can achieve the corresponding technical effect, which will not be repeated here for the sake of brevity.

[0218] Figure 5 A schematic diagram of the hardware structure of a question and answer data generating device provided in an embodiment of the present application is shown.

[0219] The question and answer data generating 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), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0221] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.

[0222] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) 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 the present application.

[0223] The processor 501 implements any one of the question and answer data generating methods in the above embodiments by reading and executing the computer program instructions stored in the memory 502 .

[0224] In one example, the question and answer data generating device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.

[0225] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0226] Bus 510 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0227] In addition, in combination with the question and answer data generation method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the question and answer data generation methods in the above embodiment is implemented.

[0228] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the question and answer data generation methods in the above embodiments.

[0229] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present 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, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in 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, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0231] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. 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 embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0232] The above reference is to the flowchart and / or block diagram of the method, device, equipment, storage medium and computer program product according to the embodiment of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram 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 device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. 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 can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0233] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for generating question and answer data, characterized in that: include: Obtaining log data and a question set; the log data includes key log information; The question set is generated based on the key information of the log; the question set includes the frequency of occurrence of each question in the question set, the importance of the key information of the question, the similarity of the question and the vector entropy of the key information of the question; Calculate the target value of each question in the question set according to the frequency of occurrence of the questions in the question set and 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, wherein the target value represents the importance and diversity of the questions, and take the question whose target value meets the preset first threshold condition as the first question; Inputting the first question and the log data into a large-scale language model, and extracting first key information whose relevance to the first question meets a preset second threshold condition based on the log data; Integrate the first key information to obtain an answer corresponding to the first question; Inputting the first question and the answer into a pre-trained answer correction model, determining a target answer corresponding to the first question based on a correspondence between questions and answers in the answer correction model, generating answer correction suggestion information based on the target answer and the answer, and correcting the answer according to the answer correction suggestion information to obtain a first answer corresponding to the first question; Obtaining question-and-answer data according to the first question and the first answer corresponding to the first question; The question and answer data and the log data are input into a pre-built quality assessment model, and target evaluation parameters are determined based on the question and answer data, or the question and answer data and the log data. Based on the correspondence between the evaluation parameters and the quality scores, the quality scores corresponding to the target evaluation parameters are obtained, and the target question and answer data whose quality scores meet a preset third threshold condition is output.

2. The question-answer data generating method according to claim 1, characterized in that: Also includes: Obtain the frequency of occurrence of key information of the problem; The target value includes the importance of the problem; The calculating the target value of each question in the question set according to the frequency of occurrence of the questions in the question set and 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 comprises: For each question, the word embedding model is used to convert the word segmentation in the key information of the question and the word segmentation in the question into the first word vector of the key information of the question and the second word vector of the question; Calculate the mean of the first word vector and the second word vector respectively to obtain a question key information vector and a question vector; Calculating the similarity between the question key information vector and the question vector as the correlation between the question key information and the question; According to the relevance between the key information of the problem and the problem and the occurrence frequency of the key information of the problem, the product of the relevance and the occurrence frequency is calculated to obtain the importance of the key information of the problem; According to the frequency of occurrence of the question in the question set and the importance of the key information of the question, the product of the frequency of occurrence and the importance is calculated to obtain the importance of the question.

3. The question-answer data generating method according to claim 1, characterized in that: The target value includes the diversity of the questions; the target value of each question in the question set is calculated according to the frequency of occurrence of the questions in the question set and 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, including: For each question, the word embedding model is used to convert the word segmentation in the key information of the question into the word vector of the key information of the question, and the mean of the word vector of the key information of the question is calculated to obtain the key information vector of the question; Calculate the entropy of the key information vector of the problem to obtain the diversity of the key information of the problem; Randomly select a question from the question set to obtain question j and question k; Take the mean of the word vectors of the key information of question j to obtain the key information vector of question j; Take the mean of the word vectors of the key information of question k to obtain the key information vector of question k; Based on the key information vector of question j and the key information vector of question k, the similarity between question j and question k is calculated as the diversity of question j.

4. The question-answer data generating method according to claim 1, characterized in that: Before inputting the first question and the answer into a pre-trained answer correction model, the method further includes: Obtaining a training sample set, wherein the training sample set includes a plurality of training samples, each of the training samples includes a question, an answer, and a correct label; The preset BERT model is trained using the training samples, and when a training stop condition is met, the model obtained by the training is determined to be an answer correction model.

5. The question-answer data generating method according to claim 4, characterized in that: The method of training a preset BERT model using the training sample and determining that the model obtained by the training is an answer correction model when a training stop condition is met includes: Input the questions in the training sample into the preset BERT model to obtain the predicted answers corresponding to the questions; Determining a loss function value of the BERT model according to the predicted answer and the correct label; When the loss function value satisfies the training stop condition, the answer correction model is obtained.

6. The question-answer data generating method according to claim 1, characterized in that: The evaluation parameter includes the length of the answer; and determining the target evaluation parameter 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-answer data generating method according to claim 1, characterized in that: The evaluation parameter includes a ratio of answer segmentation to log segmentation; and determining the target evaluation parameter based on the question and answer data and the log data includes: According to the question-and-answer data and the log data, respectively, segmenting the answer in the question-and-answer data and the log data to obtain a first segmentation of the answer and a second segmentation of the log data; The ratio of the first segmentation to the second segmentation is calculated as the ratio of the answer segmentation to the log segmentation.

8. The question-answer data generating method according to claim 1, characterized in that: The evaluation parameter includes the similarity between the question vector and the answer vector; and determining the target evaluation parameter based on the question and answer data includes: According to 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 respectively converted into a first word vector of the question and a second word vector of the answer by a word embedding model; Calculate the mean of the first word vector and the second word vector respectively to obtain a question vector and an answer vector; Based on the question vector and the answer vector, the similarity between the question vector and the answer vector is calculated.

9. The question-answer data generating method according to claim 1, characterized in that: The evaluation parameter includes the similarity between the answer vector and the log data vector; the determining the target evaluation parameter based on the question and answer data and the log data includes: According to the question and answer data and the log data, respectively converting the word segmentation of the answer in the question and answer data and the word segmentation of the log data into a first word vector of the answer and a second word vector of the log data through a word embedding model; Calculate the means of the first word vector and the second word vector respectively to obtain an answer vector and a log data vector; Based on the answer vector and the log data vector, a similarity between the answer vector and the log data vector is calculated.

10. A question-answer data generating device, characterized in that: The device comprises: An acquisition module, used to acquire log data and a question set; the log data includes log key information; the question set is generated based on the log key information; the question set includes the frequency of occurrence of each question in the question set, the importance of the question key information, the similarity of the question and the vector entropy of the question key information; A generating module, configured to calculate a target value for each question in the question set according to the frequency of occurrence of the questions in the question set and 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, wherein the target value represents the importance and diversity of the questions, and the question whose target value meets a preset first threshold condition is taken as the first question; The generating module is further configured to input the first question and the log data into a large-scale language model, extract second key information whose relevance to the first question satisfies a preset second threshold condition based on the log data; and integrate the second key information to obtain an answer corresponding to the first question; The generating module is further configured to input the first question and the answer into a pre-trained answer correction model, determine a target answer corresponding to the first question based on a 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 generating module is further configured to obtain question-answer data according to the first question and the first answer corresponding to the first question; An 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 parameter based on the correspondence between the evaluation parameter and the quality score, and output the target question and answer data whose quality score meets a preset third threshold condition.

11. A question-answer data generating device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for generating question and answer data as described in any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for generating question and answer data according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the question and answer data generating method as described in any one of claims 1 to 9.

Citation Information

Cited By

  • Question answering method, device and equipment based on multi-model cooperation and storage medium

    CN120804237A

  • Data generation method and electronic equipment

    CN121525766A