Evaluation method and device for question answering model

Through the combination of multiple target extraction strategies and answer evaluation strategies, the problem of misjudgment caused by unreliable answer extraction and single evaluation strategy in the existing technology is solved, and efficient and reliable evaluation of the question answering model is achieved.

CN118550808APending Publication Date: 2024-08-27BEIJING CENTURY TAL EDUCATION TECH CO LTD

Patent Information

Application Number
CN202410659080.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

When the existing technology evaluates the evaluation effect of the question answering model, there are misjudgment problems caused by unreliable answer extraction and a single evaluation strategy, making it difficult to effectively evaluate the answering ability of the model.

Method used

Multiple target extraction strategies are used to extract answers from the output information, and multiple answer evaluation strategies are used for evaluation based on standard answers to generate comprehensive evaluation results to ensure the reliability of the answers and the objectivity of the evaluation.

Benefits of technology

It improves the reliability and efficiency of the evaluation results of the question answering model, avoids misjudgments caused by a single strategy, and ensures the accuracy and comprehensiveness of the evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550808A
    Figure CN118550808A
Patent Text Reader

Abstract

The invention provides a question answering model evaluation method and device, and the method comprises the steps: carrying out the answering of a target question through a to-be-evaluated question answering model, and obtaining the output information of the question answering model; performing answer extraction from the output information by adopting a plurality of preset target extraction strategies to obtain answers corresponding to the plurality of target extraction strategies; determining a to-be-evaluated target answer based on answers corresponding to the multiple target extraction strategies; based on a standard answer corresponding to the target question, evaluating the target answer by adopting a plurality of preset answer evaluation strategies to obtain evaluation results corresponding to the plurality of answer evaluation strategies; and based on the evaluation results corresponding to the multiple answer evaluation strategies, generating an evaluation result of the question answering model. The evaluation efficiency and the reliability of the evaluation result can be effectively guaranteed, and the evaluation effect of the question answering model is comprehensively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of information processing, and in particular to a method and device for evaluating a question answering model. Background Art

[0002] Nowadays, artificial intelligence technology has gradually been applied to the field of education. For example, pre-trained question answering models can be used to automatically answer questions, and the corresponding answer results can be directly output for questions. In many scenarios such as the optimization scenario of the question answering model or the comparison scenario of different models, it is necessary to evaluate the output information of the question answering model in order to understand the performance of the question answering model. However, the relevant technology has a poor evaluation effect on the question answering model. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method and device for evaluating a question answering model.

[0004] According to one aspect of the present disclosure, a method for evaluating a question answering model is provided, including: answering a target question using a question answering model to be evaluated to obtain output information of the question answering model; extracting answers from the output information using a plurality of preset target extraction strategies to obtain answers corresponding to each of the plurality of target extraction strategies; determining a target answer to be evaluated based on the answers corresponding to each of the plurality of target extraction strategies; evaluating the target answer using a plurality of preset answer evaluation strategies based on a standard answer corresponding to the target question to obtain evaluation results corresponding to each of the plurality of answer evaluation strategies; generating an evaluation result of the question answering model based on the evaluation results corresponding to each of the plurality of answer evaluation strategies.

[0005] According to another aspect of the present disclosure, there is provided an evaluation device for a question answering model, comprising: a model answering module, for answering a target question using the question answering model to be evaluated, and obtaining output information of the question answering model; an answer extraction module, for extracting answers from the output information using a plurality of preset target extraction strategies, and obtaining answers corresponding to each of the plurality of target extraction strategies; an answer determination module, for determining a target answer to be evaluated based on the answers corresponding to each of the plurality of target extraction strategies; an answer evaluation module, for evaluating the target answer using a plurality of preset answer evaluation strategies based on a standard answer corresponding to the target question, and obtaining evaluation results corresponding to each of the plurality of answer evaluation strategies; and a model evaluation module, for generating an evaluation result of the question answering model based on the evaluation results corresponding to each of the plurality of answer evaluation strategies.

[0006] The above technical solution provided in the embodiment of the present disclosure can first use the question answering model to be evaluated to answer the target question, and then use a preset multiple target extraction strategy to extract the answer from the output information of the question answering model, so as to effectively ensure the reliability of the answer to be evaluated (that is, the target answer), and avoid the situation that the extracted answer to be evaluated is not the answer that is really required to be evaluated in the model output information, which is easy to appear in the related technology using methods such as a single answer template; on the basis of ensuring the reliability of the target answer to be evaluated, the above method can further use a variety of answer evaluation strategies based on the standard answer of the target question to evaluate the target answer, so as to effectively ensure the reliability of the evaluation result of the question answering model, and avoid the evaluation errors and other problems that may occur when a single strategy is used for evaluation in the related technology. In addition, the above method does not require manual evaluation, which can effectively improve the evaluation efficiency. In summary, the evaluation method of the question answering model provided in the embodiment of the present disclosure can effectively ensure the evaluation efficiency and the reliability of the evaluation results, and comprehensively ensure the evaluation effect of the question answering model.

