Model training method, question response method, device, equipment and medium

By obtaining a training sample set representing the difficulty level of labels, dividing it into subsets of different difficulty levels, and inputting them into the table question-answering model for training in order of difficulty, the problem of low prediction accuracy of table question-answering models in the prior art is solved, and more efficient model training and more accurate answer prediction are achieved.

CN116894080BActive Publication Date: 2026-07-21JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2023-03-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing table-based question-answering models ignore the differences between table-based and text-based question-answering during training, resulting in low prediction accuracy.

Method used

By obtaining a training sample set that represents the difficulty level of labels, dividing it into subsets of different difficulty levels, and inputting them into the table question-answering model in order of difficulty for training, the model parameters are optimized to improve prediction accuracy.

Benefits of technology

It improves the prediction accuracy and training efficiency of the table question answering model, and enhances the model's learning representation of different types of questions and table semantics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116894080B_ABST
    Figure CN116894080B_ABST
Patent Text Reader

Abstract

The present disclosure provides a model training method, a question response method, a device, equipment and a medium. The model training method comprises: obtaining a first training sample set; dividing the first training sample set into at least two training sample subsets based on the difficulty level of the label; inputting the training sample subsets into a table question and answer model in turn to obtain a predicted answer output by the table question and answer model; comparing the predicted answer with a first answer sample to obtain a first comparison result; optimizing the model parameters of the table question and answer model based on the first comparison result, and determining that the table question and answer model training is completed when the number of iterations reaches a first preset value. The present disclosure is used to solve the defect of low prediction accuracy of the table question and answer model in the prior art, and to improve the prediction accuracy of the table question and answer model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of course learning technology, and in particular to a model training method, a question-and-answer method, an apparatus, a device, and a medium. Background Technology

[0002] Table-based question answering is a technology that automatically replies to questions based on tables. It automatically searches for content based on user questions and relevant tables to generate answers.

[0003] In existing technologies, when training a table-based question-answering model, all text data and user questions are randomly fed into the model for training, ignoring the differences between table-based question answering and text-based question answering, resulting in a low prediction accuracy of the final table-based question-answering model. Summary of the Invention

[0004] This disclosure provides a model training method, question-answering method, apparatus, device, and medium to address the low prediction accuracy of existing table question-answering models and improve their prediction accuracy.

[0005] This disclosure provides a model training method, including:

[0006] Obtain a first training sample set, which includes: a table sample, a first question sample, a label corresponding to the first question sample, and a first answer sample, wherein the label is used to characterize the difficulty level of the first question sample;

[0007] Based on the difficulty level of the labels, the first training sample set is divided into at least two training sample subsets;

[0008] The training sample subset is sequentially input into the table question-answering model to obtain the predicted answer output by the table question-answering model;

[0009] By comparing the predicted answer with the first answer sample, a first comparison result is obtained;

[0010] Based on the first comparison result, the model parameters of the table question-answering model are optimized, and when the number of iterations reaches a first preset value, the training of the table question-answering model is determined to be complete.

[0011] According to a model training method provided in this disclosure, the step of sequentially inputting the training sample subset into a table-based question-answering model to obtain the predicted answer output by the table-based question-answering model includes:

[0012] Based on the difficulty level of the labels, the training sample subset is sorted from easiest to hardest;

[0013] The sorted subset of training samples is sequentially input into the table-based question-answering model to obtain the predicted answer output by the table-based question-answering model.

[0014] According to a model training method provided in this disclosure, before obtaining the first training sample set, the method further includes:

[0015] Obtain the table sample, the first question sample, and the first answer sample;

[0016] Input the table sample, the first question sample, and the first answer sample into the difficulty level determination model to obtain the difficulty level of the first question sample output by the difficulty level determination model;

[0017] The difficulty level output by the difficulty level determination model is marked onto the corresponding first problem sample;

[0018] The difficulty level determination model is trained based on a table training sample, a first question training sample, and a first answer training sample, wherein the first question training sample is labeled with a tag representing the difficulty level.

[0019] According to a model training method provided in this disclosure, the step of inputting the table sample, the first question sample, and the first answer sample into a difficulty level determination model to obtain the difficulty level of the first question sample output by the difficulty level determination model includes:

[0020] The table sample, the first question sample, and the first answer sample are input into a difficulty level determination model to determine the similarity between the first question sample and the table sample, the proportion of the first answer sample in the length of the table sample, the syntactic complexity of the first question sample, the method of obtaining the first answer sample, and the difficulty of obtaining the first answer sample. Based on the similarity, the proportion of the length, the syntactic complexity, the method of obtaining, and the difficulty of obtaining, the difficulty level corresponding to the first question sample is obtained.

