Single-item training method and device for question and answer model, equipment and medium

By comparing the results of the single-item functional model and the Q&A model, adjusting the number of question statements, and using the target single-item model results to train the initial Q&A model, the existing Q&A model responds to inaccurate answers in the single-item professional field, and improving the single-item functional Q&A capability and user satisfaction of the Q&A model.

CN120163233APending Publication Date: 2025-06-17CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311725015.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The answers to the existing Q&A model training methods in single-item professional fields are inaccurate.

Method used

By determining the single-item functional model and the corresponding question statement, comparing the single-item model results and the Q&A model results, adjusting the number of question statements, generating the target single-item model results, and using it to train the initial question and answer model to improve its Q&A ability in single-item functions.

Benefits of technology

By targetedly enhancing the reply output capabilities of the Q&A model in the single-item functional field, improving user satisfaction, and expanding the coverage of the Q&A model to deal with problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163233A_ABST
    Figure CN120163233A_ABST
Patent Text Reader

Abstract

The invention provides a single-item training method and device for a question and answer model, equipment and a medium. Comprising the steps that a single function model and a first number of corresponding question statements are determined, and the single function model is a single function category in an initial question and answer model; inputting the first number of question statements into a single function model to obtain a single model result, and inputting the first number of question statements into an initial question and answer model to obtain a question and answer model result; comparing the single model result with the question and answer model result, and adjusting the number of question statements according to the comparison result to obtain a second number of question statements; inputting the second number of question statements into the single function model to obtain a target single model result; according to the second number of question statements and the target single model result, training the initial question and answer model to obtain a target question and answer model; therefore, the single reply ability of the question and answer model is enhanced, and the coverage of question processing of the question and answer model is effectively expanded, so that the use satisfaction of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to intelligent question - answering models, and particularly to a single - item training method, device, equipment, and medium for a question - answering model. Background Art

[0002] The application of large artificial intelligence models in the field of natural language processing has become increasingly mature, marking significant progress in question - answering models driven by artificial intelligence technology in aspects such as language understanding, text generation ability, and mathematical question - answering. The model can reply with information corresponding to the input question or prompt.

[0003] In current solutions, most question - answering models based on intelligent technology are trained by crawling a large amount of corpora and can answer questions in single professional fields such as mathematical reasoning, paper writing, and poetry generation.

[0004] However, the existing question - answering model training methods have the problem that the reply answer results in single professional fields are inaccurate. Summary of the Invention

[0005] This application provides a single - item training method, device, equipment, and medium for a question - answering model to solve the problem that the reply answer results in single professional fields of the existing question - answering model training methods are inaccurate.

[0006] In a first aspect, this application provides a single - item training method for a question - answering model, including:

[0007] Determine a single - item function model and a first quantity of corresponding question statements, where the single - item function model is a single function category in the initial question - answering model;

[0008] Input the first quantity of question statements into the single - item function model to obtain a single - item model result, and input the first quantity of question statements into the initial question - answering model to obtain a question - answering model result;

[0009] Compare the single - item model result and the question - answering model result, and adjust the quantity of question statements according to the comparison result to obtain a second quantity of question statements;

[0010] Input the second quantity of question statements into the single - item function model to obtain a target single - item model result;

[0011] Train the initial question - answering model according to the second quantity of question statements and the target single - item model result to obtain a target question - answering model.

[0012] In an embodiment of this application, determining a single - item function model and a first quantity of corresponding question statements includes:

[0013] Determine the model type of the single - item function model;

[0014] Generate a first quantity of corresponding question statements according to the model type.

[0015] In the embodiments of the present application, generating a first quantity of corresponding question statements according to the model type includes:

[0016] If the model type is a language type, determine a question statement example library for the single-function model of the language type;

[0017] Determine an initial language question statement from the question statement example library;

[0018] Generate a first quantity of question statements that satisfy the statement similarity threshold with the initial language question statement according to the initial language question statement and a preset similar language generation model.

[0019] In the embodiments of the present application, generating a first quantity of corresponding question statements according to the model type includes:

[0020] If the model type is a mathematical type, determine a question statement example library for the single-function model of the mathematical type;