[0007] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0009] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0010] Figure 1 A flowchart of a method for evaluating a question answering model provided in an embodiment of the present disclosure;

[0011] Figure 2 A flowchart of a method for evaluating a question answering model provided in an embodiment of the present disclosure;

[0012] Figure 3 A schematic diagram of an evaluation process of a question answering model provided in an embodiment of the present disclosure;

[0013] Figure 4 A schematic diagram of the structure of an evaluation device for a question answering model provided in an embodiment of the present disclosure;

[0014] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0017] The term "including" and its variations used in the present disclosure are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0018] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0019] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0020] Figure 1 The present invention provides a flowchart of a method for evaluating a question answering model. The method can be performed by a device for evaluating a question answering model, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S110:

[0021] Step S102: answer the target question using the question answering model to be evaluated, and obtain output information of the question answering model.

[0022] The disclosed embodiments do not restrict the field to which the target question belongs, such as a math question, a physics question, a chemistry question, etc., nor do they restrict the type of the target question, such as a calculation question, a multiple-choice question, an answer question, a fill-in-the-blank question, etc. Any neural network model with the ability to answer questions can be used as a question answering model. In practical applications, questions in different fields can correspond to different question answering models, and questions in multiple fields can correspond to the same question answering model, which is not limited here.

[0023] The question answering model can be a generative model, such as a large language model. The above is only an exemplary description, and the present disclosure embodiment does not limit the structure of the question answering model. The output information of the question answering model includes the answer, and may also include intermediate information such as the analytical reasoning content of the question answering model for the target question.

[0024] Step S104, using a preset plurality of target extraction strategies to extract answers from the output information, and obtaining answers corresponding to the plurality of target extraction strategies.

[0025] Most of the related technologies only rely on specific answer templates to determine the answers from the output information, but the answer templates are less flexible and difficult to adapt to questions in different fields or types. Therefore, it is easy to extract unreliable answers. For example, the output information of the question answering model is finally expressed through reasoning as: "X+Y=A+B, and the result of A+B is C". The answer to be extracted should be C, but the related technology may extract the answer A+B, but miss the answer C that should have been extracted.

[0026] In order to avoid the situation where a single answer extraction method cannot correctly extract the required answer, the embodiment of the present disclosure adopts multiple target extraction strategies for answer extraction. In other words, multiple target extraction methods are used for answer extraction to comprehensively ensure the reliability of the answer finally extracted.

[0027] In some specific implementation examples, the target extraction strategy includes: extracting answers based on preset answer extraction rules, and / or, extracting answers based on a pre-acquired first network model; wherein the answer extraction rules are used to indicate answer extraction based on target key characters; the number of answer extraction rules may be one or more, and different answer extraction rules correspond to different target key characters, such as answer extraction rule 1 corresponding to target key characters such as "the answer is", "the answer is", "answer is", "so", "the answer:", "the result", etc. The above is only an exemplary description. In actual applications, the answer extraction rules can be represented in the form of logical expressions, and the logical expressions can be specifically expressed in a preset language such as code, and the target key characters to be identified are set in each logical expression to quickly identify and extract the answers. The target key characters can be set according to specific structures or patterns such as the subject area and subject type, and are not limited here.

[0028] The first network model is trained based on the first training sample, and the first training sample includes answer text information marked with answers. The number of first network models is one or more, and different first network models correspond to different network structures, and / or different first network models correspond to first training samples of different question categories, such as the first training sample corresponding to the first network model 1 is a set of mathematical calculation questions, the first training sample corresponding to the first network model 2 is a set of mathematical fill-in-the-blank questions, and the first training sample corresponding to the first network model 3 is a set of mathematical geometry questions, etc. It can be understood that different models are good at handling different types of questions, so the focus on extracting answers may also be different, and the processing effects may also be different, thereby effectively ensuring the comprehensiveness and reliability of the extracted answers.

[0029] Step S106, determining the target answer to be evaluated based on the answers corresponding to the various target extraction strategies.

[0030] In practical applications, the answers corresponding to various target extraction strategies can be filtered, and the proportions can be counted to finally determine the answer with the highest credibility as the target answer to be evaluated.

[0031] It is understandable that among the various target extraction strategies, different answer extraction rules require different target key characters to rely on, and different network structures or network structures obtained by using different training samples will also have deviations in their ability to answer questions. Therefore, the extracted answers may all have certain differences. By obtaining the answers corresponding to the various target extraction strategies, the comprehensiveness of the extracted answers can be better guaranteed, and then through comprehensive analysis and other methods, the accuracy of the target answers to be evaluated can be guaranteed to avoid the situation where the required answers cannot be correctly extracted.

[0032] Step S108, based on the standard answer corresponding to the target question, the target answer is evaluated using a preset plurality of answer evaluation strategies to obtain evaluation results corresponding to each of the plurality of answer evaluation strategies.