[0021] According to a model training method provided in this disclosure, before obtaining the first training sample set, the method further includes:

[0022] Obtain the data set to be used, which includes: a table and descriptive text corresponding to the table;

[0023] Identify the overlapping content between the table and the description text, and determine that the overlapping content is the answer;

[0024] Input the description text and the answer into the question generation model to obtain the question corresponding to the description text output by the question generation model;

[0025] Based on the predetermined correspondence between the table and the description text, a data set of the table, the answer, and the question is obtained;

[0026] Add the data set to the first training sample set;

[0027] The question generation model is trained based on a second training sample set, which includes: description text samples, second answer samples, and second question samples.

[0028] According to a model training method provided in this disclosure, the training process of the problem generation model includes:

[0029] Obtain the second training sample set;

[0030] The second training sample set is input into the question generation model to obtain the predicted question output by the question generation module;

[0031] By comparing the predicted problem with the second problem sample, a second comparison result is obtained;

[0032] Based on the second comparison result, the model parameters of the problem generation model are optimized, and when the number of iterations reaches a second preset value, the training of the problem generation model is determined to be complete.

[0033] This disclosure also provides a question-and-answer method, including:

[0034] Obtain the target table and target question;

[0035] The target table and the target question are input into the table-based question-and-answer model to obtain the target answer corresponding to the target question, which is output by the table-based question-and-answer model based on any of the above model training methods.

[0036] This disclosure also provides a model training apparatus, including:

[0037] The acquisition module is used to acquire a first training sample set, which includes: a table sample, a first question sample, a label corresponding to the first question sample, and a first answer sample, wherein the label is used to characterize the difficulty level of the first question sample;

[0038] A partitioning module is used to partition the first training sample set into at least two training sample subsets based on the difficulty of the labels;

[0039] The prediction module is used to input the training sample subset sequentially into the table question-answering model to obtain the predicted answer output by the table question-answering model;

[0040] The comparison module is used to compare the predicted answer with the first answer sample to obtain a first comparison result;

[0041] The training module is used to optimize the model parameters of the table question-answering model based on the first comparison result, and determine that the table question-answering model training is complete when the number of iterations reaches a first preset value.

[0042] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a model training method or a question-and-answer method as described above.

[0043] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method or the question-and-answer method as described above.

[0044] The model training method, question-and-answer method, apparatus, device, and medium provided in this disclosure acquire a first training sample set, which includes: table samples, first question samples, labels corresponding to the first question samples, and first answer samples. The labels are used to characterize the difficulty level of the first question samples. Therefore, the model training samples of this disclosure are table samples that conform to table-based question-and-answer models, providing an effective data foundation for improving the accuracy of the table-based question-and-answer model. Furthermore, based on the difficulty level of the labels, the first training sample set is divided into at least two training sample subsets. The training sample subsets are sequentially input into the table-based question-and-answer model to obtain the predicted answers output by the model. The predicted answers and the first answer samples are compared to obtain a first comparison result. Based on the first comparison result, the model parameters of the table-based question-and-answer model are optimized, and the training of the table-based question-and-answer model is determined to be complete when the number of iterations reaches a first preset value. Thus, this disclosure distinguishes the difficulty levels of user questions in table-based question-and-answer models, performs classification learning on the model, enhances the model's semantic learning representation of different types of questions and tables involved in user questions, and improves the training efficiency and prediction accuracy of the model. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart illustrating the model training method provided in this publication;

[0047] Figure 2 This is a diagram illustrating how to obtain the issues provided in this public disclosure;

[0048] Figure 3 This is a schematic diagram of the training process of the publicly provided problem generation model;

[0049] Figure 4 This is a diagram illustrating the determination of the difficulty level of a problem, provided in this disclosure.

[0050] Figure 5 This is a schematic diagram of the training process of the difficulty level determination model provided in this public disclosure;

[0051] Figure 6 This is a schematic diagram of the structure of the model training device provided in this disclosure;

[0052] Figure 7 This is a schematic diagram of the structure of the question-and-answer device provided in this disclosure;

[0053] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this disclosure. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the embodiments of this disclosure.

[0055] The following is combined with Figures 1-5 The model training method of this disclosure is described in the embodiments.