[0021] Determine an initial mathematical question statement from the question statement example library;

[0022] Perform information replacement on the numerical information in the initial mathematical question statement to generate a first quantity of mathematical question statements.

[0023] In the embodiments of the present application, compare the single-model result and the Q&A model result, and adjust the quantity of question statements according to the comparison result to obtain a second quantity of question statements, including:

[0024] If the model type is a language type, compare the language texts of the Q&A model result and the single-model result to obtain the text similarity between the Q&A model result and the single-model result;

[0025] Determine the quantity of Q&A model results with a text similarity higher than the preset similarity threshold;

[0026] If the model type is a mathematical type, compare the answer information of the Q&A model result and the single-model result to obtain the quantity of Q&A model results with the same answer information as the single-model result;

[0027] Determine the second quantity according to the quantity of Q&A model results, and obtain a second quantity of question statements.

[0028] In the embodiments of the present application, determine the second quantity according to the quantity of Q&A model results, and obtain a second quantity of question statements, including:

[0029] Determine the ratio of the quantity of Q&A model results to the first quantity;

[0030] A comparison ratio and a preset ratio;

[0031] If the ratio is higher than the preset ratio, adjust the second quantity to a first preset quantity;

[0032] If the ratio is not higher than the preset ratio, adjust the second quantity to a second preset quantity, and the second preset quantity is higher than the first preset quantity.

[0033] In an embodiment of the present application, according to the problem statements of the second quantity and the target single-item model results, the initial question-and-answer model is trained to obtain a target question-and-answer model, including:

[0034] Add the problem statements of the second quantity and the corresponding target single-item model results to the training corpus of the initial question-and-answer model;

[0035] Train the initial question-and-answer model according to the training corpus to obtain a target question-and-answer model.

[0036] In a second aspect, the present application provides a single-item training device for a question-and-answer model, and the device includes:

[0037] A problem statement determination module, configured to determine a single-item function model and the corresponding problem statements of the first quantity, and the single-item function model is a single function category in the initial question-and-answer model;

[0038] A model result generation module, configured to input the problem statements of the first quantity into the single-item function model to obtain single-item model results, and input the problem statements of the first quantity into the initial question-and-answer model to obtain question-and-answer model results;

[0039] A model result comparison module, configured to compare the question-and-answer model results and the single-item model results, and adjust the quantity of the problem statements according to the comparison results to obtain the problem statements of the second quantity;

[0040] A target result generation module, configured to input the problems of the second quantity into the single-item function model to obtain target single-item model results;

[0041] A model training module, configured to train the initial question-and-answer model according to the problem statements of the second quantity and the target single-item model results to obtain a target question-and-answer model.

[0042] In a third aspect, the present application provides a device, including: a processor, and a memory communicatively connected to the processor;

[0043] The memory stores computer-executable instructions;

[0044] The processor executes the computer-executable instructions stored in the memory to implement the method of the present application.

[0045] Fourthly, the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method of the present application when executed by a processor.

[0046] The single-item training method, device, equipment and medium of the Q&A model provided by the present application determine a single-item function model and a first quantity of corresponding question statements, where the single-item function model is a single function category in the initial Q&A model; input the first quantity of question statements into the single-item function model to obtain a single-item model result, and input the first quantity of question statements into the initial Q&A model to obtain a Q&A model result; compare the single-item model result and the Q&A model result, and adjust the quantity of question statements according to the comparison result to obtain a second quantity of question statements; input the second quantity of question statements into the single-item function model to obtain a target single-item model result; and train the initial Q&A model according to the second quantity of question statements and the target single-item model result to obtain a target Q&A model.

[0047] In this way, by comparing the model results output by the single-item function model and the Q&A model, the problems existing in the Q&A model in the aspect corresponding to the single-item function model are determined. Then, corresponding types of questions and the model results output by the single-item function model are provided as new added corpus for these problems, and the model is trained according to the supplemented model corpus, so as to enhance the Q&A ability of the model in the single-item function aspect and improve the user's satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0049] Figure 1 It is a schematic flowchart of a single-item training method of a Q&A model provided by an embodiment of the present application;

[0050] Figure 2 It is a schematic flowchart of another single-item training method of a Q&A model provided by an embodiment of the present application;