[0033] Most of the related technologies only use a specific matching algorithm to measure the standard answer and the target answer, so as to obtain the conclusion whether the answer of the question answering model is correct or wrong, but the reliability is poor and it is easy to make misjudgments.

[0034] In order to avoid the above situation, the embodiment of the present disclosure adopts multiple answer evaluation strategies to evaluate the target answer, so as to ensure the reliability of the final result of evaluating the model's answering situation.

[0035] In some specific implementation examples, the answer evaluation strategy includes: evaluating the answer based on a preset answer evaluation rule, and / or evaluating the answer based on a pre-acquired second network model; wherein the answer evaluation rule is used to indicate that the answer evaluation is performed using a preset similarity algorithm, and the similarity algorithm is used to determine the similarity between the answer to be evaluated and the standard answer corresponding to the answer to be evaluated; the number of answer evaluation rules is one or more, and different answer evaluation rules correspond to different similarity algorithms, that is, different similarity measurement methods and different focuses. Taking the target question as a multiple-choice question as an example, assuming that the target question has four options, namely "Option A: 10; Option B: 5; Option C: 100; Option D: 1". One similarity algorithm can directly measure the options of the target answer and the standard answer (such as A), and another similarity algorithm can directly measure the content of the target answer and the standard answer (such as 10), thereby avoiding the situation where the standard answer is A and the model outputs "10" and is judged as a wrong answer. The above is only a simple example. In actual applications, if the answer is "0.667" and the model outputs "1 / 3", different algorithms may have different similarity evaluation criteria for this. By adopting a variety of answer evaluation rules, the objectivity of answer evaluation can be guaranteed as much as possible, avoiding the occurrence of incorrect answer evaluation due to inappropriate algorithm selection.

[0036] The second network model is trained based on the second training samples, and the second training samples include answer samples to be evaluated and standard answer samples corresponding to the answer samples to be evaluated, and the second training samples are annotated with evaluation results corresponding to the evaluation answer samples. The number of second network models is one or more, and different second network models correspond to different network structures, and / or different second network models correspond to different question categories of second training samples, such as calculation questions, multiple-choice questions, fill-in-the-blank questions, etc. Network models with different structures or network models corresponding to different question categories may also have different evaluation focuses, and the evaluation effects are also different. Therefore, evaluation through multiple second network models can also effectively ensure the comprehensiveness and reliability of answer evaluation.

[0037] The above answer evaluation rules and the second network model both evaluate the target answer based on the standard answer. In some specific implementation examples, the evaluation process is the process of matching the standard answer with the target answer. The matching process is also the process of measuring the similarity (closeness) between the standard answer and the target answer. The matching result is the evaluation result. Different rules / models are used, and the final results are also different. Therefore, multiple evaluation results can be obtained for one target answer.

[0038] Step S110, generating an evaluation result of the question answering model based on the evaluation results corresponding to the various answer evaluation strategies.

[0039] On the basis of ensuring the reliability of the extracted target answers through the aforementioned steps, the target answers are further evaluated based on a variety of answer evaluation strategies, and then a comprehensive analysis such as percentage statistics is performed on the various evaluation results, which can effectively ensure the accuracy and reliability of the evaluation results of the question answering model.

[0040] In some implementations, the aforementioned step S106, i.e., the step of determining the target answer to be evaluated based on the answers corresponding to the various target extraction strategies, can be performed as follows:

[0041] The answers corresponding to the various target extraction strategies are screened, and the target answers to be evaluated are determined based on the answers retained after the screening process; wherein the screening process includes but is not limited to: filtering out answers that do not conform to the logic of the question answer. Considering that in actual applications, the extracted answers may not conform to the logic of the question answer due to various reasons, and the logic of the question answer may depend on the question field, such as mathematical answer logic, physical answer logic, etc. In terms of mathematical answer logic, if the extracted answer obviously has unreasonable mathematical logic (such as not conforming to mathematical operation rules, etc.), the answer can be filtered out first to avoid the answer affecting the subsequent analysis process and to avoid the answer from wasting computing power in the subsequent process. The above screening process can effectively save subsequent analysis time and ensure the reliability of the extracted target answer.

[0042] In some specific implementation examples, when determining the target answer to be evaluated based on the answers retained after the screening process, the proportion statistics can be first performed based on the answers retained after the screening process to obtain the proportion statistics results; wherein the proportion statistics results are used to indicate the proportion of the number of each answer retained after the screening process to the total number of answers retained after the screening process; and then the answer with the highest proportion is used as the target answer to be evaluated. For example, 25 answer contents are extracted through 25 target extraction strategies, and 20 answer contents are obtained after the screening process, among which 15 of the 20 answer contents are consistent (assuming that they are all X1), 3 answer contents are consistent (assuming that they are all X2), and there are two different answer contents, namely X3 and X4, which is equivalent to extracting a total of 4 answers, the proportion of answer content X1 is 15 / 20=75%, the proportion of answer content X2 is 3 / 20=15%, and the proportion of answer content X3 and X4 is 1 / 20=5%. At this time, the answer content X1 with the highest proportion can be used as the target answer to be evaluated.