[0056] In recent years, with the development of deep learning technology, deep learning methods have been widely used to solve table question answering (TableQA) problems, improving the accuracy of model responses with limited data by leveraging model training techniques.

[0057] Training various models typically relies on large-scale labeled data for supervised learning. However, in real-world applications, while large-scale tables and their corresponding text descriptions are readily available, labeled data containing table-question-answer sequences is scarce. Therefore, the lack of training data limits the training of various deep learning models for TableQA problems.

[0058] Furthermore, in the training process for TableQA models, most methods simply shuffle all the data randomly before training the model. This training method typically does not process the TableQA questions in any way, treating all questions and text data equally and randomly putting them into the model for training. This ignores the difference between table-based question answering and text-based question answering: that is, there is a difference in difficulty for table-based question answering questions.

[0059] For example, questions that can be answered based on obvious information in a table are usually easy to answer (e.g., "Who directed movie B for celebrity A?", the answer can be easily obtained from the table description of movie B). However, questions that require inference based on information from multiple rows of a table are very difficult (e.g., "How many movies has celebrity A made since 2015?", requiring inference and summation based on the dates of each movie in the table). This indiscriminate approach to model training hinders the model's ability to gradually improve its table-based question-answering capabilities through progressive learning.

[0060] It is evident that existing technologies for table-based question answering have numerous problems. For example, there is a lack of large-scale labeled data (training sample data) of table-question-answer, and constructing such labeled data requires a significant amount of manpower. Another example is that during model training, the training data is randomly shuffled and fed into the model, ignoring the varying difficulty levels of the questions involved in table-based question answering.

[0061] To address the aforementioned problems, this disclosure provides a model training method. This method can be applied to smart terminals, such as mobile phones, computers, and tablets, as well as servers. The following description uses the application of this method to a server as an example; however, it should be noted that this is merely illustrative and not intended to limit the scope of protection of this disclosure. Other descriptions in the embodiments of this disclosure are also illustrative and not intended to limit the scope of protection of this disclosure, and will not be described in detail thereafter. The specific implementation of this method is as follows... Figure 1 As shown:

[0062] Step 101: Obtain the first training sample set.

[0063] The first training sample set includes: table samples, first question samples, labels corresponding to the first question samples, and first answer samples. The labels are used to characterize the difficulty level of the first question samples.

[0064] Specifically, the first training sample set consists of sample data in the form of table-question-answer triples. Since this type of data is difficult to obtain, sample data in the form of table-question-answer triples is obtained in advance.

[0065] In one specific embodiment, the specific implementation of obtaining sample data in the form of table-question-answer triples is as follows:

[0066] Obtain the dataset to be used, which includes: a table and the corresponding descriptive text; determine the overlapping content between the table and the descriptive text, and identify the overlapping content as the answer; input the descriptive text and the answer into the question generation model to obtain the question corresponding to the descriptive text output by the question generation model; based on the pre-determined correspondence between the table and the descriptive text, obtain the data set of the table, the answer, and the question; add the data set to the first training sample set; wherein, the question generation model is trained based on the second training sample set, which includes: descriptive text samples, second answer samples, and second question samples.

[0067] Specifically, initialize the first training sample set. The first training sample set can be an empty set or a set of sample data in the form of table-question-answer triples that are stored in advance.

[0068] Specifically, since table-description text data is readily available in large quantities, this disclosure pre-obtains a large number of tables and their corresponding description texts through web crawling. Then, through semantic matching, overlapping content between the tables and description texts is matched, and the overlapping content is identified as the answer. Since there may be multiple overlaps between the tables and description questions, multiple answers will be obtained. Furthermore, the description texts and answers are input into a pre-trained question generation model to obtain the questions output by the question generation model. Since there are multiple answers, multiple questions will be obtained. Finally, based on the correspondence between the tables and description texts, a table-question-answer triple is obtained and stored in the first training sample set.

[0069] Below, through Figure 2 The method for obtaining the table is illustrated.

[0070] For example, Figure 2 The table in Table 1 describes the text as "In the 2004 Athens Games, in the men's 110-meter hurdles, he tied the actual record set by athlete B with a time of 12.91 seconds and won the championship." The overlapping content is "championship," and the question is "What results did athlete A achieve in the 2004 Athens Games?"

[0071] date Contest score Rank 2004 World Indoor Athletics Championships 7.45 seconds champion 2004 International Athletics Grand Prix 13.06 seconds champion 2004 International Athletics Grand Prix 13.11 seconds champion 2004 Sports Meet 12.91 seconds champion 2005 10th World Athletics Championships 13.08 seconds champion 2005 Golden Athletics League 13.2 seconds champion