[0051] Figure 3 It is a schematic structural diagram of a single-item training device of a Q&A model provided by an embodiment of the present application;

[0052] Figure 4 It is a structural block diagram of a device for executing the single-item training method of a Q&A model according to an embodiment of the present application.

[0053] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and will be described in more detail hereinafter; these drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Description of the Embodiments

[0054] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0055] The initial question-and-answer model is a question-and-answer model that can output corresponding reply information according to various types of questions input by users. For example, when the user inputs a mathematical question such as "What is the sum of 3.5 and 2.6?", the question-and-answer model can output the answer 6.1; when the user inputs a language question such as "Generate a poem", the question-and-answer model can output a poem; there may be a problem of low accuracy when the initial question-and-answer model generates reply information. Therefore, it is necessary to perform corresponding model training on the initial question-and-answer model to improve the accuracy.

[0056] The single-function model is a model with a specific functional category in the initial question-and-answer model. It can be a mathematical reasoning model, or a paper writing model, or a poem generation model, etc. with specific single functions. The single-function model has a strong single-type generation function and can output content of a specific type that better meets the user's needs. Therefore, according to the reply information generated by the single-function model, corresponding model training can be performed on the initial question-and-answer model for this type.

[0057] In the prior art, the question-and-answer model performs poorly in some single skills, such as specific types like mathematical reasoning, paper writing, and poem generation, and often outputs incorrect information. The reason is that the giant corpus used in training is based on web crawling, and the special data for the above single skills accounts for a relatively small proportion, resulting in the chatbot being unable to learn the answering methods for questions of the above categories; at the same time, the disadvantages of the existing technologies for enhancing the single skills of the question-and-answer model include that they are only applicable to specific skill robots, form standard corpus by converting keywords in the input statement, and directly give results by applying the model corresponding to the skill, and cannot be applied to the question-and-answer model to obtain standard corpus; and the models using this technology lack the ability of semantic understanding and context learning, and are inferior to the performance of the question-and-answer model in the actual human-computer interaction scenario.

[0058] In order to solve the above problems, the embodiment of the present application proposes a single training method for a question-answering model, which uses a specific type of single function model to generate a corresponding single training corpus for the shortcomings of the initial question-answering model in this type of question, so as to improve the single ability of this type. Based on this solution, the selected single type ability of the question-answering model can be enhanced, so that the user can obtain the generation information of the single type output by the question-answering model when using the question-answering model, which effectively expands the coverage of the question-answering model in processing problems.

[0059] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0060] Figure 1 A flowchart of a single training method for a question-answering model provided in an embodiment of the present application. Figure 1 As shown. The single training method of the question-answering model may include the following steps:

[0061] S110. Determine a single function model and a first number of corresponding question statements, where the single function model is a single function category in the initial question-answering model.

[0062] Among them, the first number is the number of question statements input into the single function model, which can be a self-set number value; to ensure the accuracy of model training, it can generally be set to 10 or more.

[0063] The corresponding question statement is a question statement with the same function type as the single function model. For example, if the single function model is a single model of mathematical reasoning type, the corresponding question statement can be a question of mathematical reasoning type such as "calculate 3.5 plus 2.6 to find out what it is?" or "What is the square root of 25?". The corresponding question statement can be determined from the question example library that comes with the single function model, or it can be crawled. The specific method of obtaining the question statement is not limited in this embodiment, as long as the question corresponding to the function type of the single function model is obtained.

[0064] Based on this, the function type that needs to be enhanced in the initial question-answering model can be used to determine the single function model and question statement of this type, so that the initial question-answering model can be trained with the subsequent single function model and question statement of this type.

[0065] S120. Input the first number of question statements into a single functional model to obtain a single model result, and input the first number of question statements into an initial question-answering model to obtain a question-answering model result.

[0066] Among them, the single-item model result is the corresponding output information generated by the single-function model according to the input question statement, and the Q&A model result is the corresponding output information generated by the initial Q&A model according to the input question statement. Since the single-function model is a model with strong generation function in this single-item type, the single-item result generated by the single-function model is generally more accurate than the model result generated by the initial Q&A model.