[0043] In some embodiments, if the evaluation results output by the answer evaluation strategy are only binary results (correct answer or wrong answer), the proportion of the binary results can be directly counted, and the evaluation result with the most consistency can be used as the evaluation result. For example, if there are 20 evaluation results in total, 18 evaluation results indicate that the answer is correct, and 2 evaluation results indicate that the answer is wrong, then it is confirmed that the model answers correctly.

[0044] In order to effectively ensure the objectivity and accuracy of the evaluation, in some implementations, the evaluation results are represented in the form of evaluation scores; the aforementioned step S110, i.e., the step of generating the evaluation results of the question answering model based on the evaluation results corresponding to the various answer evaluation strategies, can be performed with reference to the following steps A and B:

[0045] Step A, weighted processing is performed based on the evaluation scores corresponding to each of the multiple answer evaluation strategies to obtain a comprehensive score. In practical applications, a certain weight can be assigned to each answer evaluation strategy, and then weighted processing is performed based on each weight and the corresponding evaluation score to obtain a comprehensive score. The embodiment of the present disclosure does not limit the weights set for different answer evaluation strategies, which can be the same or different, can be pre-set, or can dynamically adjust the weights of different answer evaluation strategies based on multiple evaluation scores. In some specific implementation examples, step A can be performed with reference to the following steps A1 and A2:

[0046] Step A1, using a preset distribution function to count the evaluation scores corresponding to each of the multiple answer evaluation strategies, to obtain distribution intervals corresponding to the multiple evaluation scores. The embodiment of the present disclosure does not impose specific restrictions on the distribution function, such as the distribution function can be a normal distribution, and the distribution of the multiple evaluation scores can be more accurately counted by the distribution function. The above is only an example. In actual applications, multiple score intervals can be simply preset, and then the evaluation scores contained in each interval can be counted.

[0047] Step A2, taking the distribution interval with the largest number of evaluation scores as the target distribution interval, and weighting the evaluation scores in the target distribution interval to obtain a comprehensive score. Assume that the target answer is evaluated by 20 answer evaluation strategies, and 20 evaluation scores are obtained, of which 16 evaluation scores are between 85 and 95 points, and the remaining 4 evaluation scores are 70 points, 83 points, 84 points and 100 points respectively. For the convenience of processing, and in order to avoid the influence of other unreasonable evaluations, at this time, only the 16 evaluation scores between 85 and 95 points can be weighted, that is, the weights of the answer evaluation strategies corresponding to the 16 evaluation scores can be obtained, so as to perform weighted processing on the 16 evaluation scores, or simply set the weights of the 16 evaluation scores to be the same, that is, average the 16 evaluation scores. At this time, the other 4 evaluation scores can not participate in the calculation, and their corresponding weights are set to 0. The above method can easily and quickly obtain a more reliable comprehensive score.

[0048] Step B, generating the evaluation result of the question answering model according to the comprehensive score. The comprehensive score can be directly used as the evaluation result, or the comprehensive score can be further processed to obtain a more accurate evaluation result. In some specific implementation examples, step B can be performed with reference to the following steps B1 and B2:

[0049] Step B1, based on the comparison result between the comprehensive score and the preset threshold, obtain the answer result of the question answering model for the target question; wherein the answer result is used to indicate whether the question answering model answers the target question correctly or incorrectly.

[0050] Specifically, step B1 can be performed with reference to the following (1) and (2):

[0051] (1) When the comprehensive score is greater than a preset threshold, an answer result is obtained to indicate that the question answering model has correctly answered the target question.

[0052] (2) When the comprehensive score is not greater than a preset threshold, an answer result indicating that the question answering model has given an incorrect answer to the target question is obtained; the type of error cause of the question answering model's incorrect answer is obtained, and the answer result is associated with the type of error cause; the type of error cause includes one or more of comprehension error (i.e., question comprehension error), reasoning error, and calculation error. That is, the disclosed embodiment can not only determine whether the model answer is correct or incorrect, but also further obtain and present the type of error cause.

[0053] In some specific implementation examples, based on the output information of the question answering model, the error reason type of the question answering model's answer error can be generated through a preset error analysis model; wherein the training samples of the error analysis model include the wrong answers corresponding to the question samples, and the error reason type corresponding to the wrong answers. In this way, the reason for the question answering model's answer error can be analyzed efficiently and reliably, and by associating the reason with the answer result, the performance of the question answering model can be clearly presented.

[0054] Step B2, based on the answer result of the question answering model for the target question, generate the evaluation result of the question answering model. In practical applications, the answer result can be directly used as the evaluation result of the question answering model for a certain question, or a comprehensive analysis can be performed on multiple answer results to obtain the comprehensive evaluation result of the question answering model.