[0072] Table 1

[0073] In one specific embodiment, the training process of the problem generation model includes:

[0074] Obtain a second training sample set; input the second training sample set into the question generation model to obtain the predicted question output by the question generation module; compare the predicted question with the second question sample to obtain a second comparison result; optimize the question generation model based on the second comparison result, and determine that the question generation model training is complete when the number of iterations reaches a second preset value.

[0075] Below, through Figure 3 The training process of the problem generation model is illustrated.

[0076] For example, in Figure 3 The description text is "In the 2002 NBA draft, C was selected by the Houston Rockets as the number one overall pick and was selected as an NBA All-Star for six consecutive seasons from 2003 to 2009 (a total of 8 times in his career)". The answer is "Rockets" and the generated question is "Which NBA team selected C as the number one overall pick in 2002?"

[0077] This disclosure solves the problem that deep learning-based table question-answering models require a large number of training sample data in the form of table-question-answer triples by using a question generation model. Furthermore, the process of obtaining triples does not require manual annotation, thus saving labor costs.

[0078] In one specific embodiment, after obtaining the table-question-answer triplet, the difficulty level of each question is determined, as shown in the following implementation:

[0079] Obtain a table sample, a first question sample, and a first answer sample; input the table sample, the first question sample, and the first answer sample into the difficulty level determination model to obtain the difficulty level corresponding to the first question sample output by the difficulty level determination model; label the difficulty level output by the difficulty level determination model onto the corresponding first question sample; wherein, the difficulty level determination model is trained based on the table training sample, the first question training sample, the first answer training sample, and the difficulty level label sample.

[0080] The difficulty level is divided into several levels, including easy, medium, and difficult.

[0081] Specifically, each table-question-answer triplet is input into the difficulty level determination model to obtain the difficulty level of the question output by the difficulty level determination model. After obtaining the specific value corresponding to the difficulty level, it is marked on the question, and the table-question (carrying difficulty level label)-answer triplet is stored in the first training sample set.

[0082] For example, easy corresponds to label 1, medium corresponds to label 2, and difficult corresponds to label 3.

[0083] In one specific embodiment, since the questions in the table-based question-and-answer format vary in difficulty, a difficulty level determination model that integrates multiple pieces of information is used to determine the difficulty level of the first question sample in order to differentiate the difficulty levels of the questions in the table-based question-and-answer format. The specific determination method is as follows:

[0084] Input the table sample, the first question sample, and the first answer sample into the difficulty level determination model to determine the similarity between the first question sample and the table sample, the length ratio of the first answer sample in the table sample, the syntactic complexity of the first question sample, the method of obtaining the first answer sample, and the difficulty of obtaining the first answer sample. Based on the similarity, length ratio, syntactic complexity, method of obtaining, and difficulty of obtaining, the difficulty level corresponding to the first question sample is obtained.

[0085] Specifically, the similarity between the first question sample and the table sample is determined through lexical features. For example, the number of identical words in the first question sample and the table sample is determined, and the similarity between the first question sample and the table sample is obtained based on the pre-determined matching relationship between the number and the similarity. The first text length of the first answer sample and the second text length of all texts in the table sample are counted, and the ratio of the first text length to the second text length is calculated to obtain the length proportion of the first answer sample in the table sample. The grammatical structure of the first question sample is analyzed, and the grammatical complexity of the first question sample is determined based on the grammatical structure. It is determined whether the first answer sample is obtained directly from the table or through reasoning. If it is obtained directly from the table, the corresponding acquisition difficulty is obtained; if it is obtained through reasoning, the corresponding acquisition difficulty is obtained based on the operation performed to obtain the first answer sample.

[0086] Specifically, similarity, length proportion, syntactic complexity, acquisition method, and acquisition difficulty will each have a corresponding score. That is, the difficulty level of the model is determined by the difficulty level, and the sequence corresponding to similarity, length proportion, syntactic complexity, acquisition method, and acquisition difficulty is determined based on the obtained sequence.

[0087] Below, through Figure 4 The difficulty level determination model is illustrated to determine the difficulty level of the first problem sample.