[0067] Based on this, by inputting the first quantity of question statements into the single-function model and the initial Q&A model respectively, the single-item model result and the Q&A model result are obtained, so as to determine whether it is necessary to train the initial Q&A model in the generation ability of this single-item type according to the model results, thereby specifically improving the output function of the Q&A model in this single-item type.

[0068] S130. Compare the single-item model result and the Q&A model result, and adjust the quantity of the question statements according to the comparison result to obtain the second quantity of question statements.

[0069] Among them, the comparison can be to perform corresponding content comparison on the single-item model result and the Q&A model result according to the model type of the single-function model, so as to determine whether the single-item model result and the Q&A model result meet the requirement of content consistency, that is, whether the generation ability of the initial Q&A model for the questions in this single-item type meets the requirement.

[0070] The comparison result can represent whether the content of the Q&A model result and the single-item model result meets the preset comparison requirement, so as to adjust the quantity of the question statements.

[0071] Based on this, by comparing the single-item model result and the Q&A model result, the quantity of the question statements is adjusted according to the obtained comparison result, so as to train the initial Q&A model according to the second quantity of question statements subsequently, making the model training more targeted at the deficiencies of the initial Q&A model in this single-item type.

[0072] S140. Input the second quantity of question statements into the single-function model to obtain the target single-item model result.

[0073] Based on this, by inputting the second quantity of question statements into the single-function model, the target result generated by the single-function model for the question statements is obtained, so as to train the initial Q&A model according to the second quantity of question statements and the target single-item model result subsequently, thereby enhancing the output ability of the initial Q&A model in this single-item type.

[0074] S150. Train the initial Q&A model according to the second quantity of question statements and the target single-item model result to obtain the target Q&A model.

[0075] Based on this, through the second number of question statements and the target single model results, the initial question-answering model's generation ability for this single type is trained in a targeted manner, thereby obtaining a target question-answering model, which can generate information that meets user requirements for questions of this single type.

[0076] Based on the above embodiment, the present application further provides a feasible implementation method of determining the corresponding question statement by determining the type of the single function model in S110, including:

[0077] Determine the model type of the single function model;

[0078] Based on the model type, a first number of corresponding question sentences are generated.

[0079] The model type is the functional type corresponding to the single functional model, for example, the model type corresponding to the mathematical reasoning model is the mathematical reasoning class.

[0080] Based on this, by determining the function type corresponding to the single function model, the question statement corresponding to the function type is determined.

[0081] Based on the feasible implementation of S110 above, the present application further provides a process of generating a corresponding language question sentence according to the language model type:

[0082] If the model type is a language type, then determine a sample library of question statements for a single function model of the language type;

[0083] Determine the initial language question statement from the question statement sample library;

[0084] A first number of question sentences that meet a sentence similarity threshold with the initial language question sentence are generated according to the initial language question sentence and a preset similarity sentence generation model.

[0085] Among them, the language type can be a model type of language such as writing papers and generating poems.

[0086] The question statements in the question statement example library are question statements corresponding to the function type of the single function model. The question statement example library can be the example library that comes with the single function model, or it can be an example library built by crawling or other means. This embodiment does not impose any restrictions on this.

[0087] The preset similar language generation model is a pre-set model for generating similar question sentences of the initial language question sentence. The similar language generation model can output similar question sentences that meet the sentence similarity threshold based on the input initial language question sentence.

[0088] The sentence similarity threshold is used to determine the similarity between the generated problem sentence and the initial language problem sentence. The sentence that meets the sentence similarity threshold is a qualified similar sentence and can be used to determine the first quantity of problem sentences in the single-function model.

[0089] Based on this, by determining that the model type of the single-function model is a language type, the initial language problem sentence is determined from the problem sentence example library, and the initial language problem sentence is input into a preset similar sentence generation model to obtain the output problem sentences of the same type, so as to generate corresponding language-type problem sentences according to the language model type.

[0090] On the basis of the feasible implementation manner of S110 above, the present application further provides a process for generating corresponding mathematical problem sentences according to the mathematical model type:

[0091] If the model type is a mathematical type, the problem sentence example library of the single-function model of the mathematical type is determined;