[0055] Exemplarily, when there are multiple target questions, based on the answer results of the question answering model for each of the multiple target questions, the first questions answered correctly by the question answering model can be counted from the multiple target questions, and the second questions answered incorrectly by the question answering model can be counted from the multiple target questions; then based on the number of first questions, the question types of the first questions, the number of second questions, the question types of the second questions, and the types of error reasons corresponding to the second questions, the evaluation results of the question answering model are generated. In practical applications, the evaluation results can be presented in the form of charts, data, etc., and the evaluation results can not only include the number of first questions, the question types of the first questions, the number of second questions, the question types of the second questions, and the types of error reasons corresponding to the second questions, but also clearly present the proportion of the question types answered correctly, the proportion of the question types answered incorrectly, the proportions corresponding to various error reason types, etc., so as to accurately and reliably present the answering ability of the question answering model for various question types, the focus of the question answering model, etc., so that the user can clearly know the performance of the question answering model, so as to optimize the performance of the question answering model in a targeted manner in the future, or more accurately determine the applicable scenarios of the question answering model, etc.

[0056] In some exemplary embodiments, Figure 2A flowchart of a method for evaluating a question answering model provided in an embodiment of the present disclosure mainly includes the following steps S202 to S216:

[0057] Step S202: answer the target question using the question answering model to be evaluated, and obtain output information of the question answering model.

[0058] Step S204, using a plurality of preset answer extraction rules and a plurality of first network models to extract answers from the output information respectively, to obtain a plurality of answer extraction results.

[0059] Step S206, screening and percentage statistics are performed based on the extraction results of multiple answers to determine the target answer to be evaluated.

[0060] Step S208, based on the standard answer corresponding to the target question, the target answer is evaluated using preset multiple answer evaluation rules and multiple second network models to obtain multiple answer evaluation results.

[0061] Step S210, using a preset distribution function to perform statistics on the evaluation scores corresponding to the various answer evaluation results, to obtain distribution intervals corresponding to the multiple evaluation scores.

[0062] Step S212: taking the distribution interval with the largest number of evaluation scores as the target distribution interval, and performing weighted processing on the evaluation scores in the target distribution interval to obtain a comprehensive score.

[0063] Step S214, based on the comparison result between the comprehensive score and the preset threshold, the answer result of the question answering model for the target question is obtained.

[0064] Step S216, generating an evaluation result of the question answering model according to the answer result of the question answering model for the target question.

[0065] The specific relevant contents of the above steps can be referred to the above content, which will not be repeated here. Through the above method, the evaluation efficiency and the reliability of the evaluation results can be effectively guaranteed, and the evaluation effect of the question answering model can be comprehensively guaranteed.

[0066] For easier understanding, you can also refer to Figure 3 A schematic diagram of the model evaluation process of a question answering model shown in FIG. Figure 3 Take the answer model for mathematics questions as an example, and Figure 3The question-answering question is an example of a large language model. The mathematics data set contains the mathematics questions to be tested and the standard answers corresponding to the mathematics questions. For each mathematics question to be tested in the mathematics data set (that is, the target question), the corresponding reasoning result can be generated by the large language model to be evaluated. The reasoning result is also the output information of the large language model. Then, the corresponding answers are extracted respectively by using each rule in the answer extraction rule set and each model in the answer extraction model set, and then the target answer is obtained by the answer merging operation; then, the target answer can be matched with the standard answer by each rule in the answer matching rule set and each model in the answer matching model set, wherein the answer matching rule belongs to the answer evaluation rule, and the answer matching model belongs to the aforementioned second network model, and the evaluation result of the target answer is obtained by matching the standard answer with the target answer, and the matching result can be used as the evaluation result. Subsequently, multiple matching results are merged (referred to as matching merging operation) to obtain a conclusion that the result is correct or wrong, and in the case of an error result, an error classification operation can be further performed to obtain the error cause category.

[0067] In summary, the evaluation method of the question answering model provided by the embodiment of the present disclosure can first use the question answering model to be evaluated to answer the target question, and then use a preset multiple target extraction strategy to extract the answer from the output information of the question answering model, so as to effectively ensure the reliability of the answer to be evaluated (that is, the target answer), and avoid the situation that the extracted answer to be evaluated is not the answer that is actually required to be evaluated in the model output information, which is easy to occur in the related technology using methods such as a single answer template; on the basis of ensuring the reliability of the target answer to be evaluated, the above method can further use a variety of answer evaluation strategies based on the standard answer of the target question to evaluate the target answer, so as to effectively ensure the reliability of the evaluation result of the question answering model, and avoid the evaluation errors and other problems that may occur when a single strategy is used for evaluation in the related technology. In addition, the above method does not require manual evaluation, which can effectively improve the evaluation efficiency and comprehensively ensure the evaluation effect of the question answering model.