[0088] For example, in Figure 4The table is Table 1; there are 6 questions: "Q1: What results did A achieve in the 2004 Athens Games? Q2: How many championships did A win in 2004? Q3: What was A's fastest time in 2005? Q4: How much slower was A at the 10th World Athletics Championships compared to the Games? Q5: In which year did A win the Games? Q6: How many championships did A win in 2004 and 2005?" The difficulty levels are: "Q1 and Q5 are easy, Q2 and Q6 are medium, and Q3 and Q4 are difficult."

[0089] In one specific embodiment, the training process of the difficulty level determination model includes:

[0090] Obtain training samples of a table, a first question, and a first answer, where the first question training sample is labeled with a tag representing the difficulty level. Input the table training sample, the first question training sample, and the first answer training sample into the difficulty level determination model to obtain the predicted difficulty value of the first question training sample output by the difficulty level model. Compare the predicted difficulty value with the value corresponding to the tag representing the difficulty level to obtain the third comparison result. Optimize the model parameters of the difficulty level determination model based on the second comparison result, and determine that the difficulty level determination model training is complete when the number of iterations reaches the third preset value.

[0091] Specifically, the table training sample, the first question training sample, and the first answer training sample are input into the difficulty level determination model to determine the similarity sample between the first question training sample and the table training sample, the length ratio of the first answer training sample in the table training sample, the syntactic complexity sample of the first question training sample, the method of obtaining the first answer training sample, and the difficulty sample of obtaining the first answer training sample. Based on the similarity sample, the length ratio sample, the syntactic complexity sample, the method of obtaining the first answer training sample, and the difficulty sample of obtaining the first answer training sample, the difficulty level corresponding to the first question training sample is obtained.

[0092] Below, through Figure 5 The training process of a model with a determined level of difficulty is illustrated.

[0093] For example, in Figure 5 The difficulty level determination model is illustrated using Seq2Seq as an example. Of course, this is only an example and does not limit the structure of the difficulty level determination model.

[0094] The model determines the difficulty level by inputting a table and a question. Through the processing of the data by the encoder and decoder, the difficulty level of the question is obtained, as well as the answer to the question.

[0095] This disclosure determines the difficulty level of the first question sample by using a difficulty level determination model, providing an effective data foundation for improving the prediction accuracy of the table question-answering model.

[0096] Step 102: Based on the difficulty of the labels, divide the first training sample set into at least two training sample subsets.

[0097] For example, when the difficulty level is divided into easy and hard, the first training sample set is divided into two training sample subsets. One training sample subset stores data that is marked as easy and the other training sample subset stores data that is marked as hard.

[0098] For example, when the difficulty level is divided into easy, medium and hard, the first training sample set is divided into 3 training sample subsets. One training sample subset stores data marked as easy, one training sample subset stores data marked as medium, and one training sample subset stores data marked as hard.

[0099] The specific classification is based on a pre-determined level of difficulty.

[0100] This disclosure provides an effective data foundation for training subsequent table-based question-answering models by dividing the first training sample set into levels of difficulty.

[0101] Step 103: Input the training sample subset into the table question-answering model in sequence to obtain the predicted answer output by the table question-answering model.

[0102] In one specific embodiment, the training sample subset is sorted from easy to difficult based on the difficulty of the labels; the sorted training sample subset is then input into the table question answering model to obtain the predicted answer output by the table question answering model.

[0103] The table-based question-answering model can be a Seq2Seq generative model, including the structure of an encoder and a decoder, or a convolutional neural network structure, etc. This disclosure does not limit the structure of the table-based question-answering model.

[0104] Training a model without considering the difficulty of the question during oversaturation training significantly impacts its learning efficiency. As the example above illustrates, for a simple question like "What was A's result at the 2004 Athens Games?", the model only needs to understand keywords like "2004," "Games," and "result" to quickly locate the answer "champion." However, for a more difficult question like "What was A's fastest time in 2005?", the model not only needs to understand "fastest" but also needs to automatically compare answers in different rows to select the table corresponding to the "fastest" result. Such challenging questions test the model's semantic understanding and reasoning abilities.

[0105] Furthermore, traditional methods based on the Seq2Seq learning framework struggle to generate natural answers from noisy and unevenly challenging training data. Course learning, on the other hand, learns from low-quality, simple question-answer pairs. Then, it gradually generates correct and natural answers from training examples.

[0106] Therefore, during the training process, this disclosure places the labeled tags into the model in order of increasing difficulty, thereby mimicking the human learning process and improving the model's accuracy in answering different questions.

[0107] Step 104: Compare the predicted answer with the first answer sample to obtain the first comparison result.

[0108] Specifically, the consistency between the predicted answer and the first answer sample is compared, and this consistency is taken as the first comparison result.