[0092] The initial mathematical problem sentence is determined from the problem sentence example library;

[0093] The digital information in the initial mathematical problem sentence is replaced to generate the first quantity of mathematical problem sentences.

[0094] Among them, the digital information is the numbers in the title of the initial mathematical problem sentence. For example, if the initial mathematical problem sentence is "Calculate what is 3.5 plus 2.6?", the digital information is "3.5" and "2.6".

[0095] Based on this, by replacing the digital information in the initial mathematical problem sentence determined from the problem sentence example library, the first quantity of problem sentences of the same type as the initial mathematical problem is generated, so as to generate corresponding mathematical problem sentences according to the mathematical model type.

[0096] On the basis of the above embodiments, the present application further provides a feasible implementation manner of S150 for adding the second quantity of problem sentences and the target single model result to the corpus, and then training the initial question-answer model according to the corpus, including:

[0097] Add the second quantity of problem sentences and the corresponding target single model result to the training corpus of the initial question-answer model;

[0098] Train the initial question-answer model according to the training corpus to obtain the target question-answer model.

[0099] Among them, the training corpus is the corpus of the initial question-answer model, and the model can be trained according to the corpus in the training corpus, so as to improve the output ability of the question-answer model.

[0100] Based on this, by adding a second quantity of question statements and corresponding target single model results to the training corpus of the initial question-answering model, the corpus is sufficiently supplemented, so that the initial question-answering model can be trained according to the corpus, enhancing the reply output ability of the question-answering model and effectively expanding the coverage of questions that the question-answering model can handle.

[0101] In this embodiment, in order to generate question statements corresponding to the model type of the single-function model, so as to train the initial question-answering model according to the question statements, and further improve the accuracy of the reply output ability of the question-answering model in the single-function field, the initial question statements can be determined through the question statement example library of the single-function model. If the model type is a language type, a question statement that meets the semantic similarity requirement with the initial question statement can be generated through a similar language generation model; if the model type is a mathematical type, by replacing the numerical information in the initial question statement, a question statement of the same type as the initial mathematical question statement can be generated. In this way, the initial question-answering model is trained according to the generated question statements, so as to determine the accuracy of the output ability of the initial question-answering model for this type of question, in order to specifically enhance the output reply ability of the question-answering model.

[0102] Figure 2 The flowchart of another single training method of the question-answering model provided by the embodiment of the present application is as Figure 2 shown. The single training method of the question-answering model may include the following steps:

[0103] S210. Determine a single-function model and a first quantity of corresponding question statements, where the single-function model is a single function category in the initial question-answering model.

[0104] S220. Input the first quantity of question statements into the single-function model to obtain single model results, and input the first quantity of question statements into the initial question-answering model to obtain question-answering model results.

[0105] In this embodiment, the specific implementation manners of steps S210 to S220 can refer to the content in the foregoing embodiment and will not be elaborated here.

[0106] S230. If the model type is a language type, compare the language texts of the question-answering model results and the single model results to obtain the text similarity between the question-answering model results and the single model results.

[0107] Among them, the text similarity characterizes the similarity between the text contents of the question-answering model results and the single model results.

[0108] Based on this, if the model type is a language type, compare the language texts of the question-answering model results and the single model results to determine the text similarity between the two.

[0109] S240. Determine the number of Q&A model results with text similarity higher than a preset similarity threshold.

[0110] Among them, the preset similarity threshold is a threshold set in advance for determining the text similarity between the Q&A model result and the single model result. If the text similarity of the Q&A model result is higher than this preset similarity threshold, it indicates that the Q&A model result meets the similarity requirement.

[0111] That the text similarity is higher than the preset similarity threshold indicates that the text similarity between the Q&A model result and the single model result meets the requirement, that is, the initial Q&A model has a strong output ability in answering this language question.

[0112] Based on this, through the preset similarity threshold, determine the number of Q&A model results with text similarity higher than this threshold.

[0113] S250. If the model type is a mathematical type, compare the answer information of the Q&A model result and the single model result to obtain the number of Q&A model results with the same answer information as the single model result.

[0114] Among them, the same answer information indicates that the reply information of the Q&A model result is consistent with that of the single model result, that is, the initial Q&A model has a strong output ability in answering this mathematical question.