[0068] Corresponding to the aforementioned evaluation method for the question answering model, the embodiment of the present disclosure further provides an evaluation device for the question answering model. Figure 4 This is a schematic diagram of the structure of a test device for a question answering model provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 4 As shown, the evaluation device 400 of the question answering model includes:

[0069] The model answering module 402 is used to answer the target question using the question answering model to be evaluated, and obtain output information of the question answering model;

[0070] The answer extraction module 404 is used to extract answers from the output information using a plurality of preset target extraction strategies to obtain answers corresponding to the plurality of target extraction strategies;

[0071] An answer determination module 406 is used to determine a target answer to be evaluated based on the answers corresponding to the various target extraction strategies;

[0072] The answer evaluation module 408 is used to evaluate the target answer based on the standard answer corresponding to the target question using multiple preset answer evaluation strategies to obtain evaluation results corresponding to each of the multiple answer evaluation strategies;

[0073] The model evaluation module 410 is used to generate an evaluation result of the question answering model based on the evaluation results corresponding to each of the multiple answer evaluation strategies.

[0074] The above-mentioned device provided in the embodiment of the present disclosure can first use the question answering model to be evaluated to answer the target question, and then use a preset multiple target extraction strategy to extract the answer from the output information of the question answering model, so as to effectively ensure the reliability of the answer to be evaluated (that is, the target answer), and avoid the situation that the extracted answer to be evaluated is not the answer that is really required to be evaluated in the model output information, which is easy to appear in the related technology using methods such as a single answer template; on the basis of ensuring the reliability of the target answer to be evaluated, the above-mentioned device can further use a variety of answer evaluation strategies based on the standard answer of the target question to evaluate the target answer, so as to effectively ensure the reliability of the evaluation result of the question answering model, and avoid the evaluation errors and other problems that may occur when a single strategy is used for evaluation in the related technology. In addition, the above-mentioned method does not require manual evaluation, which can effectively improve the evaluation efficiency. In summary, the evaluation method of the question answering model provided in the embodiment of the present disclosure can effectively ensure the evaluation efficiency and the reliability of the evaluation results, and comprehensively ensure the evaluation effect of the question answering model.

[0075] In some embodiments, the target extraction strategy includes: extracting answers based on preset answer extraction rules, and / or extracting answers based on a pre-acquired first network model; wherein the answer extraction rules are used to indicate answer extraction based on target key characters; the first network model is trained based on a first training sample, and the first training sample includes answer text information marked with answers.

[0076] In some embodiments, the number of the answer extraction rules is one or more, and different answer extraction rules correspond to different target key characters; the number of the first network models is one or more, and different first network models correspond to different network structures, and / or different first network models correspond to different question categories corresponding to first training samples.

[0077] In some embodiments, the answer determination module 406 is specifically used to: perform screening processing based on the answers corresponding to each of the multiple target extraction strategies, and determine the target answer to be evaluated based on the answers retained after the screening processing; wherein, the screening processing includes: filtering answers that do not conform to the logic of answering the question.

[0078] In some embodiments, the answer determination module 406 is specifically used to: perform percentage statistics based on the answers retained after the screening process to obtain percentage statistical results; wherein the percentage statistical results are used to indicate the proportion of the number of each answer retained after the screening process to the total number of answers retained after the screening process; and take the answer with the highest proportion as the target answer to be evaluated.

[0079] In some embodiments, the multiple answer evaluation strategies include: answer evaluation based on preset answer evaluation rules, and / or answer evaluation based on a pre-acquired second network model; wherein the answer evaluation rules are used to instruct the use of a preset similarity algorithm to evaluate the answer, and the similarity algorithm is used to determine the similarity between the answer to be evaluated and the standard answer corresponding to the answer to be evaluated; the second network model is trained based on a second training sample, the second training sample includes an answer sample to be evaluated and a standard answer sample corresponding to the answer sample to be evaluated, and the second training sample is annotated with the evaluation result corresponding to the evaluation answer sample.

[0080] In some embodiments, the number of the answer evaluation rules is one or more, and different answer evaluation rules correspond to different similarity algorithms; the number of the second network models is one or more, and different second network models correspond to different network structures, and / or different second network models correspond to different question categories corresponding to the second training samples.

[0081] In some embodiments, the evaluation result is represented in the form of an evaluation score; the model evaluation module 410 is specifically used to: perform weighted processing based on the evaluation scores corresponding to each of the multiple answer evaluation strategies to obtain a comprehensive score; and generate the evaluation result of the question answering model according to the comprehensive score.

[0082] In some embodiments, the model evaluation module 410 is specifically used to: use a preset distribution function to count the evaluation scores corresponding to each of the multiple answer evaluation strategies to obtain distribution intervals corresponding to multiple evaluation scores; use the distribution interval with the largest number of evaluation scores as the target distribution interval, and weight the evaluation scores in the target distribution interval to obtain a comprehensive score.