[0109] Step 105: Optimize the model parameters of the table question-answering model based on the first comparison result, and determine that the table question-answering model training is complete when the number of iterations reaches the first preset value.

[0110] In one specific embodiment, after the table question-answering model is trained, it can be applied (the question-answering method disclosed in this embodiment of the present disclosure), specifically implemented as follows: obtaining the target table and the target question; inputting the target table and the target question into the table question-answering model to obtain the target answer corresponding to the target question output by the table question-answering model.

[0111] The table-based question-answering model trained based on this public information can accurately and quickly output the target answer corresponding to the target question. In addition, it can also output the difficulty level of the target question along with the target answer, so that in the field of course learning, users can know whether the target question is in line with their learning plan.

[0112] The model training method provided in this disclosure obtains a first training sample set, which includes: table samples, first question samples, labels corresponding to the first question samples, and first answer samples. The labels are used to characterize the difficulty level of the first question samples. Therefore, the model training samples of this disclosure are table samples that conform to table-based question-and-answer models, providing an effective data foundation for improving the accuracy of the table-based question-and-answer model. Furthermore, based on the difficulty level of the labels, the first training sample set is divided into at least two training sample subsets. The training sample subsets are sequentially input into the table-based question-and-answer model to obtain the predicted answers output by the model. The predicted answers are compared with the first answer samples to obtain a first comparison result. Based on the first comparison result, the model parameters of the table-based question-and-answer model are optimized, and the training of the table-based question-and-answer model is determined to be complete when the number of iterations reaches a first preset value. Thus, this disclosure distinguishes the difficulty levels of user questions in table-based question-and-answer models, performs classification learning on the model, enhances the model's semantic learning representation of different types of questions and tables involved in user questions, and improves the training efficiency and prediction accuracy of the model.

[0113] The model training apparatus provided in the embodiments of this disclosure is described below. The model training apparatus described below can be referred to in correspondence with the model training method described above, and repeated details will not be repeated. Figure 6 As shown, the model training device includes:

[0114] The acquisition module 601 is used to acquire a first training sample set, which includes: a table sample, a first question sample, a label corresponding to the first question sample, and a first answer sample. The label is used to characterize the difficulty level of the first question sample.

[0115] The partitioning module 602 is used to partition the first training sample set into at least two training sample subsets based on the difficulty of the labels.

[0116] The prediction module 603 is used to input a subset of training samples into the table question-answering model in sequence to obtain the predicted answer output by the table question-answering model;

[0117] The comparison module 604 is used to compare the predicted answer with the first answer sample to obtain the first comparison result;

[0118] The training module 605 is used to optimize the model parameters of the table question-answering model based on the first comparison result, and to determine that the table question-answering model training is complete when the number of iterations reaches a first preset value.

[0119] In one specific embodiment, the prediction module 603 is specifically used to sort the training sample subset from easy to difficult based on the difficulty of the labels; and input the sorted training sample subset into the table question answering model in sequence to obtain the predicted answer output by the table question answering model.

[0120] In one specific embodiment, the acquisition module 601 is further configured to acquire a table sample, a first question sample, and a first answer sample; input the table sample, the first question sample, and the first answer sample into a difficulty level determination model to obtain the difficulty level corresponding to the first question sample output by the difficulty level determination model; and mark the difficulty level output by the difficulty level determination model onto the corresponding first question sample; wherein, the difficulty level determination model is trained based on the table training sample, the first question training sample, and the first answer training sample, and the first question training sample is marked with a label representing the difficulty level.

[0121] In one specific embodiment, the acquisition module 601 is further configured to input the table sample, the first question sample, and the first answer sample into the difficulty level determination model, determine the similarity between the first question sample and the table sample, the length ratio of the first answer sample in the table sample, the syntactic complexity of the first question sample, the method of obtaining the first answer sample, and the difficulty of obtaining the first answer sample, and obtain the difficulty level corresponding to the first question sample based on the similarity, the length ratio, the syntactic complexity, the method of obtaining, and the difficulty of obtaining.

[0122] In one specific embodiment, the acquisition module 601 is further configured to acquire a data set to be used, the data set including: a table and descriptive text corresponding to the table; determine the overlapping content between the table and the descriptive text, and determine the overlapping content as the answer; input the descriptive text and the answer into the question generation model to obtain the question corresponding to the descriptive text output by the question generation model; based on the pre-determined correspondence between the table and the descriptive text, obtain a data set of the table, the answer and the question; add the data set to the first training sample set; wherein, the question generation model is trained based on a second training sample set, the second training sample set including: descriptive text samples, second answer samples and second question samples.