[0115] Based on this, if the model type is a mathematical type, compare the answers of the Q&A model result and the single model result to determine the number of Q&A model results with the same answer.

[0116] S260. According to the number of Q&A model results, determine the second quantity and obtain the question statements of the second quantity.

[0117] Based on this, the second quantity can be determined according to the number of Q&A model results, so as to generate the question statements of the second quantity for subsequent model training of the initial Q&A model.

[0118] S270. Input the question statements of the second quantity into the single-functional model to obtain the target single model result.

[0119] S280. Train the initial Q&A model according to the question statements of the second quantity and the target single model result to obtain the target Q&A model.

[0120] In this embodiment, the specific implementation manners of steps S270 to S280 can refer to the content in the foregoing embodiments and will not be elaborated here.

[0121] Based on the feasible implementation manners of S260 above, the present application further provides a process for determining a second quantity according to the comparison result between the quantity of the question-and-answer model results and a preset ratio:

[0122] Determine the ratio of the quantity of the question-and-answer model results to the first quantity;

[0123] Compare the ratio with the preset ratio;

[0124] If the ratio is higher than the preset ratio, adjust the second quantity to the first preset quantity;

[0125] If the ratio is not higher than the preset ratio, adjust the second quantity to the second preset quantity, and the second preset quantity is higher than the first preset quantity.

[0126] The preset ratio is a ratio preset for comparing the quantity relationship between the quantity of the question-and-answer model results and the first quantity. If the ratio of the quantity of the question-and-answer model results to the first quantity is greater than the preset ratio, it indicates that the initial question-and-answer model has a strong output ability in replying to the type of the entire question statement; if the ratio of the quantity of the question-and-answer model results to the first quantity is not greater than the preset ratio, it indicates that the initial question-and-answer model has a weak output ability in replying to the type of the entire question statement.

[0127] The first preset quantity and the second preset quantity are preset quantity values, and the second preset quantity is higher than the first preset quantity; if the ratio is not higher than the preset ratio, that is, the initial question-and-answer model has a weak output ability in replying to the type of the entire question statement, at this time, the generation quantity of this type of question statement can be increased accordingly, so as to better train the initial question-and-answer model through a large number of generated question statements.

[0128] Based on this, according to the comparison result between the ratio of the quantity of the question-and-answer model results to the first quantity and the preset ratio, the output ability of the initial question-and-answer model in replying to the type of the entire question statement is determined, and the second quantity is adjusted, so as to realize targeted training of the initial question-and-answer model and improve the single-item output ability of the question-and-answer model.

[0129] In this embodiment, in order to adjust the second quantity according to the comparison result between the single-item model result and the question-and-answer model result, so as to specifically enhance the initial question-and-answer model and improve the accuracy of the reply output ability of the question-and-answer model in the single-function field, the specific comparison method between the single-item model result and the question-and-answer model result can be determined according to the function type of the single-function model. The single-item model of the language type can be compared according to the text similarity; the single-item model of the mathematical type can be compared according to whether the answers are the same. In this way, by comparing the model generation results of the single-item model and the initial question-and-answer model, the question type to be enhanced in the initial question-and-answer model is determined, and accordingly, the generation quantity of the training questions of this type is increased, realizing the targeted supplement of the corpus of the question-and-answer model, improving the output result quality of the question-and-answer model for this type of questions, and thus better meeting the user's needs.

[0130] Figure 3 FIG. 4 is a schematic structural diagram of a single-item training device 300 for a question-and-answer model provided by an embodiment of the present application, as Figure 3 shown. The single-item training device 300 for the question-and-answer model includes: a question statement determination module 310, a model result generation module 320, a model result comparison module 330, a target result generation module 340, and a model training module 350.

[0131] The question statement determination module 310 is configured to determine the corresponding question statements of the single-function model and the first quantity, and the single-function model is a single function category in the initial question-and-answer model;

[0132] The model result generation module 320 is configured to input the first quantity of question statements into the single-function model to obtain a single-item model result, and input the first quantity of question statements into the initial question-and-answer model to obtain a question-and-answer model result;