[0083] In some embodiments, the model evaluation module 410 is specifically used to: obtain the answer result of the question answering model for the target question based on the comparison result between the comprehensive score and a preset threshold; wherein the answer result is used to indicate whether the question answering model answers the target question correctly or incorrectly; and generate the evaluation result of the question answering model according to the answer result of the question answering model for the target question.

[0084] In some embodiments, the model evaluation module 410 is specifically used to: when the comprehensive score is greater than a preset threshold, obtain an answer result indicating that the question answering model has correctly answered the target question; when the comprehensive score is not greater than the preset threshold, obtain an answer result indicating that the question answering model has incorrectly answered the target question; obtain the error cause type of the question answering model's incorrect answer, and associate the answer result with the error cause type; the error cause type includes one or more of understanding errors, reasoning errors, and calculation errors.

[0085] In some embodiments, the model evaluation module 410 is specifically used to: based on the output information of the question answering model, generate the error cause type of the wrong answer of the question answering model through a preset error analysis model; wherein the training samples of the error analysis model include the wrong answers corresponding to the question samples, and the error cause type corresponding to the wrong answers.

[0086] In some embodiments, the model evaluation module 410 is specifically used for: when there are multiple target questions, based on the answer results of the question answering model for each of the multiple target questions, counting the first questions correctly answered by the question answering model from the multiple target questions, and counting the second questions incorrectly answered by the question answering model from the multiple target questions; generating an evaluation result of the question answering model based on the number of the first questions, the question types of the first questions, the number of the second questions, the question types of the second questions, and the types of error reasons corresponding to the second questions.

[0087] The evaluation device for the question answering model provided in the embodiments of the present disclosure can execute the evaluation method for the question answering model provided in any embodiment of the present disclosure, and has the functional modules and beneficial effects corresponding to the execution method.

[0088] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.

[0089] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0090] The exemplary embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present disclosure when executed by the at least one processor.

[0091] The exemplary embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the method according to the embodiments of the present disclosure.

[0092] The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform the method according to the embodiments of the present disclosure.

[0093] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0094] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium, on which computer program instructions are stored, and the computer program instructions, when executed by the processor, cause the processor to execute the evaluation method of the question answering model provided by the embodiment of the present disclosure. The computer-readable storage medium may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0095] refer to Figure 5 , a block diagram of an electronic device 500 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0096] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0097] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the electronic device 500, and the input unit 506 can receive input digital or character information, and generate key signal input related to the user settings and / or function control of the electronic device. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth TM device, a WiFi device, a WiMa5 device, a cellular communication device, and / or the like.

[0098] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above. For example, in some embodiments, the evaluation method of the question answering model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. In some embodiments, the computing unit 501 may be configured to perform the evaluation method of the question answering model by any other appropriate means (e.g., by means of firmware).

[0099] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0101] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0104] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0105] It should be noted that, in this article, relational terms such as "first" and "second" 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 sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0106] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for evaluating a question answering model, comprising: Using the question answering model to be evaluated to answer the target question, and obtaining output information of the question answering model; Extracting answers from the output information using a plurality of preset target extraction strategies to obtain answers corresponding to the plurality of target extraction strategies; Determining a target answer to be evaluated based on the answers corresponding to each of the multiple target extraction strategies; Based on the standard answer corresponding to the target question, the target answer is evaluated using a preset plurality of answer evaluation strategies to obtain evaluation results corresponding to each of the plurality of answer evaluation strategies; Based on the evaluation results corresponding to the multiple answer evaluation strategies, the evaluation results of the question answering model are generated.

2. The method for evaluating the question answering model according to claim 1, wherein: The target extraction strategy includes: extracting answers based on preset answer extraction rules, and / or extracting answers based on a pre-acquired first network model; The answer extraction rule is used to instruct to extract answers according to target key characters; the first network model is trained based on a first training sample, and the first training sample includes answer text information marked with answers.

3. The method for evaluating the question answering model according to claim 2, wherein: The number of the answer extraction rules is one or more, and different answer extraction rules correspond to different target key characters; The number of the first network models is one or more, different first network models correspond to different network structures, and / or different first network models correspond to first training samples belonging to different topic categories.

4. The method for evaluating the question answering model according to claim 1, wherein: The determining of the target answer to be evaluated based on the answers corresponding to the multiple target extraction strategies includes: Screening is performed based on the answers corresponding to each of the multiple target extraction strategies, and the target answers to be evaluated are determined based on the answers retained after the screening; wherein the screening includes: filtering out answers that do not conform to the logic of answering the question.

5. The method for evaluating the question answering model according to claim 4, wherein: The step of determining the target answer to be evaluated based on the answers retained after the screening process includes: Performing percentage statistics based on the answers retained after the screening process to obtain percentage statistics results; wherein the percentage statistics results are used to indicate the proportion of the number of each answer retained after the screening process to the total number of answers retained after the screening process; The answer with the highest proportion is taken as the target answer to be evaluated.