[0123] In one specific embodiment, the training module 605 is further configured to obtain a second training sample set; input the second training sample set into the question generation model to obtain the predicted question output by the question generation module; compare the predicted question with the second question sample to obtain a second comparison result; optimize the model parameters of the question generation model based on the second comparison result, and determine that the question generation model training is complete when the number of iterations reaches a second preset value.

[0124] The following describes the problem-answering device provided in the embodiments of this disclosure. The problem-answering device described below can be referred to in correspondence with the problem-answering method described above. Repeated parts will not be repeated. Figure 7 As shown, the question-and-answer device includes:

[0125] The target acquisition module 701 is used to acquire the target table and target questions.

[0126] The target prediction module 702 is used to input the target table and the target question into the table question-and-answer model and obtain the target answer corresponding to the target question output by the table question-and-answer model.

[0127] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804. The processor 801 can call logic instructions in the memory 803 to execute a model training method, which includes: acquiring a first training sample set, the first training sample set including: table samples, first question samples, labels corresponding to the first question samples, and first answer samples, wherein the labels are used to characterize the difficulty level of the first question samples; dividing the first training sample set into at least two training sample subsets based on the difficulty level of the labels; sequentially inputting the training sample subsets into a table question-and-answer model to obtain the predicted answer output by the table question-and-answer model; comparing the predicted answer with the first answer sample to obtain a first comparison result; optimizing the model parameters of the table question-and-answer model based on the first comparison result, and determining that the table question-and-answer model training is complete when the number of iterations reaches a first preset value; or, executing a question-and-answer method, which includes: acquiring a target table and a target question; inputting the target table and the target question into the table question-and-answer model to obtain the target answer corresponding to the target question output by the table question-and-answer model.

[0128] Furthermore, the logical instructions in the aforementioned memory 803 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this disclosure, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] On the other hand, this disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the model training method provided by the above methods. The method includes: obtaining a first training sample set, which includes: table samples, first question samples, labels corresponding to the first question samples, and first answer samples, wherein the labels are used to characterize the difficulty level of the first question samples; dividing the first training sample set into at least two training sample subsets based on the difficulty level of the labels; sequentially inputting the training sample subsets into a table question-and-answer model to obtain the predicted answer output by the table question-and-answer model; comparing the predicted answer with the first answer sample to obtain a first comparison result; optimizing the model parameters of the table question-and-answer model based on the first comparison result, and determining that the table question-and-answer model training is complete when the number of iterations reaches a first preset value, or executing a question-and-answer method, which includes: obtaining a target table and a target question; inputting the target table and the target question into the table question-and-answer model to obtain the target answer corresponding to the target question output by the table question-and-answer model.

[0130] In another aspect, this disclosure also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the model training methods provided above. The method includes: acquiring a first training sample set, the first training sample set including: table samples, first question samples, labels corresponding to the first question samples, and first answer samples, the labels being used to characterize the difficulty level of the first question samples; dividing the first training sample set into at least two training sample subsets based on the difficulty level of the labels; sequentially inputting the training sample subsets into a table question-and-answer model to obtain the predicted answer output by the table question-and-answer model; comparing the predicted answer with the first answer sample to obtain a first comparison result; optimizing the model parameters of the table question-and-answer model based on the first comparison result, and determining that the table question-and-answer model training is complete when the number of iterations reaches a first preset value; or, executing a question-and-answer method, the method including: acquiring a target table and a target question; inputting the target table and the target question into the table question-and-answer model to obtain the target answer corresponding to the target question output by the table question-and-answer model.

[0131] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.

Claims