[0133] The model result comparison module 330 is configured to compare the question-and-answer model result and the single-item model result, and adjust the quantity of the question statements according to the comparison result to obtain the second quantity of question statements;

[0134] The target result generation module 340 is configured to input the second quantity of questions into the single-function model to obtain a target single-item model result;

[0135] The model training module 350 is configured to train the initial question-and-answer model according to the second quantity of question statements and the target single-item model result to obtain a target question-and-answer model.

[0136] In the embodiment of the present application, the question statement determination module 310 may specifically be further configured to:

[0137] Determine the model type of the single-function model;

[0138] Generate a first quantity of corresponding question statements according to the model type.

[0139] In an embodiment of the present application, the question statement determination module 310 may further specifically be used for:

[0140] If the model type is a language type, determine a question statement example library of a single-functional model of the language type;

[0141] Determine an initial language question statement from the question statement example library;

[0142] Generate a first quantity of question statements that satisfy the statement similarity threshold with the initial language question statement according to the initial language question statement and a preset similar language generation model.

[0143] In an embodiment of the present application, the question statement determination module 310 may further specifically be used for:

[0144] If the model type is a mathematical type, determine a question statement example library of a single-functional model of the mathematical type;

[0145] Determine an initial mathematical question statement from the question statement example library;

[0146] Perform information replacement on the numerical information in the initial mathematical question statement to generate a first quantity of mathematical question statements.

[0147] In an embodiment of the present application, the model result comparison module 330 may further specifically be used for:

[0148] If the model type is a language type, compare the language texts of the Q&A model result and the single-model result to obtain the text similarity between the Q&A model result and the single-model result;

[0149] Determine the number of Q&A model results with a text similarity higher than a preset similarity threshold;

[0150] If the model type is a mathematical type, compare the answer information of the Q&A model result and the single-model result to obtain the number of Q&A model results with the same answer information as the single-model result;

[0151] Determine a second quantity according to the number of Q&A model results, and obtain a second quantity of question statements.

[0152] In an embodiment of the present application, the model result comparison module 330 may further specifically be used for:

[0153] Determine the ratio of the number of Q&A model results to the first quantity;

[0154] Compare the ratio with a preset ratio;

[0155] If the ratio is higher than the preset ratio, adjust the second quantity to a first preset quantity;

[0156] If the ratio is not higher than the preset ratio, adjust the second quantity to a second preset quantity, where the second preset quantity is higher than the first preset quantity.

[0157] In the embodiments of the present application, the model training module 350 may further be specifically configured to:

[0158] Add the problem statements of the second quantity and the corresponding target single model results to the training corpus of the initial question-answering model;

[0159] Train the initial question-answering model according to the training corpus to obtain a target question-answering model.

[0160] Figure 4 It is a schematic structural diagram of the device provided in the embodiments of the present application. As Figure 4 shown, the device 400 includes:

[0161] The device 400 may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a communication component 403, and other components. Among them, the processor 401, the memory 402, and the communication component 403 are connected through a bus 404.

[0162] In a specific implementation process, at least one processor 401 executes the computer execution instructions stored in the memory 402, so that at least one processor 401 executes the above message processing method.

[0163] For the specific implementation process of the processor 401, reference may be made to the above method embodiments. The implementation principle and technical effects are similar, and will not be elaborated here in this embodiment.

[0164] In the above Figure 4 shown embodiment, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated: CPU), and may also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated: DSP), application-specific integrated circuits (English: Application SpecificIntegrated Circuit, abbreviated: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Combining the steps of the method disclosed in the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0165] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0166] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.

[0167] In some embodiments, a computer program product is also provided, including a computer program or instruction, which, when executed by a processor, implements the steps in any one of the above single-item training methods of the question-and-answer model.

[0168] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated herein.

[0169] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0170] Therefore, an embodiment of this application provides a computer-readable storage medium, in which multiple computer execution instructions are stored, and the computer execution instructions can be loaded by a processor to execute the steps in any one of the single-item training methods of the question-and-answer model provided by the embodiments of this application.

[0171] Among them, the storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a disk, an optical disc, etc.

[0172] According to one aspect of this application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.