6. The method for evaluating the question answering model according to claim 1, wherein: The answer evaluation strategy includes: performing answer evaluation based on a preset answer evaluation rule, and / or performing answer evaluation based on a pre-acquired second network model; The answer evaluation rule is used to instruct to use a preset similarity algorithm to evaluate the answer, and the similarity algorithm is used to determine the similarity between the answer to be evaluated and the standard answer corresponding to the answer to be evaluated; The second network model is trained based on second training samples, the second training samples include answer samples to be evaluated and standard answer samples corresponding to the answer samples to be evaluated, and the second training samples are annotated with evaluation results corresponding to the evaluation answer samples.

7. The method for evaluating the question answering model according to claim 6, wherein: The number of the answer evaluation rules is one or more, and different answer evaluation rules correspond to different similarity algorithms; The number of the second network models is one or more, different second network models correspond to different network structures, and / or different second network models correspond to second training samples belonging to different topic categories.

8. The method for evaluating the question answering model according to claim 1, wherein: The evaluation result is represented in the form of an evaluation score; The generating of the evaluation result of the question answering model based on the evaluation results corresponding to each of the multiple answer evaluation strategies includes: Performing weighted processing based on the evaluation scores corresponding to the multiple answer evaluation strategies to obtain a comprehensive score; The evaluation result of the question answering model is generated according to the comprehensive score.

9. The method for evaluating the question answering model according to claim 8, wherein: The weighted processing of the evaluation scores corresponding to the multiple answer evaluation strategies to obtain a comprehensive score includes: Using a preset distribution function to count the evaluation scores corresponding to the multiple answer evaluation strategies, to obtain distribution intervals corresponding to the multiple evaluation scores; The distribution interval with the largest number of evaluation scores is taken as the target distribution interval, and the evaluation scores in the target distribution interval are weighted to obtain a comprehensive score.

10. The method for evaluating a question answering model according to claim 8, wherein: Generating the evaluation result of the question answering model according to the comprehensive score includes: Based on the comparison result between the comprehensive score and the preset threshold, the answer result of the question answering model for the target question is obtained; wherein the answer result is used to indicate whether the question answering model has answered the target question correctly or incorrectly; An evaluation result of the question answering model is generated according to the answer result of the question answering model for the target question.

11. The method for evaluating a question answering model according to claim 10, wherein: The step of obtaining the answer result of the question answering model for the target question based on the comparison result between the comprehensive score and the preset threshold value includes: When the comprehensive score is greater than a preset threshold, an answer result indicating that the question answering model has correctly answered the target question is obtained; When the comprehensive score is not greater than a preset threshold, an answer result is obtained, indicating that the question answering model has given an incorrect answer to the target question; the error cause type of the question answering model's incorrect answer is obtained, and the answer result is associated with the error cause type; the error cause type includes one or more of comprehension errors, reasoning errors and calculation errors.

12. The method for evaluating a question answering model according to claim 11, wherein: The obtaining of the error reason type of the question answering model's answer error includes: Based on the output information of the question answering model, the error cause type of the wrong answer given by the question answering model is generated by a preset error analysis model; wherein the training samples of the error analysis model include the wrong answers corresponding to the question samples, and the error cause type corresponding to the wrong answers.

13. The method for evaluating a question answering model according to claim 10, wherein: Generating the evaluation result of the question answering model according to the answer result of the question answering model for the target question includes: In the case where there are multiple target questions, based on the answer results of the question answering model for each of the multiple target questions, counting the first questions correctly answered by the question answering model from the multiple target questions, and counting the second questions incorrectly answered by the question answering model from the multiple target questions; Based on the number of the first questions, the question types of the first questions, the number of the second questions, the question types of the second questions, and the types of error reasons corresponding to the second questions, an evaluation result of the question answering model is generated.

14. A device for evaluating a question answering model, comprising: A model answering module is used to answer the target question using the question answering model to be evaluated, and obtain output information of the question answering model; An answer extraction module, used to extract answers from the output information using a plurality of preset target extraction strategies, and obtain answers corresponding to the plurality of target extraction strategies; An answer determination module, used to determine the target answer to be evaluated based on the answers corresponding to the multiple target extraction strategies; An answer evaluation module is used to evaluate the target answer based on the standard answer corresponding to the target question by using a plurality of preset answer evaluation strategies to obtain evaluation results corresponding to each of the plurality of answer evaluation strategies; The model evaluation module is used to generate an evaluation result of the question answering model based on the evaluation results corresponding to each of the multiple answer evaluation strategies.

Citation Information

Patent Citations

  • Answer quality evaluation method and device, equipment and storage medium

    CN111382573A

  • Answer evaluation method, recording medium, and information processing device

    CN114391154A

  • Question and answer system evaluation method and device, electronic equipment and storage medium

    CN117574103A

  • Model evaluation method and device, electronic equipment and storage medium

    CN117829294A

Cited By

  • Model evaluation method and device, storage medium and program product

    CN119416830A

  • Question and answer screening method and device, electronic equipment and storage medium

    CN120492574A