1. A model training method, characterized in that, include: Obtain a first training sample set, which includes: a table sample, a first question sample, a label corresponding to the first question sample, and a first answer sample, wherein the label is used to characterize the difficulty level of the first question sample; Based on the difficulty level of the labels, the first training sample set is divided into at least two training sample subsets; The training sample subset is sequentially input into the table question-answering model to obtain the predicted answer output by the table question-answering model; By comparing the predicted answer with the first answer sample, a first comparison result is obtained; Based on the first comparison result, optimize the model parameters of the table question-answering model, and determine that the table question-answering model training is complete when the number of iterations reaches a first preset value; Before obtaining the first training sample set, the method further includes: obtaining the table sample, the first question sample, and the first answer sample; inputting the table sample, the first question sample, and the first answer sample into a difficulty level determination model to obtain the difficulty level corresponding to the first question sample output by the difficulty level determination model; and labeling the difficulty level output by the difficulty level determination model onto the corresponding first question sample; wherein, the difficulty level determination model is trained based on the table training sample, the first question training sample, and the first answer training sample, and the first question training sample is labeled with a label representing the difficulty level; The step of inputting the table sample, the first question sample, and the first answer sample into a difficulty level determination model to obtain the difficulty level of the first question sample output by the difficulty level determination model includes: inputting the table sample, the first question sample, and the first answer sample into a difficulty level determination model to determine the similarity between the first question sample and the table sample, the length proportion of the first answer sample in the table sample, the syntactic complexity of the first question sample, the method of obtaining the first answer sample, and the difficulty of obtaining the first answer sample; and obtaining the difficulty level of the first question sample based on the similarity, the length proportion, the syntactic complexity, the method of obtaining, and the difficulty of obtaining.

2. The model training method according to claim 1, characterized in that, The step of sequentially inputting the training sample subset into the table-based question-answering model to obtain the predicted answer output by the table-based question-answering model includes: Based on the difficulty level of the labels, the training sample subset is sorted from easiest to hardest; The sorted subset of training samples is sequentially input into the table-based question-answering model to obtain the predicted answer output by the table-based question-answering model.

3. The model training method according to any one of claims 1-2, characterized in that, Before obtaining the first training sample set, the method further includes: Obtain the data set to be used, which includes: a table and descriptive text corresponding to the table; Identify the overlapping content between the table and the description text, and determine that the overlapping content is the answer; Input the description text and the answer into the question generation model to obtain the question corresponding to the description text output by the question generation model; Based on the predetermined correspondence between the table and the description text, a data set of the table, the answer, and the question is obtained; Add the data set to the first training sample set; The question generation model is trained based on a second training sample set, which includes: description text samples, second answer samples, and second question samples.

4. The model training method according to claim 3, characterized in that, The training process of the problem generation model includes: Obtain the second training sample set; The second training sample set is input into the question generation model to obtain the predicted question output by the question generation module; By comparing the predicted problem with the second problem sample, a second comparison result is obtained; Based on the second comparison result, the model parameters of the problem generation model are optimized, and when the number of iterations reaches a second preset value, the training of the problem generation model is determined to be complete.

5. A question-and-answer method, characterized in that, include: Obtain the target table and target question; The target table and the target question are input into the table question-answering model to obtain the target answer corresponding to the target question output by the table question-answering model. The table question-answering model is obtained based on the model training method of any one of claims 1-4.

6. A model training device, characterized in that, include: The acquisition module is used to acquire a first training sample set, which includes: a table sample, a first question sample, a label corresponding to the first question sample, and a first answer sample, wherein the label is used to characterize the difficulty level of the first question sample; A partitioning module is used to partition the first training sample set into at least two training sample subsets based on the difficulty of the labels; The prediction module is used to input the training sample subset sequentially into the table question-answering model to obtain the predicted answer output by the table question-answering model; The comparison module is used to compare the predicted answer with the first answer sample to obtain a first comparison result; The training module is used to optimize the model parameters of the table question-answering model based on the first comparison result, and determine that the table question-answering model training is complete when the number of iterations reaches a first preset value; The acquisition module is further configured to acquire a table sample, a first question sample, and a first answer sample; input the table sample, the first question sample, and the first answer sample into a difficulty level determination model to obtain the difficulty level corresponding to the first question sample output by the difficulty level determination model; and mark the difficulty level output by the difficulty level determination model onto the corresponding first question sample; wherein, the difficulty level determination model is trained based on the table training sample, the first question training sample, and the first answer training sample, and the first question training sample is marked with a label representing the difficulty level; The acquisition module is further configured to input the table sample, the first question sample, and the first answer sample into the difficulty level determination model, determine the similarity between the first question sample and the table sample, the length ratio of the first answer sample in the table sample, the syntactic complexity of the first question sample, the method of obtaining the first answer sample, and the difficulty of obtaining the first answer sample, and obtain the difficulty level corresponding to the first question sample based on the similarity, length ratio, syntactic complexity, method of obtaining, and difficulty of obtaining.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the model training method as described in any one of claims 1 to 4, or the question-and-answer method as described in claim 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the model training method as described in any one of claims 1 to 4, or the question-and-answer method as described in claim 5.