[0173] Since the instructions stored in the storage medium can execute the steps in any single training method of the question-and-answer model provided by the embodiments of the present application, the beneficial effects achievable by any single training method of the question-and-answer model provided by the embodiments of the present application can be realized. For details, refer to the previous embodiments and will not be elaborated here.

[0174] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0175] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A single training method for a question-and-answer model, characterized in that, The method includes: Determining a single - function model and a first quantity of corresponding question statements, where the single - function model is a single function category in the initial question - answering model; Inputting the first quantity of question statements into the single - function model to obtain a single - model result, and inputting the first quantity of question statements into the initial question - answering model to obtain a question - answering model result; Comparing the single - model result and the question - answering model result, and adjusting the quantity of the question statements according to the comparison result to obtain a second quantity of the question statements; Inputting the second quantity of question statements into the single - function model to obtain a target single - model result; Training the initial question - answering model according to the second quantity of question statements and the target single - model result to obtain a target question - answering model.

2. The method according to claim 1, characterized in that, The determining of the single - function model and the first quantity of corresponding question statements includes: Determining the model type of the single - function model; Generating the first quantity of corresponding question statements according to the model type.

3. The method according to claim 2, characterized in that, The generating of the first quantity of corresponding question statements according to the model type includes: If the model type is a language type, determining a question - statement example library of the single - function model of the language type; Determining initial language question statements from the question - statement example library; Generating the first quantity of question statements that satisfy a statement similarity threshold with the initial language question statements according to the initial language question statements and a preset similar - language generation model.

4. The method according to claim 2, characterized in that, The generating of the first quantity of corresponding question statements according to the model type includes: If the model type is a math type, determining a question - statement example library of the single - function model of the math type; Determining initial math question statements from the question - statement example library; Performing information replacement on the digital information in the initial math question statements to generate the first quantity of math question statements.

5. The method according to claim 1, characterized in that, The comparing of the single - model result and the question - answering model result, and adjusting the quantity of the question statements according to the comparison result to obtain a second quantity of the question statements includes: If the model type is a language type, comparing the language texts of the question - answering model result and the single - model result to obtain the text similarity between the question - answering model result and the single - model result; Determining the quantity of question - answering model results whose text similarity is higher than a preset similarity threshold; If the model type is a math type, comparing the answer information of the question - answering model result and the single - model result to obtain the quantity of question - answering model results with the same answer information as the single - model result; Determining the second quantity according to the quantity of question - answering model results, and obtaining the second quantity of the question statements.

6. The method according to claim 5, characterized in that, The determining of the second quantity according to the quantity of question - answering model results, and obtaining the second quantity of the question statements includes: Determining the ratio of the quantity of question - answering model results to the first quantity; Comparing the ratio with a preset ratio; If the ratio is higher than the preset ratio, adjusting the second quantity to a first preset quantity; If the ratio is not higher than the preset ratio, adjust the second quantity to a second preset quantity, where the second preset quantity is higher than the first preset quantity.

7. The method according to claim 1, characterized in that, Training the initial question-and-answer model according to the question statements of the second quantity and the target single-item model results to obtain a target question-and-answer model includes: Adding the question statements of the second quantity and the corresponding target single-item model results to the training corpus of the initial question-and-answer model; Training the initial question-and-answer model according to the training corpus to obtain the target question-and-answer model.

8. A single training device for a question-and-answer model, characterized in that, The device includes: A question statement determination module, configured to determine a single-function model and the corresponding question statements of a first quantity, where the single-function model is a single function category in the initial question-and-answer model; A model result generation module, configured to input the question statements of the first quantity into the single-function model to obtain single-item model results, and input the question statements of the first quantity into the initial question-and-answer model to obtain question-and-answer model results; A model result comparison module, configured to compare the question-and-answer model results and the single-item model results, and adjust the quantity of the question statements according to the comparison results to obtain the question statements of the second quantity; A target result generation module, configured to input the questions of the second quantity into the single-function model to obtain target single-item model results; A model training module, configured to train the initial question-and-answer model according to the question statements of the second quantity and the target single-item model results to obtain a target question-and-answer model.

9. A device, characterized in that, Includes: One or more processors; A memory; One or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions can be called by a processor to execute the method according to any one of claims 1 to 7.