Question and answer model training method, question and answer method, and device

CN114925178BActive Publication Date: 2026-10-20HUAWEI TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210190420.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-04-14
Filing Date
2022-02-28
Publication Date
2026-10-20
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

若问答模型学习到有害的推理方案,则会对模型的训练效果产生负面的影响

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925178B_ABST
    Figure CN114925178B_ABST
Patent Text Reader

Abstract

The application provides a question and answer model training method, a model training method, a question and answer method, a data processing method and device, and relates to the field of artificial intelligence. The question and answer model training method comprises the following steps: determining a first candidate reasoning scheme according to a prediction result of a question reconstruction model, the first candidate reasoning scheme belonging to multiple candidate reasoning schemes corresponding to a training sample, and the prediction result of the question reconstruction model being used to indicate that a candidate reasoning scheme and conditional information based on a question in the training sample are used to reconstruct an evaluation value of the question in the training sample; and training a question and answer model based on the training sample and the first candidate reasoning scheme. The scheme of the application can alleviate the negative influence of harmful reasoning schemes on model training, improve the training effect of the model, and is beneficial to obtaining a correct reasoning scheme.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202110401999.0, filed on April 15, 2021, entitled "An Automatic Question Answering Method and System Based on Mutual Information", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of artificial intelligence, and in particular to a training method for a question-answering model, a model training method, a question-answering method, a data processing method, and an apparatus. Background Technology

[0003] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0004] Supervised learning is a common training method in machine learning. In strongly supervised training scenarios, inference models can be built using a large number of training samples, each with a reliable ground truth label. However, due to the high cost of data labeling, many tasks struggle to obtain reliable ground truth labels. Weakly supervised training simplifies the data collection process but can negatively impact model training performance.

[0005] Natural Language Processing (NLP) is an important research area in artificial intelligence. Taking NLP as an example, many NLP tasks can be modeled as question-answering models. The training of question-answering models is usually carried out in weakly supervised scenarios, that is, learning from given answers without providing a reasoning strategy for the question. For a given question, there may be some harmful reasoning strategies that happen to yield the correct answer, but these harmful reasoning strategies do not actually answer the question. If the question-answering model learns harmful reasoning strategies, it will negatively impact the model's training performance. For example, a well-trained model might provide illogical reasoning strategies or even incorrect answers.

[0006] Therefore, how to improve the training effect of models in weakly supervised scenarios has become an urgent problem to be solved. Summary of the Invention

[0007] This application provides a training method for a question-answering model, a model training method, a question-answering method, a data processing method, and an apparatus, which can mitigate the negative impact of harmful reasoning schemes on model training, improve the training effect of the model, and facilitate obtaining correct reasoning schemes.

[0008] Firstly, a method for training a question-answering model is provided, comprising: obtaining training samples and a set of candidate reasoning schemes corresponding to the training samples, wherein the training samples include questions and conditional information of the questions, and the execution result of the candidate reasoning schemes in the set of candidate reasoning schemes is the answer to the question; determining a first candidate reasoning scheme based on the prediction result of a question reconstruction model, wherein the first candidate reasoning scheme belongs to the set of candidate reasoning schemes, the question reconstruction model is used to obtain the prediction result of the question reconstruction model based on the conditional information of the question and multiple candidate reasoning schemes, and the prediction result of the question reconstruction model is used to indicate the evaluation value of the question reconstructed based on the conditional information of the question and multiple candidate reasoning schemes; and training a question-answering model based on the training samples and the first candidate reasoning scheme, wherein multiple candidate reasoning schemes belong to the set of candidate reasoning schemes.

[0009] In other words, the prediction results of the problem reconstruction model are used to indicate the evaluation value of the problem to be reconstructed based on the problem's conditional information and multiple candidate reasoning schemes. These multiple candidate reasoning schemes correspond to multiple evaluation values.

[0010] According to the scheme of this application embodiment, a question reconstruction model is used to guide the question answering model to predict reasonable reasoning schemes that have good consistency with the question, thereby improving the training effect of the question answering model. Specifically, the scheme of this application embodiment uses the prediction results of the question reconstruction model to represent the semantic relevance between candidate reasoning schemes and the question. The candidate reasoning schemes are determined based on the strength of semantic relevance to train the question answering model. Candidate reasoning schemes with strong semantic relevance to the question are more likely to be correct reasoning schemes, thereby helping to mitigate the impact of harmful reasoning schemes and improving the training effect.

[0011] For different question-answering models, the conditional information can be different types of data.

[0012] In conjunction with the first aspect, in some implementations of the first aspect, the conditional information includes documents associated with the problem.

[0013] For example, in multi-word reading comprehension or discrete reasoning tasks, conditional information may include one or more documents. Similarly, in table-based semantic parsing tasks, conditional information may include the table header. The table header can also be understood as a type of document.

[0014] A reasoning scheme can be understood as the process of finding the answer; by executing this process, the answer can be obtained.

[0015] For different question-answering models, candidate inference schemes can be different types of data.

[0016] For example, in reading comprehension tasks, a candidate inference solution could be a specific span within a document. Similarly, in discrete inference tasks, a candidate inference solution could be an arithmetic expression. And in semantic analysis tasks, a candidate inference solution could be a Structured Query Language (SQL) statement.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the training method further includes: determining a second candidate reasoning scheme based on the prediction results of the question-answering model, wherein the second candidate reasoning scheme belongs to the candidate reasoning scheme set; obtaining the prediction results of the question-answering model based on the question and the question's condition information, wherein the prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes, wherein multiple candidate reasoning schemes belong to the candidate reasoning scheme set; and training a question reconstruction model based on training samples and the second candidate reasoning scheme.

[0018] In other words, the prediction results of the question-answering model are used to indicate the evaluation value of a candidate reasoning solution as the correct reasoning solution. Multiple candidate reasoning solutions correspond to multiple evaluation values.

[0019] The multiple candidate inference schemes input into the question answering model can be the same as or different from the multiple candidate inference schemes input into the question reconstruction model.

[0020] The question answering model and the question reconstruction model are trained alternately. That is, the question answering model is trained based on the prediction results of the question reconstruction model, and the question reconstruction model is trained based on the prediction results of the question answering model.

[0021] In this embodiment of the application, the second candidate reasoning scheme is determined based on the prediction results of the question-answering model to train the question reconstruction model, which can improve the training effect of the question reconstruction model so that the question reconstruction model can reconstruct the question more accurately.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, the prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the problem's conditional information and multiple candidate reasoning schemes, and the prediction probability of reconstructing the problem based on the problem's conditional information and the first candidate reasoning scheme is greater than or equal to the prediction probability of reconstructing the problem based on the problem's conditional information and other candidate reasoning schemes.

[0023] According to the scheme of the embodiment of this application, the first candidate reasoning scheme is the candidate reasoning scheme with the strongest semantic relevance to the question determined by the question reconstruction model. That is, the question answering model is trained based on the optimal candidate reasoning scheme obtained by the question reconstruction model. In other words, the question answering model is trained by using a greedy optimization method, which can make the training process more stable.

[0024] In conjunction with the first aspect, in some implementations of the first aspect, determining the second candidate reasoning scheme based on the prediction results of the question-answering model includes: obtaining the second candidate reasoning scheme by sampling the prediction results of the question-answering model.

[0025] In conjunction with the first aspect, in some implementations of the first aspect, the first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is the second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

[0026] According to the scheme of this application embodiment, the string from the condition information in the candidate reasoning scheme is replaced with a placeholder. The representation of the placeholder in the problem reconstruction model is determined by the context representation of the second string. In this way, the context semantics are not lost, and strings with the same literal form can be effectively distinguished, which is beneficial to improving the prediction accuracy of the problem reconstruction model.

[0027] In conjunction with the first aspect, in some implementations of the first aspect, the representation of the placeholder in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context representation of the second string.

[0028] In other words, the representation of the placeholder in the problem reconstruction model is determined by using an attention mask to make the placeholder focus on the context of the second string.

[0029] Secondly, a training method for a model is provided, including: obtaining training samples and a set of candidate labels corresponding to the training samples, the set of candidate labels including multiple candidate labels; determining a first candidate label based on the prediction result of the evaluation model, the first candidate label belonging to the set of candidate labels, wherein the prediction result of the evaluation model is used to indicate the evaluation value of the training samples reconstructed based on the candidate labels; and training an inference model based on the training samples and the first candidate label.

[0030] In the embodiments of this application, an evaluation model is used to guide the inference model to predict reasonable labels that have good consistency with the training samples, thereby improving the training effect of the inference model. Specifically, the embodiments of this application use the prediction results of the evaluation model to represent the correlation between candidate labels and training samples. Candidate labels are selected based on the strength of the correlation to train the inference model. Candidate labels with a strong correlation with the training samples are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect.

[0031] The types of training samples and candidate labels are related to the task type of the inference model.

[0032] For example, the inference model is used for image processing tasks, and the training samples can be image data. Specifically, image processing tasks may include image classification, image detection, image segmentation, image recognition, image generation, image super-resolution, image denoising, or object detection, etc.

[0033] For example, the inference model can be used for text processing tasks, and the training samples can be text data. Specifically, text processing tasks can include reading comprehension, discrete reasoning, semantic parsing, text recognition, or text translation, etc.

[0034] For example, the inference model is used for audio processing tasks, and the training samples can be audio data. Specifically, audio processing tasks include speech recognition or voiceprint recognition, etc.

[0035] The evaluation model can be determined based on either the reconstructed model or the generative model.

[0036] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: determining a second candidate label based on the prediction result of the inference model, the second candidate label belonging to the candidate label set, wherein the prediction result of the inference model is used to indicate the evaluation value of the candidate label as the correct label; and training an evaluation model based on the training samples and the second candidate label.

[0037] The inference model and the evaluation model are trained alternately, that is, the inference model is trained based on the prediction results of the evaluation model, and the evaluation model is trained based on the prediction results of the inference model.

[0038] In this embodiment of the application, the evaluation model is trained by determining the second candidate label based on the prediction result of the inference model, which can improve the training effect of the evaluation model and enable the evaluation model to reconstruct the training samples more accurately.

[0039] In conjunction with the second aspect, in some implementations of the second aspect, the prediction result of the evaluation model is the prediction probability of reconstructing the training sample based on the candidate labels, and the prediction probability of reconstructing the training sample based on the first candidate label is greater than or equal to the prediction probability of reconstructing the training sample based on other candidate labels.

[0040] According to the scheme of the embodiment of this application, the first candidate label is the candidate label with the strongest correlation with the training sample determined by the evaluation model. The inference model is trained based on the optimal candidate label obtained by the evaluation model. That is, the inference model is trained by a greedy optimization method, which can make the training process more stable.

[0041] In conjunction with the second aspect, in some implementations of the second aspect, the second candidate label is determined based on the prediction results of the inference model, including: sampling the second candidate label based on the prediction results of the inference model.

[0042] In conjunction with the second aspect, in some implementations of the second aspect, the training samples include image data, text data, or audio data.

[0043] Thirdly, a training method for an image processing model is provided, including: obtaining a sample image and a set of candidate labels corresponding to the sample image, wherein the set of candidate labels includes multiple candidate labels; determining a first candidate label based on the prediction results of the evaluation model, wherein the first candidate label belongs to the set of candidate labels; and training an image processing model based on the sample image and the first candidate label.

[0044] In the embodiments of this application, an evaluation model is used to guide the image processing model to predict reasonable labels that have good consistency with the sample images, thereby improving the training effect of the image processing model. Specifically, the solution of this application uses the prediction results of the evaluation model to represent the correlation between candidate labels and sample images. The candidate labels are determined based on the strength of the correlation to train the image processing model. Candidate labels with a strong correlation with the sample images are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect.

[0045] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: determining a second candidate label based on the prediction results of the image processing model, wherein the second candidate label belongs to the candidate label set; and training an evaluation model based on the sample image and the second candidate label.

[0046] In this embodiment of the application, the evaluation model is trained by determining the second candidate label based on the prediction result of the image processing model, which can improve the training effect of the evaluation model and enable the evaluation model to reconstruct the sample image more accurately.

[0047] In conjunction with the third aspect, in some implementations of the third aspect, the prediction result of the evaluation model includes the prediction probability of the evaluation model reconstructing the sample image based on the candidate labels. Specifically, the prediction probability of the evaluation model reconstructing the sample image based on the first candidate label is greater than or equal to the prediction probability of the evaluation model reconstructing the sample image based on other candidate labels.

[0048] According to the scheme of the embodiments of this application, the image processing model can be trained based on the optimal candidate labels obtained by the evaluation model, that is, the image processing model can be trained by a greedy optimization method, which can make the training process more stable.

[0049] In conjunction with the third aspect, in some implementations of the third aspect, the second candidate label is obtained by sampling based on the prediction results of the image processing model.

[0050] Fourthly, a question-answering method is provided, including: obtaining the question to be processed and its conditional information; processing the question to be processed and its conditional information using a question-answering model to predict the answer to the question to be processed, wherein the question-answering model is trained based on training samples and a first candidate reasoning scheme, the training samples include the question and its conditional information, the first candidate reasoning scheme is determined based on the prediction result of the question reconstruction model, the first candidate reasoning scheme belongs to a set of candidate reasoning schemes, the question reconstruction model is used to indicate the prediction result of the question reconstruction model based on the conditional information of the question and multiple candidate reasoning schemes, the prediction result of the question reconstruction model is used to indicate the reconstruction of the evaluation value of the question based on the conditional information of the question and multiple candidate reasoning schemes, and multiple candidate reasoning schemes belong to a set of candidate reasoning schemes.

[0051] According to the scheme of this application embodiment, a question reconstruction model is used to guide the question answering model to predict reasonable reasoning solutions with good consistency with the question, thereby improving the training effect of the question answering model. Specifically, the scheme of this application embodiment uses the prediction results of the question reconstruction model to represent the semantic relevance between candidate reasoning solutions and the question. The candidate reasoning solutions are determined based on the strength of the semantic relevance to train the question answering model. Candidate reasoning solutions with strong semantic relevance to the question are more likely to be correct reasoning solutions, thus helping to mitigate the impact of harmful reasoning solutions and improving the training effect. Using this question answering model to process the question helps to obtain more accurate reasoning solutions, and thus more accurate solutions.

[0052] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the problem reconstruction model is trained based on training samples and a second candidate reasoning scheme. The second candidate reasoning scheme is determined based on the prediction results of the question-answering model and belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction results of the question-answering model based on the question and the condition information of the question. The prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes. Multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

[0053] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the problem's conditional information and multiple candidate reasoning schemes. The prediction probability of reconstructing the problem based on the problem's conditional information and the first candidate reasoning scheme is greater than or equal to the prediction probability of reconstructing the problem based on the problem's conditional information and other candidate reasoning schemes.

[0054] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the conditional information of the problem includes documents associated with the problem.

[0055] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is the second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

[0056] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the representation of placeholders in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholders pay attention to the context representation of the second string.

[0057] Fifthly, a data processing method is provided, comprising: acquiring data to be processed; processing the data to be processed using an inference model to obtain the processing result of the data to be processed, wherein the inference model is trained based on training samples and a first candidate label, the first candidate label is determined based on the prediction result of the evaluation model, the first candidate label belongs to a candidate label set, the candidate label set includes multiple candidate labels, and the prediction result of the evaluation model is used to indicate the evaluation value of the training samples reconstructed based on the candidate labels.

[0058] According to the scheme of this application embodiment, the evaluation model guides the inference model to predict reasonable labels with good consistency with the training samples, thereby improving the training effect of the inference model. Specifically, the scheme of this application embodiment uses the prediction results of the evaluation model to represent the correlation between candidate labels and training samples. Based on the strength of the correlation, candidate labels are determined to train the inference model. Candidate labels with a strong correlation with the training samples are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect. Using this inference model to process the data to be processed is conducive to obtaining more accurate prediction results.

[0059] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the evaluation model is trained based on training samples and a second candidate label. The second candidate label is determined based on the prediction results of the inference model. The second candidate label belongs to the candidate label set, and the prediction results of the inference model are used to indicate the evaluation value of the candidate label as the correct label.

[0060] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the prediction result of the evaluation model is the prediction probability of reconstructing the training sample based on the candidate labels, and the prediction probability of reconstructing the training sample based on the first candidate label is greater than or equal to the prediction probability of reconstructing the training sample based on other candidate labels.

[0061] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the second candidate label is sampled based on the prediction results of the inference model.

[0062] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the data to be processed includes image data, text data, or audio data.

[0063] Sixthly, an image processing method is provided, comprising: acquiring an image to be processed; and processing the image to be processed using an image processing model to obtain a processing result of the image to be processed. The image processing model is trained based on a sample image and a first candidate label, the first candidate label being determined according to the prediction result of an evaluation model, the first candidate label belonging to a candidate label set, the candidate label set including multiple candidate labels, and the prediction result of the evaluation model used to indicate the evaluation value of reconstructing the sample image based on the candidate labels.

[0064] According to the scheme of this application embodiment, the evaluation model guides the image processing model to predict reasonable labels with good consistency with the sample images, thereby improving the training effect of the image processing model. Specifically, the scheme of this application embodiment uses the prediction results of the evaluation model to represent the correlation between candidate labels and sample images. The candidate labels are determined based on the strength of the correlation to train the image processing model. Candidate labels with a strong correlation with the sample images are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect. Using this image processing model to process the image to be processed helps to obtain more accurate prediction results.

[0065] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the evaluation model is trained based on the sample image and the second candidate label. The second candidate label is determined based on the prediction result of the image processing model. The second candidate label belongs to the candidate label set, and the prediction result of the image processing model is used to indicate the evaluation value of the candidate label as the correct label.

[0066] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the prediction result of the evaluation model is the prediction probability of reconstructing the sample image based on the candidate labels, and the prediction probability of reconstructing the sample image based on the first candidate label is greater than or equal to the prediction probability of reconstructing the sample image based on other candidate labels.

[0067] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the second candidate label is sampled based on the prediction results of the image processing model.

[0068] In a seventh aspect, a training apparatus for a question-answering model is provided, the apparatus including a unit for performing a method for any of the implementations of the first aspect described above.

[0069] Eighthly, a training apparatus for a model is provided, the apparatus including a unit for performing a method for any of the implementations of the second aspect described above.

[0070] Ninthly, a training apparatus for an image processing model is provided, the apparatus including a unit for performing a method of any of the implementations of the third aspect described above.

[0071] In a tenth aspect, a question-answering apparatus is provided, the apparatus including a unit for performing a method for any of the implementations of the fourth aspect described above.

[0072] Eleventhly, a data processing apparatus is provided, the apparatus including a unit for performing a method of any implementation of the fifth aspect described above.

[0073] In a twelfth aspect, an image processing apparatus is provided, the apparatus including a unit for performing a method of any of the implementations of the sixth aspect described above.

[0074] In a thirteenth aspect, a training apparatus for a question-answering model is provided, the apparatus comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute a method in any implementation of the first aspect.

[0075] The processor mentioned in aspect thirteen above can be a central processing unit (CPU) or a combination of a CPU and a neural network processing processor. The neural network processing processor can include a graphics processing unit (GPU), a neural network processing unit (NPU), and a tensor processing unit (TPU), etc. The TPU is a dedicated integrated circuit from Google, designed entirely for machine learning and artificial intelligence accelerators.

[0076] In a fourteenth aspect, a model training apparatus is provided, the apparatus comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute a method in any implementation of the second aspect.

[0077] The processor mentioned in aspect fourteen above can be a CPU or a combination of a CPU and a neural network processing processor. The neural network processing processor can include GPUs, NPUs, TPUs, etc.

[0078] In a fifteenth aspect, a training apparatus for an image processing model is provided, the apparatus comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute a method in any implementation of the third aspect.

[0079] The processor mentioned in aspect 15 above can be a CPU or a combination of a CPU and a neural network processing processor. The neural network processing processor can include GPUs, NPUs, TPUs, etc.

[0080] In a sixteenth aspect, a question-answering device is provided, comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute a method in any implementation of the fourth aspect.

[0081] The processor mentioned in the sixteenth aspect above can be a CPU or a combination of a CPU and a neural network processing processor. The neural network processing processor can include GPUs, NPUs, and TPUs, etc.

[0082] In a seventeenth aspect, a data processing apparatus is provided, comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute a method in any implementation of the fifth aspect.

[0083] The processor mentioned in the seventeenth aspect above can be a CPU or a combination of a CPU and a neural network processing processor. The neural network processing processor can include GPUs, NPUs, TPUs, etc.

[0084] In an eighteenth aspect, an image processing apparatus is provided, comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method of any implementation of the sixth aspect.

[0085] The processor mentioned in the eighteenth aspect above can be a CPU or a combination of a CPU and a neural network processing processor. The neural network processing processor can include GPUs, NPUs, TPUs, etc.

[0086] In a nineteenth aspect, a computer-readable medium is provided that stores program code for execution by a device, the program code including methods for performing any implementation of any of the first to sixth aspects.

[0087] In a twentieth aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the method in any implementation of any of the first to sixth aspects described above.

[0088] In a twenty-first aspect, a chip is provided, the chip including a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface and executes the method in any implementation of any of the first to sixth aspects described above.

[0089] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in any one of the implementations of the first to sixth aspects. Attached Figure Description

[0090] Figure 1 This is a diagram illustrating a reading comprehension task;

[0091] Figure 2 This is a schematic diagram of a discrete reasoning task;

[0092] Figure 3 This is a schematic diagram of a semantic parsing task;

[0093] Figure 4 This is a schematic block diagram of the natural language processing system provided in the embodiments of this application;

[0094] Figure 5 This is a schematic diagram of a system architecture provided in an embodiment of this application;

[0095] Figure 6 This is a schematic flowchart illustrating a model training method provided in an embodiment of this application;

[0096] Figure 7 This is a schematic flowchart illustrating a training method for a question-answering model provided in an embodiment of this application;

[0097] Figure 8 This is a schematic diagram of the iterative process provided in the embodiments of this application;

[0098] Figure 9 This is a schematic diagram of the input data for the problem reconstruction model provided in the embodiments of this application;

[0099] Figure 10 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0100] Figure 11This is a schematic flowchart illustrating a question-and-answer method provided in an embodiment of this application;

[0101] Figure 1 2 is a schematic block diagram of a training device provided in an embodiment of this application;

[0102] Figure 1 3 is a schematic block diagram of an inference device provided in an embodiment of this application;

[0103] Figure 14 This is a schematic block diagram of another training device provided in the embodiments of this application;

[0104] Figure 1 5 is a schematic block diagram of another inference device provided in the embodiments of this application. Detailed Implementation

[0105] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0106] In strongly supervised training scenarios, models can be built using a large number of training samples, each labeled with a reliable ground truth label. However, due to the high cost of data labeling, many tasks struggle to obtain strong supervisory information such as ground truth labels. In such cases, weakly supervised training can be used to build models.

[0107] In some weakly supervised training scenarios, due to errors by the annotators or the difficulty in determining the labels themselves, not all labels in the training data are true values; that is, some labels are incorrect.

[0108] Question answering tasks aim to predict the correct reasoning solution for a given question, thereby obtaining the correct answer. However, because the correct reasoning solution is difficult to obtain, training data typically only provides the answer to the question, not the correct reasoning solution. A question may have multiple candidate reasoning solutions, of which usually only one is the correct one, i.e., the truth label. Other candidate reasoning solutions may happen to yield the correct answer, but these solutions do not truly answer the question; these are called spurious solutions, i.e., incorrect labels.

[0109] For example, such as Figure 1In the multi-mention reading comprehension task shown, the correct answer is "Creighton Ward". However, only the third "Creighton Ward" in the document is the correct reasoning solution. The other "Creighton Ward" in the document are irrelevant to the question.

[0110] For example, such as Figure 2 In the discrete reasoning task shown, the reasoning scheme for the problem relies on symbolic operations, for example, in Figure 2 It relies on subtraction operations. Figure 2 Two possible solutions are shown, both leading to the correct answer of two years. However, the first solution uses the first 1876 from the document, and only the first one is correct. The second solution uses the second 1876 from the document, which is irrelevant to the problem. In other words, the first solution is correct, and the second solution is harmful.

[0111] For example, such as Figure 3 In the semantic parsing task shown, the problem expressed in natural language needs to be converted into SQL statements that query the database. Figure 3 Two possible reasoning schemes are shown, both of which lead to the correct answer, but only the first reasoning scheme is correct, while the second reasoning scheme is harmful.

[0112] Crowdsourcing is a common method for collecting labels for training data. Specifically, unlabeled data is outsourced to a large number of people for labeling. These people provide labels based on their own judgment, making the reliability of the labels difficult to guarantee. There may even be "garbage producers" who randomly provide labels, or "rebels" who deliberately provide incorrect answers.

[0113] For example, the training data for an image classification model includes sample images and ground truth labels for those images, which indicate the true category of objects in the sample images. By outsourcing the annotation of the sample images, each image may correspond to multiple labels, which could include a large number of unreliable, i.e., incorrect, labels. Incorrect labels cannot be used to indicate the true category of objects in the sample images.

[0114] The solution proposed in this application can be applied to weakly supervised training scenarios to improve the training effect of the model.

[0115] Specifically, the embodiments of this application can be applied to scenarios that require weakly supervised training, such as image processing, audio processing, and natural language processing.

[0116] The following is a brief introduction to two scenarios: natural language processing and image processing.

[0117] Natural Language Processing:

[0118] Natural Language Processing (NLP) is an important research direction in the field of artificial intelligence, enabling human-computer interaction through natural language. Many NLP tasks can be modeled as question-answering tasks. Question-answering tasks can be performed by question-answering models. In other words, many NLP tasks can be performed by question-answering models. For example, reading comprehension, discrete reasoning, and semantic parsing tasks in NLP can all be modeled as question-answering tasks. The question-answering model trained using the scheme in the embodiments of this application can be used to perform the above tasks and obtain the corresponding task execution results.

[0119] In the embodiments of this application, the question-answering model can also be referred to as a question-answering system.

[0120] Image processing:

[0121] Image processing tasks include image classification, image super-resolution, image denoising, image detection, image semantic segmentation, image recognition, or object detection.

[0122] Taking image classification as an example, when users store a large number of pictures on terminal devices (such as mobile phones) or cloud storage, recognizing the images in the album can make it easier for users or systems to classify and manage the album, thereby improving the user experience.

[0123] The solution implemented in this application improves training effectiveness, facilitates accurate labeling of images of different categories, and makes it easier for users to view and search. Furthermore, these image category tags can be provided to the photo album management system for categorized management, saving users' management time, improving album management efficiency, and enhancing user experience.

[0124] The method provided in this application is described below from the perspectives of model training and model application.

[0125] The training method for the model provided in this application embodiment can specifically apply data processing methods such as data training, machine learning, and deep learning to perform symbolic and formal intelligent information modeling, extraction, preprocessing, and training on training samples, ultimately obtaining a trained model. For example, the training samples in this application may include a question, the conditional information of the question, and multiple candidate reasoning schemes corresponding to the question. During the training phase, the execution result of these multiple candidate reasoning schemes is the answer to the question. Furthermore, the method provided in this application embodiment can utilize the aforementioned trained model to input input data, such as the question to be processed in this application, the conditional information of the question to be processed, and the multiple reasoning schemes corresponding to the question to be processed, into the trained question-answering model to obtain output data, such as the confidence probabilities of these multiple reasoning schemes. Based on the confidence probabilities, a reasoning scheme is selected from these multiple reasoning schemes, and the answer to the question to be processed can be obtained based on this reasoning scheme. It should be noted that during the reasoning phase, the execution result of these multiple reasoning schemes is not necessarily the answer to the question.

[0126] It should be noted that the model training method and data processing method provided in the embodiments of this application are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as the model training stage and the model application stage.

[0127] To facilitate understanding of the embodiments of this application, the relevant concepts of related terms involved in the embodiments of this application will be introduced below.

[0128] (1) Neural Network

[0129] A neural network can be composed of neural units, which can be operational units that take xs and an intercept of 1 as inputs. The output of such an operational unit can be as follows:

[0130]

[0131] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x s The weights are denoted by b, where b is the bias of the neural unit.

[0132] f represents the activation function of the neural network, which introduces nonlinear characteristics to transform the input signal into the output signal. The output signal of this activation function can be used as the input to the next layer. For example, the activation function can be ReLU, tanh, or sigmoid.

[0133] A neural network is a network formed by connecting many of the above-mentioned individual neural units together; that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0134] (2) Deep Neural Networks

[0135] A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with multiple hidden layers. Based on the position of the layers, the internal neural network of a DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer.

[0136] Although DNNs seem complex, the operation of each layer is actually not complicated. Simply put, it involves the following linear relationship expression: in, It is the input vector. It is the output vector. α is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply an adjustment of the input vector. The output vector is obtained through this simple operation. Due to the large number of layers in a DNN, the coefficients W and the offset vector... The number of these parameters is also relatively large. The definitions of these parameters in DNNs are as follows: Taking the coefficient W as an example: Assuming a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W is located, while the subscript corresponds to the third layer index 2 of the output and the second layer index 4 of the input.

[0137] In summary, the coefficient from the k-th neuron in layer L-1 to the j-th neuron in layer L is defined as...

[0138] It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity," meaning it can accomplish more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).

[0139] (3) Loss Function

[0140] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This process continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are crucial equations used to measure the difference between the predicted and target values. For example, a higher loss value indicates a greater difference, and training a deep neural network becomes a process of minimizing this loss.

[0141] (4) Backpropagation algorithm

[0142] Neural networks can employ backpropagation (BP) to correct the initial parameter values ​​during training, thereby minimizing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the initial neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.

[0143] (5) Semantic parsing task

[0144] Semantic parsing tasks refer to the tasks of converting natural language into machine-executable logical languages ​​(e.g., Prolog, SQL, Python). For example, a question in natural language can be converted into an SQL statement, which can then be used to query a block of data to obtain the result of that question.

[0145] As mentioned above, the solutions in this application embodiment can be applied to natural language processing systems. Figure 4(a) illustrates an application scenario of a natural language processing system. In this scenario, the natural language processing system includes user devices and data processing devices. User devices include users and smart terminals such as mobile phones, personal computers, or information processing centers. The user device is the initiator of natural language data processing, acting as the initiator of requests such as language question answering or queries; typically, users initiate requests through their user devices.

[0146] Data processing devices can be cloud servers, network servers, application servers, management servers, or other devices or servers with data processing capabilities. These devices receive queries (voice / text) from smart terminals via interactive interfaces, and then perform language data processing through storage devices and processors, employing methods such as machine learning, deep learning, search, reasoning, and decision-making. Storage devices can be a general term encompassing local storage and databases storing historical data. These databases can reside on the data processing device or on other network servers.

[0147] Figure 4 (b) illustrates another application scenario for natural language processing systems. In this scenario, the user device directly acts as a data processing device, directly receiving input from the user and processing it directly by the user device's own hardware. The specific process is similar to... Figure 4 Similar to (a), please refer to the description above, and will not be repeated here.

[0148] Figure 4 (c) illustrates another application scenario of a natural language processing system. The natural language processing system may include local device 101, local device 102, execution device 110, and data storage system 150, wherein local device 101 and local device 102 are connected to execution device 110 through a communication network.

[0149] The execution device 110 is implemented by one or more servers, and optionally, in conjunction with other computing devices, such as data storage, routers, load balancers, etc. The execution device 110 can be deployed on a single physical site or distributed across multiple physical sites. The execution device 110 can use data from the data storage system 150 or call program code from the data storage system 150 to implement the question-answering model training method and data processing method of the embodiments of this application.

[0150] It should be noted that the aforementioned execution device 110 can also be called a cloud device. In this case, the execution device 110 can be deployed in the cloud, and the training method executed by the execution device 110 can be a training method executed in the cloud.

[0151] Users can interact with execution device 110 by operating their respective user devices (e.g., local device 101 and local device 102). Each local device can represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, game console, etc.

[0152] Each user's local device can interact with the execution device 110 through a communication network of any communication mechanism / standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.

[0153] The data storage system 150 can be integrated on the execution device 110, local device 101 or local device 102, or it can be set up in the cloud or on other network servers.

[0154] In one implementation, local device 101 or local device 102 can obtain relevant parameters of the question-answering model from execution device 110, and use the question-answering model on local device 101 or local device 102 to obtain the execution result of the question-answering task.

[0155] In another implementation, the question-answering model can be directly deployed on the execution device 110. The execution device 110 obtains the question to be processed and the condition information from the local device 101 and the local device 102, and obtains the execution result of the question-answering task through the question-answering model.

[0156] Figure 4 (a) and Figure 4 The user equipment in (b) can be Figure 4 Local device 101 or 102 in (c), Figure 4 (a) and Figure 4 The data processing device in (b) may be Figure 4 The execution device 110 in (c).

[0157] Figure 5 This illustration shows a system architecture 200 provided in an embodiment of this application. A data acquisition device 260 is used to collect training data and store it in a database 230. A training device 220 generates a target model / rule 201 based on the training data maintained in the database 230. The training device 220 can be used to execute the training method of the model in this embodiment of the application to obtain the target model / rule 201, for example, the question-answering model in this embodiment of the application. The specific process is detailed in the model training method described later. The model in this embodiment of the application can be a neural network model, or it can be other models.

[0158] It should be noted that in practical applications, the training data maintained in database 230 may not all come from the data acquisition device 260; it may also be received from other devices. Furthermore, it should be noted that training device 220 may not necessarily train the target model / rule 201 entirely based on the training data maintained in database 230; it may also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0159] Figure 5 The diagram shows the functional modules in the data processing process. For example, Figure 5 Client equipment 240 in the middle can be Figure 4 User equipment. In Figure 4 When the user equipment in the middle has a relatively strong data processing capability, Figure 5 The execution device 210 and the data storage system 250 can be integrated into Figure 4 Within the user equipment. In some embodiments, Figure 5 The execution device 210 and data storage system 250 can also be integrated into Figure 4 On the data processing equipment in the middle. Figure 5 The database 230, training device 220, and data acquisition device 260 can be integrated accordingly. Figure 4 The data processing equipment can be set up on other servers in the cloud or on the network.

[0160] For example, the data acquisition device 260 may be a terminal device, or an input / output interface of a server or cloud, used to acquire user input and return processing results as an interaction layer (interface).

[0161] The target model / rules obtained from training device 220 can be applied to different systems or devices. For example, when applied to... Figure 5 The execution device 210 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, AR / VR, vehicle terminal, etc., or it can be a server or cloud service. Figure 5 In the process, the execution device 210 is equipped with an I / O interface 212 for data interaction with external devices. The "user" can input data to the I / O interface 212 through the client device 240.

[0162] During the preprocessing of input data by the execution device 210, or the calculation module 211 of the execution device 210 performing calculations and other related processes, the execution device 210 can call data, code, etc. in the data storage system 250, or store data, instructions, etc. in the data storage system 250.

[0163] Finally, I / O interface 212 returns the processing result to client device 240 for use by the user.

[0164] It is worth noting that the training device 220 can generate corresponding target models / rules 201 based on different data for different objectives, in order to provide users with better results.

[0165] exist Figure 5 In the illustrated scenario, the user can manually specify the data input to execution device 210, for example, by operating through the interface provided by I / O interface 212. Alternatively, client device 240 can automatically input data to I / O interface 212 and obtain results. If automatic data input by client device 240 requires user authorization, the user can set appropriate permissions within client device 240. The user can view the results output by execution device 210 on client device 240, which can be presented through display, sound, animation, or other specific methods. Client device 240 can also act as a data acquisition terminal, storing the acquired data into database 230.

[0166] It is worth noting that Figure 5 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 5 In this context, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 may also be placed within the execution device 210.

[0167] Weakly supervised training simplifies the data collection process but can negatively impact model training performance. For example, in a weakly supervised question-answering model, if the model learns harmful reasoning patterns, it will negatively affect training results. For instance, a well-trained model might provide unreasonable reasoning or even incorrect answers.

[0168] This application provides a model training method that utilizes the correlation between training samples and candidate labels to train the inference model, which is beneficial for improving the training effect in weakly supervised training scenarios.

[0169] Figure 6 This application illustrates a model training method 600 provided in an embodiment. Figure 6 The method shown can be executed by a model training device, which can be a cloud service device or a terminal device, such as a computer, server, or other device with sufficient computing power to execute the model training method, or a system composed of cloud service devices and terminal devices.

[0170] For example, method 600 can be derived from... Figure 4The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 The training can be performed on any of the training devices 220.

[0171] For example, method 600 can be specifically derived from, for example... Figure 5 The training device 220 shown is used for execution, and the training data in method 600 can be as follows: Figure 5 The training data maintained in the database 230 shown.

[0172] The model in method 600 can be a neural network model or other models. This neural network model can be an existing neural network model, such as a CNN model, a residual network model, or a recurrent neural network model. Alternatively, the neural network model in this embodiment can also be constructed by the user; this embodiment does not limit this approach.

[0173] Method 600 includes steps S610 to S650.

[0174] S610, obtain the training samples and the corresponding candidate label set, the candidate label set includes multiple candidate labels.

[0175] It should be understood that the multiple candidate labels may include incorrect labels.

[0176] There can be one or more training samples.

[0177] Alternatively, training samples may include image data, text data, or voice data.

[0178] The solutions in this application can be used to train different inference models to perform different tasks. The inference model can be a neural network model or other models, and the types of training samples and candidate labels are related to the task type of the inference model.

[0179] The following examples illustrate the training samples and candidate labels for different tasks.

[0180] In one possible implementation, the inference model is used for image processing tasks, and the training samples can be image data. Specifically, image processing tasks can include image classification, image detection, image segmentation, image recognition, image generation, image super-resolution, image denoising, or object detection, etc.

[0181] For example, in an image classification task, the inference model is an image classification model. The training samples are image data, and the ground truth labels of the training samples are used to indicate the true category of objects in the sample images. It should be noted that the multiple candidate labels of the training samples may include incorrect labels; in other words, the information indicated by the candidate labels is not necessarily the true category of objects in the sample images.

[0182] For example, in an object detection task, the inference model is the object detection model. The training samples are image data, and the ground truth labels of the training samples are used to indicate the true category of the object in the sample image and the coordinates of the object. It should be noted that the multiple candidate labels of the training sample may include incorrect labels. In other words, the information indicated by the candidate labels is not necessarily the true category of the object in the sample image, nor is it necessarily the true coordinates of the object.

[0183] For example, in image super-resolution tasks, the inference model is an image super-resolution model. The training samples are image data, and the multiple candidate labels corresponding to the training samples can include multiple candidate images. The true label of the training samples can be the high-resolution image corresponding to the sample image. It should be noted that the multiple candidate labels of the training samples may include incorrect labels; in other words, the candidate image is not necessarily the high-resolution image corresponding to the sample image.

[0184] In another possible implementation, the inference model can be used for text processing tasks, and the training samples can be text data. Specifically, text processing tasks can include reading comprehension, discrete reasoning, semantic parsing, text recognition, or text translation.

[0185] For example, text processing tasks such as reading comprehension, discrete reasoning, and semantic parsing can be modeled as question-answering tasks. In question-answering tasks, the training samples are text data, and the multiple candidate labels corresponding to the training samples represent multiple candidate reasoning schemes for the question, while the truth label represents the correct reasoning scheme for the question. It should be noted that the multiple candidate labels of the training samples may include incorrect labels; in other words, a candidate reasoning scheme is not necessarily the correct reasoning scheme for the question.

[0186] In another possible implementation, the inference model is used for audio processing tasks, and the training samples can be audio data. Specifically, audio processing tasks include speech recognition or voiceprint recognition, etc.

[0187] It should be understood that the above are merely examples and do not constitute a limitation on the solutions of the embodiments of this application. The types of training samples and candidate labels can be set as needed.

[0188] For example, training samples can be obtained by reading them locally or by receiving them from other devices. This application does not limit the method of obtaining training samples.

[0189] Training samples and the corresponding candidate label set can be used to train inference models.

[0190] The training samples and the corresponding candidate label set can also be used to train and evaluate the model.

[0191] To better illustrate the method 600 of this application embodiment, the reasoning model and evaluation model will be described below.

[0192] The inference model is used to predict the correct label corresponding to the training sample.

[0193] Specifically, the goal of training is to obtain a well-trained inference model that, during the testing phase, takes the data to be processed as input and outputs label indication information, where the label is the correct label. For example, the label indication information can be the label itself. Alternatively, the label indication information can also include the confidence probabilities of multiple labels, with the label having the highest confidence probability being the correct label.

[0194] During the inference phase, the inference model takes the data to be processed as input and predicts the correct label.

[0195] During the training phase, the inference model can be used to predict whether a candidate label is the correct label based on the training samples. The prediction result of the inference model is its prediction of whether a candidate label is the correct label. In other words, the prediction result of the inference model is used to indicate the evaluation value of whether a candidate label is the correct label, and this evaluation value is used to assess the reliability of the candidate label being the correct label.

[0196] For example, the prediction result of the inference model can be represented as a probability value, that is, the probability value is used to represent the reliability of the candidate label being the correct label.

[0197] For example, the prediction result of the inference model may include the second confidence probability of the candidate label, which represents the predicted probability of the candidate label obtained from the training samples by the inference model.

[0198] The higher the second confidence probability of a candidate label, the higher the probability that the inference model will obtain the candidate label based on the training samples; in other words, the higher the reliability of the inference model in predicting the candidate label based on the training samples.

[0199] For example, the prediction results of the inference model can be represented as scores, that is, scores are used to represent the reliability of a candidate label as the correct label.

[0200] For example, the prediction result of the inference model may include a second score for the candidate label, which indicates the probability of obtaining the candidate label based on the training samples as predicted by the inference model.

[0201] The higher the second score of a candidate label, the higher the probability that the inference model will obtain that candidate label based on the training samples; in other words, the higher the reliability of the inference model in predicting that candidate label based on the training samples.

[0202] The embodiments of this application do not impose any limitations on the form of the prediction results of the inference model.

[0203] The evaluation model can be used to predict whether the training sample can be reconstructed based on the candidate labels. In other words, the evaluation model can be used to reconstruct the training sample based on the candidate labels.

[0204] The evaluation model can be determined based on either the reconstructed model or the generative model.

[0205] For example, when the inference model is used for an image processing task, the evaluation model can be determined based on an image reconstruction model or an image generation model.

[0206] For example, when the inference model is used for an audio processing task, the evaluation model can be determined based on the audio reconstruction model or the audio generation model.

[0207] The evaluation model's prediction result is its prediction of whether the training sample can be reconstructed based on the candidate labels. In other words, the evaluation model's prediction result is used to indicate the evaluation value of reconstructing the training sample based on the candidate labels, and this evaluation value is used to evaluate the probability of reconstructing the training sample.

[0208] The prediction results of the evaluation model can reflect the correlation between the training samples and the candidate labels. The higher the probability of reconstructing the training sample, the stronger the correlation between the training sample and the candidate label, and the more likely the candidate label is to be the correct label.

[0209] For example, the prediction result of the evaluation model can be represented as a probability value, that is, the probability value represents the possibility of reconstructing the training sample, or the probability value represents the possibility that the reconstructed training sample is the training sample.

[0210] For example, the prediction results of the evaluation model may include the first confidence probability of the candidate label, which represents the predicted probability of reconstructing the training sample from the candidate label by the evaluation model.

[0211] The higher the first confidence probability of a candidate label, the higher the likelihood that the evaluation model can reconstruct the training sample based on that candidate label.

[0212] For example, the prediction result of the evaluation model can be represented as a score, that is, the score can be used to represent the probability that the training sample can be reconstructed. Alternatively, a score can be assigned based on the reconstructed training sample, and the score can be used to represent the probability that the reconstructed training sample is the original training sample.

[0213] For example, the evaluation model's prediction results may include a first score for the candidate label, which indicates the probability predicted by the evaluation model of reconstructing the training sample using that candidate label.

[0214] The higher the first score of a candidate label, the more likely the evaluation model is to reconstruct the training sample based on the candidate label.

[0215] This application does not impose any limitations on the presentation format of the prediction results of the evaluation model.

[0216] For example, training samples can be obtained by reading them locally or by receiving them from other devices. This application does not limit the method of obtaining training samples.

[0217] S620, determine the first candidate label based on the prediction results of the evaluation model. The first candidate label belongs to the candidate label set.

[0218] S630 trains the inference model based on training samples and the first candidate label.

[0219] In other words, the prediction results of the evaluation model are used as the evaluation criteria for these multiple candidate labels. The first candidate label is determined based on the evaluation model's prediction of whether the training samples can be reconstructed from these multiple candidate labels.

[0220] As mentioned earlier, the prediction results of the evaluation model can reflect the correlation between the training samples and the candidate labels. In other words, step S620 can be understood as determining the first candidate label based on the correlation between the training samples and the candidate labels.

[0221] It should be noted that there can be one or more first candidate tags. This application does not limit the number of first candidate tags.

[0222] Specifically, step S620 may include: inputting candidate labels into the evaluation model to obtain the prediction results of the evaluation model.

[0223] In one possible implementation, step S620 may include: inputting multiple candidate labels from a first subset of the candidate label set into an evaluation model to obtain the prediction results of the evaluation model, and determining a first candidate label from the first subset based on the prediction results of the evaluation model.

[0224] It should be noted that the candidate tag set itself can also be regarded as the first subset of the candidate tag set.

[0225] In other words, an evaluation model can be used to predict whether the training sample can be reconstructed based on some or all of the candidate labels in the candidate label set. Using an evaluation model to predict whether the training sample can be reconstructed based on all candidate labels avoids missing correct labels. Using an evaluation model to predict whether the training sample can be reconstructed based on some candidate labels reduces computation time and improves training efficiency. This application does not limit the scope of the embodiments described herein.

[0226] Method 600 can be executed iteratively. During the iteration, the first subset in each iteration can be the same or different.

[0227] For example, the prediction result of the evaluation model may include the first confidence probabilities of multiple candidate labels in the first subset. In this case, a first candidate label is determined from the first subset based on the first confidence probabilities of the multiple candidate labels in the first subset.

[0228] Alternatively, the prediction results of the evaluation model may include the first scores of multiple candidate labels in the first subset.

[0229] For example, a first candidate label is obtained by sampling from the first subset based on the first confidence probability of multiple candidate labels in the first subset.

[0230] Candidate labels with higher first confidence probabilities are more likely to be identified as the first candidate label compared to candidate labels with lower first confidence probabilities.

[0231] Optionally, the first confidence probability of the first candidate label is greater than or equal to the first confidence probabilities of other candidate labels in the first subset.

[0232] Alternatively, the first candidate label is determined as one or more candidate labels with the highest confidence probability in the first subset.

[0233] Specifically, the prediction probability of reconstructing the training sample based on the first candidate label is greater than or equal to the prediction probability of reconstructing the training sample based on other candidate labels.

[0234] In this case, the first candidate label is the one with the strongest relevance to the training samples, as determined by the evaluation model, and the inference model is then trained based on this candidate label. This training method can be called a greedy optimization method.

[0235] It should be noted that step S620 can also be understood as determining the first candidate label based at least on the prediction results of the evaluation model.

[0236] For example, the first candidate label can be determined based on the prediction results of the inference model and the prediction results of the evaluation model.

[0237] For example, the evaluation model's prediction includes the first confidence probability of the candidate label, while the inference model's prediction includes the second confidence probability of the candidate label. The candidate label with the highest first confidence probability and the candidate label with the highest second confidence probability are selected as the first candidate label.

[0238] The evaluation model can be a pre-trained model. Alternatively, the evaluation model can be trained based on steps S640 to S650.

[0239] Step S630 can be understood as at least using the first candidate label as an optimized candidate label, that is, the optimized candidate labels include at least the first candidate label.

[0240] In other words, the parameters of the inference model are adjusted by treating the first candidate label as the correct label.

[0241] In this way, the inference model can adjust its parameters to increase the reliability of the first candidate label.

[0242] For example, step S630 may include adjusting the parameters of the inference model with the goal of increasing the second confidence probability of the first candidate label.

[0243] In this way, the inference model can adjust its parameters in the direction of increasing the second confidence level of the first candidate label.

[0244] Alternatively, step S630 may include adjusting the parameters of the inference model with the goal of increasing the second confidence probability of the first candidate label and some labels in other candidate labels of the first subset.

[0245] In the embodiments of this application, an evaluation model is used to guide the inference model to predict reasonable labels that have good consistency with the training samples, thereby improving the training effect of the inference model. Specifically, the embodiments of this application use the prediction results of the evaluation model to represent the correlation between candidate labels and training samples. Candidate labels are selected based on the strength of the correlation to train the inference model. Candidate labels with a strong correlation with the training samples are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect.

[0246] Furthermore, according to the scheme of the embodiments of this application, the inference model can be trained based on the optimal candidate labels obtained by the evaluation model, that is, the inference model can be trained by a greedy optimization method, which can make the training process more stable.

[0247] S640, a second candidate label is determined based on the prediction results of the inference model. The second candidate label belongs to the candidate label set. The prediction results of the inference model are used to indicate the evaluation value of the candidate label as the correct label.

[0248] S650 trains the evaluation model based on training samples and second candidate labels.

[0249] In other words, the prediction results of the inference model are used as the evaluation criterion for the multiple candidate labels. Based on the inference model's prediction of whether the multiple candidate labels are correct labels, the second candidate label is determined.

[0250] It should be noted that there can be one or more second candidate tags. This application does not limit the number of second candidate tags.

[0251] Specifically, step S640 may include: inputting training samples and candidate labels into the inference model to obtain the prediction results of the inference model.

[0252] In one possible implementation, step S640 may include: inputting multiple candidate labels from a second subset of the training samples and the candidate label set into the inference model to obtain the prediction result of the inference model, and determining a second candidate label from the second subset based on the prediction result of the inference model.

[0253] It should be noted that the candidate tag set itself can also be regarded as a second subset of the candidate tag set.

[0254] In other words, in step S640, an inference model can be used to predict whether some or all of the candidate labels in the candidate label set are correct labels. Using an inference model to predict whether all candidate labels are correct avoids missing correct labels. Using an inference model to predict whether some candidate labels are correct reduces computation time and improves training efficiency. This application's embodiments do not limit this aspect.

[0255] The first subset and the second subset can be the same or different.

[0256] Method 600 can be executed iteratively. During the iteration, the second subset in each iteration can be the same or different.

[0257] For example, the prediction result of the inference model may include a second confidence probability of multiple candidate labels in the second subset. In this case, a second candidate label is determined from the second subset based on the second confidence probability of the multiple candidate labels in the second subset.

[0258] Alternatively, the prediction results of the inference model may include second scores for multiple candidate labels from a second subset.

[0259] Optionally, step S640 may include sampling a second candidate label based on the prediction results of the inference model.

[0260] For example, a second candidate label is obtained by sampling based on the second confidence probability of the candidate label.

[0261] Candidate labels with higher second confidence probabilities are more likely to be identified as second candidate labels compared to candidate labels with lower second confidence probabilities.

[0262] Alternatively, one or more candidate labels with the highest second confidence probability may be identified as the second candidate labels.

[0263] It should be noted that step S640 can also be understood as determining the second candidate label based at least on the prediction results of the inference model.

[0264] For example, the second candidate label can be determined based on the prediction results of the inference model and the prediction results of the evaluation model.

[0265] For example, the evaluation model's prediction includes the first confidence probability of the candidate labels, while the inference model's prediction includes the second confidence probability of the candidate labels. The candidate label with the highest first confidence probability and the candidate label with the highest second confidence probability are selected as the second candidate label.

[0266] Step S650 can be understood as at least using the second candidate label as an optimized candidate label, that is, the optimized candidate label includes at least the second candidate label.

[0267] In other words, the second candidate label is used as input data to reconstruct the training sample, which serves as the optimization direction to adjust the parameters of the evaluation model.

[0268] For example, step S650 may include adjusting the parameters of the evaluation model with the goal of increasing the first confidence probability of the second candidate label.

[0269] In this way, the evaluation model can adjust its parameters in the direction of increasing the first confidence probability of the second candidate label.

[0270] Alternatively, step S650 may include adjusting the parameters of the evaluation model with the goal of increasing the first confidence probability of some labels in the second candidate label and other candidate labels of the second subset.

[0271] It should be noted that steps S640 to S650 are optional steps.

[0272] In the case where method 600 includes steps S640 to S650, steps S620 to S630 and steps S640 or S650 are executed alternately, that is, the inference model and the evaluation model are trained alternately.

[0273] In other words, the inference model is trained based on the prediction results of the evaluation model, and the evaluation model is trained based on the prediction results of the inference model.

[0274] For example, the second candidate label is sampled based on the confidence probability of the inference model, the evaluation model is trained to reconstruct the training sample from the second candidate label, and the inference model is trained based on the most likely candidate label obtained by the evaluation model.

[0275] It should be understood that the step numbers above do not limit the order in which the steps are executed. The following example illustrates this alternating training process.

[0276] In step S640, a second candidate label can be determined based on the prediction results of the first inference model.

[0277] The prediction result of the first inference model is its prediction of whether a candidate label is the correct label. In other words, the prediction result of the first inference model indicates its evaluation value for a candidate label being the correct label.

[0278] For example, the second confidence probability of the candidate label is obtained using the first inference model, and the second candidate label is determined based on the second confidence probability of the candidate label.

[0279] In step S650, the parameters of the first evaluation model can be adjusted based on the training samples and the second candidate label to obtain the second evaluation model.

[0280] For example, the parameters of the first evaluation model are adjusted with the goal of increasing the first confidence probability of the second candidate label to obtain the second evaluation model.

[0281] This makes it easier for the second evaluation model to predict the training sample based on the second candidate label (i.e., the first confidence probability) to be greater than the first evaluation model to predict the training sample based on the second candidate label.

[0282] In step S620, the first candidate label can be determined based on the prediction results of the second evaluation model.

[0283] The prediction result of the second evaluation model is its prediction of whether the training samples can be reconstructed based on the candidate labels. In other words, the prediction result of the second evaluation model is used to indicate the evaluation value of the reconstructed training samples.

[0284] For example, the first confidence probability of the candidate label is obtained using the second evaluation model, and the first candidate label is determined based on the first confidence probability of the candidate label.

[0285] In step S630, the parameters of the first inference model are adjusted based on the training samples and the first candidate label to obtain the second inference model.

[0286] For example, the parameters of the first inference model are adjusted with the goal of increasing the second confidence probability of the first candidate label to obtain the second inference model.

[0287] This makes it easier for the second inference model to predict that the first candidate label is the correct label (i.e., the second confidence probability) is greater than the first inference model's prediction that the first candidate label is the correct label.

[0288] The second inference model obtained in this iteration is used as the first inference model in steps S640 and S630 of the next iteration, and the second evaluation model obtained in this iteration is used as the first evaluation model in step S650. The above process is repeated. After the iteration termination condition is met, the training is completed, and the trained inference model is obtained.

[0289] The iteration termination condition can be set according to existing schemes. For example, the iteration termination condition can be that the number of iterations is greater than or equal to a first threshold.

[0290] It should be understood that both the first and second inference models are inference models used during the training process. The only difference between the first and second inference models lies in their parameters. The confidence probabilities obtained from the inference models can both be referred to as the "second confidence probabilities of the candidate labels".

[0291] The first and second evaluation models are evaluation models used during the training process. The only difference between the first and second evaluation models lies in their parameters. The confidence probabilities obtained from the evaluation models can both be called the "first confidence probabilities of the candidate labels".

[0292] In this embodiment of the application, the evaluation model is trained by determining the second candidate label based on the prediction result of the inference model, which can improve the training effect of the evaluation model and enable the evaluation model to reconstruct the training samples more accurately.

[0293] To better illustrate the solutions of the embodiments of this application, the solutions of the embodiments of this application will be described below in conjunction with specific application scenarios.

[0294] In the field of natural language processing, to mitigate the problem of harmful inference schemes, most existing training methods typically select candidate inference schemes with high confidence probabilities for training the question-answering model. However, when there are many candidate inference schemes or the noise level is high, the confidence probabilities of the question-answering model are unreliable. That is, even candidate inference schemes with high confidence probabilities may be harmful inference schemes, and training based on such candidate inference schemes will affect the training effect of the question-answering model.

[0295] A question typically provides clues about how to reason correctly, while a flawed reasoning scheme often fails to align well with the question. In the solution of this application embodiment, mutual information is used to measure the semantic relevance between the question and candidate reasoning schemes. By maximizing the mutual information between the question and candidate reasoning schemes, the problems caused by harmful reasoning schemes are mitigated, which helps the question-answering model to be trained based on more accurate reasoning schemes.

[0296] Specifically, this application provides a training method for a question-answering model, which selects candidate reasoning schemes for training by utilizing the semantic association strength between the question and the candidate reasoning schemes, so as to reduce the impact of harmful reasoning schemes on training, improve the training effect of the model, and facilitate obtaining the correct answer.

[0297] Different question-answering models can be trained based on different types of training samples to perform different natural language processing tasks.

[0298] The goal of training a question-answering model is to obtain the optimal model by maximizing mutual information.

[0299] The objective function can satisfy the following formula:

[0300]

[0301] Where θ represents the parameters of the question-answering model, I θ (<q,a> ; z, d) denotes the distribution defined on P(d, q, a)P θ Regarding (z|d, q, a)<q,a> The conditional mutual information between z and z, H(|) represents the conditional entropy of the random variable, H(<q,a> |d) represents the condition given by condition information d,<q,a> conditional entropy, H θ (<q,a> |d, z) represents the condition given the conditional information d and the candidate reasoning scheme z.<q,a> The conditional entropy. E represents the calculation of the average value, P(d, q, a) represents the distribution of the training samples, P θ (z|d, q, a) represents the posterior predicted probability of a candidate reasoning scheme z (belonging to the set Z of candidate reasoning schemes), that is, the predicted probability of the candidate reasoning scheme z given the conditional information d, the question q, and the answer a. P θ (q, a|d, z) represents the joint predicted probability of question q and answer a given conditional information d and candidate reasoning scheme z.

[0302] P θ (z|d, q, a) can satisfy the following formula:

[0303]

[0304] Among them, Pθ (z|d,q) represents the predicted probability of candidate reasoning solution z given conditional information d and question q, that is, the predicted probability that candidate reasoning solution z predicted by the question answering model is the correct reasoning solution.

[0305] P θ (q, a|d, z) is difficult to calculate directly. In this embodiment, P is approximated by the predicted probability of problem q given the conditional information d and the candidate reasoning scheme z. θ (q, a|d, z).

[0306] Specifically, through I(f(z)=a)P φ (q|d, z) is used to approximate P θ (q, a|d, z). Where I() represents the indicator function. P φ (q|d, z) represents the predicted probability of problem q given the conditional information d and the candidate reasoning scheme z. In the embodiments of this application, P φ (q|d, z) can be predicted by the problem reconstruction model, where φ represents the parameters of the problem reconstruction model. That is, the conditional information and candidate reasoning schemes are input into the problem reconstruction model for processing to obtain the predicted probability of the problem reconstructed by the problem reconstruction model, that is, the predicted probability of problem q given the conditional information d and the candidate reasoning scheme z.

[0307] Furthermore, in this case, the objective function can be expressed in the following form:

[0308]

[0309] L1 represents the first optimization term of the objective function, and L2 represents the second optimization term of the objective function. The optimization process of the objective function can be achieved through iteration.

[0310] In each iteration, L2 can be minimized by updating the problem reconstruction model to make P φ (q|d, z) better approximates P θ (q, a|d, z), and update the question answering model by maximizing L1.

[0311] For example, when minimizing L2, the candidate prediction probability P of the candidate inference scheme can be used. θ (z|d, q, a) Determine the candidate inference scheme z', which is the second candidate inference scheme described later, and adjust the parameters of the problem reconstruction model based on the candidate inference scheme z'. For a detailed description, please refer to steps S740 to S750 below.

[0312] When maximizing L1, candidate inference scheme z” can be determined based on the prediction results of the question reconstruction model, i.e., the first candidate inference scheme mentioned later, and the question answering model can be trained based on the candidate inference scheme z”. For a detailed description, please refer to steps S720 to S730 below.

[0313] Figure 7 This application provides a training method 700 for a question-answering model. Method 700 can be considered as... Figure 6 The method shown is a specific implementation in the field of natural language processing. Figure 7 The method shown can be executed by a training device for the question-answering model. This training device can be a cloud service device or a terminal device, such as a computer or server with sufficient computing power to execute the training method for the question-answering model. It can also be a system composed of cloud service devices and terminal devices.

[0314] For example, method 700 can be derived from... Figure 4 The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 The training can be performed on any of the training devices 220.

[0315] For example, method 700 can be specifically derived from, such as Figure 5 The training device 220 shown is used for execution, and the training data in method 700 can be as follows: Figure 5 The training data maintained in the database 230 shown.

[0316] Method 700 includes steps S710 to S750.

[0317] S710: Obtain the training sample and the corresponding set of candidate reasoning solutions. The training sample includes the question and its conditional information. The set of candidate reasoning solutions includes multiple candidate reasoning solutions, and the execution result of these multiple candidate reasoning solutions is the answer to the question. In other words, the execution result of the candidate reasoning solutions in the set of candidate reasoning solutions is the answer to the question.

[0318] Step S710 corresponds to step S610 in method 600. The candidate reasoning scheme is the candidate label in method 600.

[0319] Different question-answering models can be trained based on different types of training samples to perform different natural language processing tasks.

[0320] The conditional information of a question can also be understood as the reference information for the question, that is, the information needed to answer the question. For different natural language processing tasks, that is, for different question-answering models, the conditional information can be different types of data.

[0321] Optionally, the conditional information for the question includes the documents associated with the question.

[0322] For example, for such Figure 1 The multi-word reading comprehension task shown or such Figure 2 The discrete reasoning task shown can include one or more documents as conditional information.

[0323] For example, regarding such Figure 3 The table-based semantic parsing task shown can include table headers as conditional information. Table headers can also be understood as a document type.

[0324] A reasoning scheme can be understood as the process of finding the answer; executing this process yields the answer. Multiple candidate reasoning schemes in the set of candidate reasoning schemes represent various solution processes that can lead to the answer.

[0325] For different natural language processing tasks, i.e., for different question-answering models, candidate inference schemes can be different types of data.

[0326] For example, in such Figure 1 In the multi-word reading comprehension task shown, candidate inference schemes can be a specific span within a document. Candidate inference schemes are... Figure 1 Possible reasoning solutions.

[0327] For example, in the case of Figure 2 In the discrete reasoning task shown, a candidate reasoning scheme can be a formula.

[0328] For example, in the case of Figure 3 In the semantic analysis task shown, the candidate inference scheme can be an SQL statement.

[0329] Furthermore, the training samples can also include answers to questions.

[0330] For example, training samples can be represented in the form of tuples. For instance, a training sample can be represented as a tuple <d, q, a>, where q represents the question, a represents the answer, and d represents the conditional information. Correspondingly, a training sample and a corresponding candidate reasoning scheme can be represented as a tuple <d, q, a, z>, where z represents the candidate reasoning scheme.

[0331] Training samples can also be called training instances.

[0332] For example, training samples can be obtained by reading them locally or by receiving them from other devices. This application does not limit the method of obtaining training samples.

[0333] For example, the multiple candidate reasoning schemes corresponding to the training sample can be pre-computed. That is, multiple candidate reasoning schemes are pre-computed for the training sample. For example, candidate reasoning schemes can be obtained by enumeration. Or, a set Z of reasoning schemes that can map to the answer corresponding to the question can be obtained by searching, that is, the set of candidate reasoning schemes Z = {z|f(z) = a}. The reasoning schemes in this set are the multiple candidate reasoning schemes. f() represents a function that maps the reasoning scheme to the execution result (i.e., the answer) of the reasoning scheme.

[0334] For example, in a reading comprehension task, all possible reasoning schemes can include all the spans in the document. By enumerating the spans that match the answer, we obtain a set of candidate reasoning schemes.

[0335] For example, in discrete reasoning tasks, the discrete operations involved in the reasoning scheme can be predefined and the operation sequence format can be standardized to define the search space. Then, the discrete operation sequence with the correct answer can be selected by enumeration, thus obtaining the candidate reasoning set.

[0336] For example, in semantic analysis tasks, the form of SQL statements can be predefined to define the search space, and then the SQL statements with correct answers can be filtered out by enumeration to obtain the candidate inference set.

[0337] For different reasoning schemes, f() can be a function of different types.

[0338] For example, in such Figure 1 In the multi-word reading comprehension task shown, f() can be a specific span in the returned document.

[0339] For example, in the case of Figure 2 In the discrete reasoning task shown, f() can be used to solve a formula.

[0340] For example, in the case of Figure 3 In the semantic analysis task shown, f() can be used to execute an SQL statement.

[0341] It should be understood that the training sample obtained in step S710 can be one or more. For example, in step S710, multiple sets of <d, q, a> and multiple candidate inference schemes corresponding to each set of <d, q, a> can be obtained. The embodiments of this application do not limit the number of training samples.

[0342] The training samples and the corresponding set of candidate inference schemes can be used to train the question answering model.

[0343] The training samples and the corresponding set of candidate inference schemes can also be used to train the problem reconstruction model.

[0344] To better illustrate the method 700 of this application embodiment, the question-answering model and the question reconstruction model will be explained below.

[0345] Question-answering models are used to predict the correct reasoning solution for a question. During training, the correct reasoning solutions for questions in the training samples can also be referred to as the correct reasoning solutions for the training samples.

[0346] Specifically, the training objective is to obtain a well-trained question-answering model that, during the testing phase, takes <d, q> as input and outputs indication information of a reasoning scheme. The execution result of this reasoning scheme is the answer to the question. For example, the indication information of the reasoning scheme can be the reasoning scheme itself. Alternatively, the indication information of the reasoning scheme can also include the confidence probabilities of multiple reasoning schemes, with the execution result of the reasoning scheme with the highest confidence probability among these multiple schemes being the answer to the question.

[0347] During the reasoning phase, using <d, q> as input, the correct reasoning scheme is predicted, and then the reasoning scheme is executed to obtain the predicted answer.

[0348] During the training phase, the question-answering model can be used to predict whether a candidate reasoning solution is correct based on the question and its conditional information. The prediction result of the question-answering model is its prediction of whether a candidate reasoning solution is correct. In other words, the prediction result of the question-answering model is used to indicate the evaluation value of whether a candidate reasoning solution is correct, and this evaluation value is used to assess the reliability of the candidate reasoning solution as a correct reasoning solution.

[0349] For example, the prediction result of the question-answering model can be represented as a probability value, that is, the probability value is used to represent the reliability of the candidate reasoning solution as the correct reasoning solution.

[0350] For example, the prediction result of a question-answering model may include the second confidence probability of a candidate reasoning solution. The second confidence probability of a candidate reasoning solution represents the prediction probability P obtained by the question-answering model based on the question and the conditional information of the question. θ (z|d,q).

[0351] The higher the second confidence probability of a candidate reasoning solution, the higher the probability that the question-answering model will obtain the candidate reasoning solution based on the question and the conditional information of the question; in other words, the higher the reliability of the question-answering model in predicting the candidate reasoning solution based on the question and the conditional information of the question.

[0352] For example, the prediction results of a question-answering model can be represented as scores, that is, scores are used to indicate the reliability of a candidate reasoning solution as a correct reasoning solution.

[0353] For example, the prediction results of a question-answering model may include a second score for a candidate reasoning scheme, which indicates the probability of obtaining the candidate reasoning scheme based on the question and the conditional information of the question, as predicted by the question-answering model.

[0354] The higher the second score of a candidate reasoning solution, the higher the probability that the question-answering model will obtain the candidate reasoning solution based on the question and the conditional information of the question; in other words, the higher the reliability of the question-answering model in predicting the candidate reasoning solution based on the question and the conditional information of the question.

[0355] This application does not impose any limitations on the form of the prediction results of the question-answering model.

[0356] Problem reconstruction models can be used to predict whether the problem can be reconstructed based on the problem's conditional information and candidate reasoning schemes. In other words, problem reconstruction models can be used to reconstruct the problem based on the problem's conditional information and candidate reasoning schemes.

[0357] The prediction result of the problem reconstruction model is its prediction of whether the problem can be reconstructed based on the problem's conditional information and candidate reasoning solutions. In other words, the prediction result of the problem reconstruction model indicates the evaluation value for reconstructing the problem based on the problem's conditional information and candidate reasoning solutions; this evaluation value assesses the probability of reconstructing the problem.

[0358] The prediction results of the problem reconstruction model can reflect the semantic correlation between the problem and the candidate reasoning solution. The higher the probability of reconstructing the problem, the stronger the semantic correlation between the problem and the candidate reasoning solution, and the more likely the candidate reasoning solution is the correct reasoning solution.

[0359] For example, the prediction result of the problem reconstruction model can be represented as a probability value, that is, the probability value represents the possibility of reconstructing the problem, or the probability value represents the possibility of reconstructing the problem as the problem.

[0360] For example, the prediction result of the problem reconstruction model may include the first confidence probability of the candidate inference scheme. The first confidence probability of the candidate inference scheme represents the prediction probability P obtained by the problem reconstruction model of reconstructing the problem using the conditional information and the candidate inference scheme. φ (q|d, z). Where φ represents the parameters of the problem reconstruction model.

[0361] The higher the first confidence probability of a candidate reasoning scheme, the higher the probability that the problem reconstruction model can reconstruct the problem based on the candidate reasoning scheme and the conditional information of the problem.

[0362] For example, the prediction result of the problem reconstruction model can be represented as a score, that is, the score can be used to represent the probability of reconstructing the problem. Alternatively, based on the score of the reconstructed problem, the score can be used to represent the probability that the reconstructed problem is the problem.

[0363] For example, the prediction result of the problem reconstruction model may include a first score of the candidate reasoning solution, which indicates the probability predicted by the problem reconstruction model of reconstructing the problem using the conditional information and the candidate reasoning solution. For instance, a second score of the candidate reasoning solution could be log P. φ (q|d, z).

[0364] The higher the first score of the candidate reasoning solution, the higher the probability that the problem reconstruction model can reconstruct the problem based on the candidate reasoning solution and the conditional information of the problem.

[0365] This application does not impose any limitations on the presentation format of the prediction results of the problem reconstruction model.

[0366] S720, determine the first candidate reasoning scheme based on the prediction results of the problem reconstruction model, and the first candidate reasoning scheme belongs to the candidate reasoning scheme set.

[0367] Step S720 corresponds to step S620 in method 600. The problem reconstruction model is the evaluation model in method 600. The first candidate reasoning scheme is the first candidate label in method 600.

[0368] For example, the problem reconstruction model is used to obtain the prediction result of the problem reconstruction model based on the conditional information of the problem and multiple candidate reasoning schemes. The prediction result of the problem reconstruction model is used to indicate the evaluation value of the problem reconstructed based on the conditional information of the problem and the multiple candidate reasoning schemes. The multiple candidate reasoning schemes correspond to multiple evaluation values. The multiple candidate reasoning schemes belong to a set of candidate reasoning schemes.

[0369] S730 trains the question-answering model based on training samples and the first candidate reasoning scheme.

[0370] Step S730 corresponds to step S630 in method 600. The question-answering model is the reasoning model in method 600.

[0371] In other words, the prediction results of the problem reconstruction model are used as the evaluation criteria for the multiple candidate inference schemes. Based on whether the problem reconstruction model can reconstruct the problem from the conditional information of the problem and whether the multiple candidate inference schemes can reconstruct the problem, the first candidate inference scheme is determined.

[0372] As mentioned earlier, the prediction results of the problem reconstruction model can reflect the semantic correlation between the problem and the candidate reasoning schemes. In other words, step S720 can be understood as determining the first candidate reasoning scheme based on the semantic correlation between the problem and the candidate reasoning schemes.

[0373] It should be noted that there can be one or more first candidate inference schemes. This application does not limit the number of first candidate inference schemes in its embodiments.

[0374] Specifically, step S720 may include: inputting the conditional information of the problem and candidate reasoning schemes into the problem reconstruction model to obtain the prediction results of the problem reconstruction model.

[0375] In one possible implementation, step S720 may include: inputting the conditional information of the problem and multiple candidate reasoning schemes of a first subset of the candidate reasoning scheme set into the problem reconstruction model to obtain the prediction result of the problem reconstruction model, and determining a first candidate reasoning scheme from the first subset based on the prediction result of the problem reconstruction model.

[0376] It should be noted that the set of candidate reasoning schemes can also be regarded as the first subset of the set of candidate reasoning schemes.

[0377] In other words, a problem reconstruction model can be used to predict whether the problem can be reconstructed based on some or all of the candidate reasoning solutions in the candidate reasoning solution set. Using a problem reconstruction model to predict whether the problem can be reconstructed based on all candidate reasoning solutions can avoid missing correct reasoning solutions. Using a problem reconstruction model to predict whether the problem can be reconstructed based on some candidate reasoning solutions can reduce computation time and improve training efficiency. This application does not limit the scope of the embodiments described herein.

[0378] Method 700 can be executed iteratively. During the iteration, the first subset in each iteration can be the same or different.

[0379] For example, the prediction result of the problem reconstruction model may include the first confidence probabilities of multiple candidate inference schemes in the first subset. In this case, a first candidate inference scheme is determined from the first subset based on the first confidence probabilities of the multiple candidate inference schemes in the first subset.

[0380] Alternatively, the prediction results of the problem reconstruction model may include the first scores of multiple candidate inference schemes in the first subset.

[0381] For example, a first candidate reasoning scheme is obtained by sampling from the first subset based on the first confidence probability of multiple candidate reasoning schemes in the first subset.

[0382] Compared to candidate inference schemes with lower first confidence probabilities, candidate inference schemes with higher first confidence probabilities are more likely to be identified as the first candidate inference scheme.

[0383] Optionally, the first confidence probability of the first candidate reasoning scheme is greater than or equal to the first confidence probability of other candidate reasoning schemes in the first subset.

[0384] Alternatively, the first candidate reasoning scheme is determined as one or more candidate reasoning schemes with the highest first confidence probability in the first subset.

[0385] Specifically, the probability of reconstructing the prediction of the problem based on the conditional information of the problem and the first candidate reasoning scheme is greater than or equal to the probability of reconstructing the prediction of the problem based on the conditional information of the problem and other candidate reasoning schemes.

[0386] In this case, the first candidate reasoning scheme is the one with the strongest semantic relevance to the question, as determined by the question reconstruction model. The question-answering model is then trained based on this candidate reasoning scheme. This training method can be called a greedy optimization approach.

[0387] It should be noted that step S720 can also be understood as determining the first candidate inference scheme based at least on the prediction results of the problem reconstruction model.

[0388] For example, the first candidate reasoning scheme can be determined based on the prediction results of the question answering model and the prediction results of the question reconstruction model.

[0389] For example, the prediction result of the question reconstruction model includes the first confidence probability of the candidate reasoning solution, while the prediction result of the question answering model includes the second confidence probability of the candidate reasoning solution. The candidate reasoning solution with the highest first confidence probability and the candidate reasoning solution with the highest second confidence probability are selected as the first candidate reasoning solution.

[0390] The problem reconstruction model can be a pre-trained model. Alternatively, the problem reconstruction model can be trained based on steps S740 to S750.

[0391] Step S730 can be understood as including at least the first candidate reasoning scheme as an optimized candidate reasoning scheme, that is, the optimized candidate reasoning scheme includes at least the first candidate reasoning scheme.

[0392] Step S730 can also be understood as adjusting the parameters of the question-answering model with the goal of increasing the value of the first objective function. The first objective function is L1 mentioned earlier, that is, updating the question-answering model by maximizing L1.

[0393] In other words, the parameters of the question-answering model are adjusted by treating the first candidate reasoning scheme as the correct reasoning scheme.

[0394] In this way, the question-answering model can adjust its parameters to increase the reliability of the first candidate reasoning solution.

[0395] For example, step S730 may include adjusting the parameters of the question-answering model with the goal of increasing the second confidence probability of the first candidate reasoning scheme.

[0396] For example, to maximize log P θ (z″|d,q) is the parameter of the question-answering model updated with the target, and the candidate reasoning scheme z” is the first candidate reasoning scheme.

[0397] In this way, the question-answering model can adjust its parameters in the direction of increasing the second confidence of the first candidate reasoning scheme.

[0398] Alternatively, step S730 may include adjusting the parameters of the question-answering model with the goal of increasing the second confidence probability of some of the other candidate inference schemes in the first subset.

[0399] For example, the first subset includes scheme A, scheme B, scheme C and scheme D, the first candidate reasoning scheme is scheme A, and the parameters of the question answering model are adjusted with the goal of increasing the second confidence probability of scheme A and the second confidence probability of scheme B.

[0400] In the scheme of this application embodiment, a question reconstruction model is used to guide the question answering model to predict reasonable reasoning schemes that are highly consistent with the question, thereby improving the training effect of the question answering model. Specifically, the scheme of this application embodiment uses the prediction results of the question reconstruction model to represent the semantic relevance between candidate reasoning schemes and the question. The candidate reasoning schemes are selected based on the strength of semantic relevance to train the question answering model. Candidate reasoning schemes with strong semantic relevance to the question are more likely to be correct reasoning schemes, thereby helping to mitigate the impact of harmful reasoning schemes and improving the training effect.

[0401] Furthermore, according to the scheme of the embodiments of this application, the question answering model can be trained based on the optimal candidate reasoning scheme obtained from the question reconstruction model, that is, the question answering model can be trained by using a greedy optimization method, which can make the training process more stable.

[0402] S740, determine the second candidate reasoning scheme based on the prediction results of the question-answering model, and the second candidate reasoning scheme belongs to the candidate reasoning scheme set.

[0403] Step S740 corresponds to step S640 in method 600. The second candidate reasoning scheme is the second candidate label in method 600.

[0404] Specifically, the question-answering model can be used to obtain the prediction results of the question-answering model based on the question and the condition information of the question. The prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes, and these multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

[0405] S750 trains a problem reconstruction model based on training samples and a second candidate inference scheme.

[0406] Step S750 corresponds to step S650 in method 600.

[0407] In other words, the prediction results of the question-answering model are used as the evaluation criteria for the multiple candidate reasoning schemes. Based on the question-answering model's prediction of whether the multiple candidate reasoning schemes are correct reasoning schemes, the second candidate reasoning scheme is determined.

[0408] It should be noted that there can be one or more second candidate inference schemes. This application does not limit the number of second candidate inference schemes in its embodiments.

[0409] Specifically, step S740 may include: inputting the question, the conditional information of the question, and the candidate reasoning scheme into the question answering model to obtain the prediction result of the question answering model.

[0410] In one possible implementation, step S740 may include: inputting the question, the condition information of the question, and multiple candidate reasoning schemes of a second subset of the candidate reasoning scheme set into the question answering model to obtain the prediction result of the question answering model, and determining a second candidate reasoning scheme from the second subset based on the prediction result of the question answering model.

[0411] It should be noted that the set of candidate reasoning schemes can also be regarded as a second subset of the set of candidate reasoning schemes.

[0412] In other words, in step S740, a question-answering model can be used to predict whether some or all of the candidate reasoning schemes in the candidate reasoning scheme set are correct reasoning schemes. Using a question-answering model to predict whether all candidate reasoning schemes are correct reasoning schemes can avoid missing correct reasoning schemes. Using a question-answering model to predict whether some candidate reasoning schemes are correct reasoning schemes can reduce computation time and improve training efficiency. This application's embodiments do not limit this aspect.

[0413] The first subset and the second subset can be the same or different.

[0414] Method 700 can be executed iteratively. During the iteration, the second subset in each iteration can be the same or different.

[0415] For example, the prediction result of the question-answering model may include the second confidence probabilities of multiple candidate reasoning schemes in the second subset. In this case, a second candidate reasoning scheme is determined from the second subset based on the second confidence probabilities of the multiple candidate reasoning schemes in the second subset.

[0416] Alternatively, the prediction results of the question-answering model may include second scores of multiple candidate reasoning schemes from a second subset.

[0417] Optionally, step S740 may include: sampling a second candidate inference scheme based on the prediction results of the question-answering model.

[0418] For example, a second candidate inference scheme is obtained by sampling based on the second confidence probability of the candidate inference scheme.

[0419] Compared to candidate inference schemes with lower second confidence probabilities, candidate inference schemes with higher second confidence probabilities are more likely to be identified as the second candidate inference scheme.

[0420] Alternatively, one or more candidate inference schemes with the highest second confidence probability may be identified as the second candidate inference scheme.

[0421] It should be noted that step S740 can also be understood as determining the second candidate inference scheme based at least on the prediction results of the question-answering model.

[0422] For example, the second candidate reasoning scheme can be determined based on the prediction results of the question-answering model and the prediction results of the question reconstruction model.

[0423] For example, the prediction result of the question reconstruction model includes the first confidence probability of the candidate reasoning solution, while the prediction result of the question answering model includes the second confidence probability of the candidate reasoning solution. The candidate reasoning solution with the highest first confidence probability and the candidate reasoning solution with the highest second confidence probability are selected as the second candidate reasoning solution.

[0424] Step S750 can be understood as including at least the second candidate reasoning scheme as an optimized candidate reasoning scheme, that is, the optimized candidate reasoning scheme includes at least the second candidate reasoning scheme.

[0425] Step S750 can also be understood as adjusting the parameters of the problem reconstruction model with the goal of reducing the value of the second objective function. The second objective function is L2 mentioned earlier.

[0426] In other words, the problem's conditional information and the second candidate reasoning scheme are used as input data to reconstruct the problem and adjust the parameters of the problem reconstruction model as the optimization direction.

[0427] For example, step S750 may include adjusting the parameters of the problem reconstruction model with the goal of increasing the first confidence probability of the second candidate inference scheme.

[0428] For example, to maximize log P φ (q|d,z′) represents the parameters of the target problem reconstructing model, and the candidate inference scheme z′ is the second candidate inference scheme.

[0429] In this way, the problem reconstruction model can adjust its parameters in the direction of increasing the first confidence probability of the second candidate inference scheme.

[0430] Alternatively, step S750 may include adjusting the parameters of the problem reconstruction model with the goal of increasing the first confidence probability of some of the other candidate inference schemes in the second candidate inference scheme and the other candidate inference schemes in the second subset.

[0431] For example, the second subset includes scheme A, scheme B, scheme C, scheme D and scheme E, and the second candidate inference scheme is scheme A. The parameters of the problem reconstruction model are adjusted with the goal of increasing the first confidence probability of scheme A and the first confidence probability of scheme C.

[0432] It should be noted that steps S740 to S750 are optional steps.

[0433] In the case where method 700 includes steps S740 to S750, steps S720 to S730 and steps S740 or S750 are executed alternately, that is, the question answering model and the question reconstruction model are trained alternately.

[0434] In other words, the question-answering model is trained based on the prediction results of the question reconstruction model, and the question reconstruction model is trained based on the prediction results of the question-answering model.

[0435] For example, a second candidate reasoning scheme is sampled based on the confidence probability of the question answering model, a question reconstruction model is trained to reconstruct the question from the second candidate reasoning scheme, and the question answering model is trained based on the most likely candidate reasoning scheme obtained from the question reconstruction model.

[0436] It should be understood that the step numbers above do not limit the order in which the steps are executed. The following example illustrates this alternating training process.

[0437] In step S740, a second candidate reasoning scheme can be determined based on the prediction results of the first question-answering model.

[0438] The prediction result of the first question-answering model is its prediction of whether a candidate reasoning solution is a correct reasoning solution. In other words, the prediction result of the first question-answering model is used to indicate the evaluation value of the first question-answering model for whether a candidate reasoning solution is a correct reasoning solution.

[0439] For example, the second confidence probability of the candidate reasoning scheme is obtained using the first question-answering model, and the second candidate reasoning scheme is determined based on the second confidence probability of the candidate reasoning scheme.

[0440] In step S750, the parameters of the first problem reconstruction model can be adjusted based on the training samples and the second candidate inference scheme to obtain the second problem reconstruction model.

[0441] For example, the parameters of the first problem reconstruction model are adjusted with the goal of increasing the first confidence probability of the second candidate inference scheme to obtain the second problem reconstruction model.

[0442] This makes it easier for the second problem reconstruction model to predict the probability of the problem (i.e., the first confidence probability) based on the problem's conditional information and the second candidate inference scheme, which is greater than the first problem reconstruction model's prediction probability based on the problem's conditional information and the second candidate inference scheme.

[0443] In step S720, the first candidate inference scheme can be determined based on the prediction results of the second problem reconstruction model.

[0444] The prediction result of the second problem reconstruction model is its prediction of whether the problem can be reconstructed based on the conditional information and candidate reasoning schemes. In other words, the prediction result of the second problem reconstruction model is used to indicate the evaluation value of the reconstructed problem.

[0445] For example, the first confidence probability of the candidate inference scheme is obtained by using the second problem reconstruction model, and the first candidate inference scheme is determined based on the first confidence probability of the candidate inference scheme.

[0446] In step S730, the parameters of the first question-answering model are adjusted based on the training samples and the first candidate inference scheme to obtain the second question-answering model.

[0447] For example, the parameters of the first question-answering model are adjusted with the goal of increasing the second confidence probability of the first candidate reasoning scheme to obtain the second question-answering model.

[0448] This makes it easier for the second question-answering model to predict that the first candidate reasoning solution is the correct reasoning solution (i.e., the second confidence probability) is greater than the first question-answering model to predict that the first candidate reasoning solution is the correct reasoning solution.

[0449] The second question-answering model obtained in this iteration is used as the first question-answering model in steps S740 and S730 of the next iteration, and the second question reconstruction model obtained in this iteration is used as the first question reconstruction model in step S750. The above process is repeated. After the iteration termination condition is met, the training is completed, and the trained question-answering model is obtained.

[0450] The iteration termination condition can be set according to existing schemes. For example, the iteration termination condition can be that the number of iterations is greater than or equal to a first threshold.

[0451] It should be understood that both the first and second question-answering models are question-answering models used in the training process. The only difference between the first and second question-answering models lies in their parameters. The confidence probabilities obtained from the question-answering models can both be called the "second confidence probabilities of the candidate inference scheme".

[0452] The first and second problem reconstruction models are problem reconstruction models used during the training process. The only difference between the first and second problem reconstruction models lies in their parameters. The confidence probabilities obtained from the problem reconstruction models can both be called the "first confidence probabilities of candidate inference schemes".

[0453] In this embodiment of the application, the second candidate reasoning scheme is determined based on the prediction results of the question-answering model to train the question reconstruction model, which can improve the training effect of the question reconstruction model so that the question reconstruction model can reconstruct the question more accurately.

[0454] The following is combined Figure 8 An example of one iteration process in an embodiment of this application is provided for illustration. It should be understood that... Figure 8 The iterative process described is merely an example and does not constitute a limitation on the solutions implemented in this application.

[0455] like Figure 8 As shown, the candidate reasoning solution set Z includes candidate reasoning solutions z1 and z2. Based on the prediction results P of the current question-answering model... θ (z|d, q), which is P in the figure. θ (z|d, q, a) Sample a candidate reasoning solution z' (an example of the second candidate reasoning solution) from the set of candidate reasoning solutions Z. Train a problem reconstruction model based on the candidate reasoning solution z', for example, to maximize log P. φ (q|d, z′) are used to update the parameters of the problem reconstruction model. Then, based on the prediction results of the current problem reconstruction model, log P is used. φ (q|d, z) Select the optimal candidate reasoning scheme from the set of candidate reasoning schemes Z. The optimal candidate reasoning scheme is the candidate reasoning scheme with the second highest score, z″ = argmax. z∈Z log P φ (q|d, z) (an example of the first candidate reasoning scheme). The question-answering model is trained based on the candidate reasoning scheme z”, for example, to maximize log P. θ (z″|d,q) is used to update the parameters of the question-answering model for the target.

[0456] Question answering models can be based on sequence-to-sequence (Seq2Seq) networks.

[0457] The problem reconstruction model can be a model based on a Seq2Seq network.

[0458] For example, the Seq2Seq network can be a bidirectional and auto-regressive transformer (BART). For instance, a problem reconstruction model can employ a pre-trained BART. For ease of description, this application uses BART as an example in its embodiments, and does not constitute a limitation on the solutions of other embodiments.

[0459] BART consists of an encoder and a decoder. The encoder takes the candidate reasoning scheme and the conditional information of the problem as input and encodes them. The decoder reconstructs the problem based on the features obtained from the encoder.

[0460] Candidate reasoning schemes typically consist of the following symbols: task-specific characters, literals (e.g., numeric constants), and one or more strings from the question or condition information.

[0461] For example, in discrete reasoning tasks, task-specific characters may include counting operations (COUNT).

[0462] For example, a literal value can be a numeric constant.

[0463] For example, a literal concatenation of candidate reasoning schemes and conditional information can be used as input to the problem reconstruction model.

[0464] However, if the above method is used, strings with the same literal form but different contexts cannot be distinguished due to the loss of contextual semantics. In order to better encode conditional information and candidate reasoning schemes, embodiments of this application also provide an encoding method.

[0465] Optionally, the first string in the candidate reasoning scheme is input into the question-answering model as a placeholder. The first string is derived from the second string in the conditional information. The representation of this placeholder in the question-answering model is determined by the contextual representation of the second string, which is a keyword in the conditional information.

[0466] In other words, the strings from the condition information in the candidate reasoning scheme are replaced with placeholders, while the other strings in the candidate reasoning scheme remain unchanged in their literal form.

[0467] The literal form of the first string is the same as the literal form of the second string in the condition information.

[0468] Optionally, the representation of the placeholder in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context of the second string.

[0469] In other words, the representation of the placeholder in the problem reconstruction model is determined by using an attention mask to make the placeholder focus on the context of the second string.

[0470] Specifically, the problem reconstruction model can use an attention mask to prevent the placeholder from focusing on strings outside the context of the second string. That is, it blocks the connection between the placeholder and other strings outside the context of the second string, ensuring that the placeholder can only focus on the context of the second string in the problem reconstruction model, thereby calculating the placeholder's representation.

[0471] The following explanation uses a BART-based problem refactoring model as an example.

[0472] like Figure 9 As shown, the input to the BART encoder mainly consists of two parts: conditional information and candidate reasoning schemes, as well as other symbols. <s> This is the start character for BART input.< / s> This is the end-of-BART input character. <sol>It is the start symbol for candidate reasoning schemes, and op represents the operator. Figure 9 In this context, 'a', 'b', 'c', and 'd' represent different tokens, which can be characters or words. A token can also be understood as a string. '' is a placeholder for a specific span within the document. For example, ... Figure 3 As shown, "1876" and "1878" appear in the candidate reasoning scheme. These two spans are spans from the conditional information (an example of the second string), using placeholders. Replace these two spans. Accordingly, Figure 9 In the encoding of candidate reasoning schemes, a and b from the conditional information are replaced with placeholders. .

[0473] According to the scheme of this application embodiment, the string from the condition information in the candidate reasoning scheme is replaced with a placeholder. The representation of the placeholder in the problem reconstruction model is determined by the context representation of the second string. In this way, the context semantics are not lost, and strings with the same literal form can be effectively distinguished, which is beneficial to improving the prediction accuracy of the problem reconstruction model.

[0474] In the field of image processing, building image processing models using training samples and their corresponding labels is a common approach. However, due to errors by the annotators or the difficulty in determining the labels themselves, the labels in the training data are not always true values.

[0475] This application provides a training method 900 for an image processing model, which selects candidate labels for training by utilizing the correlation strength between sample images and candidate labels, so as to reduce the impact of incorrect labels on training and improve the training effect of the model.

[0476] Method 900 can be regarded as Figure 6 The method shown is a specific implementation in the field of image processing. For a detailed description, please refer to method 600. For brevity, some repetitive descriptions are omitted when describing method 900. Method 900 can be executed by a training device for an image processing model. This training device can be a cloud service device or a terminal device, such as a computer, server, or other device with sufficient computing power to execute the image processing model training method. It can also be a system composed of a cloud service device and a terminal device.

[0477] For example, method 900 can be derived from... Figure 4 The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 The training can be performed on any of the training devices 220.

[0478] For example, method 900 can be specifically derived from, for example... Figure 5 The training device 220 shown is used for execution, and the training data in method 900 can be as follows: Figure 5 The training data maintained in the database 230 shown.

[0479] Method 900 includes steps S910 to S950.

[0480] S910, Obtain the sample image and the corresponding candidate label set. The candidate label set includes multiple candidate labels.

[0481] Different image processing models can be trained based on different types of training samples to perform different image processing tasks.

[0482] The types of candidate labels differ depending on the image processing task, i.e., different image processing models. See step S610 for specific types.

[0483] The sample images and their corresponding candidate label sets are used to train the image processing model. The image processing model is the inference model in method 600.

[0484] Specifically, the image processing model is used to predict whether a candidate label is the correct label based on a sample image. The prediction result of the image processing model is its prediction of whether a candidate label is the correct label. In other words, the prediction result of the image processing model is used to indicate the evaluation value of whether a candidate label is the correct label, and this evaluation value is used to evaluate the reliability of the candidate label being the correct label.

[0485] The evaluation model can be used to predict whether a sample image can be reconstructed based on candidate labels. In other words, the evaluation model can be used to reconstruct a sample image based on candidate labels.

[0486] For example, the evaluation model can be based on an image reconstruction model or an image generation model.

[0487] The evaluation model's prediction result is its prediction of whether the sample image can be reconstructed based on the candidate labels. In other words, the evaluation model's prediction result indicates the evaluation value for reconstructing the sample image based on the candidate labels, and this evaluation value is used to assess the probability of reconstructing the sample image.

[0488] The prediction results of the evaluation model can reflect the correlation between the sample image and the candidate label. The higher the probability of reconstructing the sample image, the stronger the correlation between the sample image and the candidate label, and the more likely the candidate label is to be the correct label.

[0489] The following explanation uses an image classification model as an example of an image processing model.

[0490] For example, the image classification model can be a neural network model, such as a CNN model. Candidate labels can also be called candidate category labels.

[0491] For example, if the correct category of the sample image is "dog", that is, the correct category label of the sample image is "dog", the candidate category label set includes multiple candidate category labels, which include the seven category labels "dog", "cat", "love", "cute", "tiger", "raccoon", and "arrogant".

[0492] Image classification models are used to predict whether candidate class labels indicate the correct class to which a sample image belongs; that is, whether the candidate class label is the correct class label. The prediction result of the image classification model is its prediction of whether the candidate class label is the correct class label. In other words, the prediction result of the image classification model is used as an evaluation value to indicate whether the candidate class label is the correct class label; this evaluation value is used to assess the reliability of the candidate class label being the correct class label.

[0493] The evaluation model can be an image generation model. An image generation model can be used to predict whether a sample image can be reconstructed based on candidate class labels. In other words, an image generation model can be used to reconstruct a sample image based on candidate class labels.

[0494] The prediction result of an image generation model is its prediction of whether the sample image can be reconstructed based on the candidate class labels. In other words, the prediction result of the image generation model indicates the evaluation value for reconstructing the sample image based on the candidate class labels; this evaluation value assesses the probability of reconstructing the sample image.

[0495] The prediction results of an image generation model can reflect the correlation between a sample image and a candidate class label. The higher the probability of reconstructing the sample image, the stronger the correlation between the sample image and the candidate class label, and the more likely the candidate class label is to be the correct class label.

[0496] Step S910 corresponds to step S610 in method 600. For a detailed description, please refer to the description in step S610, which will not be repeated here.

[0497] S920, determine the first candidate label based on the prediction results of the evaluation model. The first candidate label belongs to the candidate label set.

[0498] S930 is an image processing model trained based on sample images and first candidate labels.

[0499] In other words, the prediction results of the evaluation model are used as the evaluation criteria for the multiple candidate labels. The first candidate label is determined based on the evaluation model's prediction of whether the sample image can be reconstructed based on the multiple candidate labels.

[0500] As mentioned earlier, the prediction results of the evaluation model can reflect the correlation between the sample image and the candidate label. In other words, step S920 can be understood as determining the first candidate label based on the correlation between the sample image and the candidate label.

[0501] Optionally, the evaluation model's prediction results include the prediction probability of the evaluation model reconstructing the sample image based on the candidate labels. Specifically, the prediction probability of the evaluation model reconstructing the sample image based on the first candidate label is greater than or equal to the prediction probability of the evaluation model reconstructing the sample image based on other candidate labels.

[0502] The following explanation uses an image classification model as an example of an image processing model.

[0503] For example, if the correct category of the sample image is "dog," and the evaluation model is an image generation model, then "dog" is the first candidate category label determined from the seven candidate category labels based on the prediction results of the image generation model. In this case, the image classification model is trained based on the sample image and the first candidate category label "dog." That is, the image classification model is optimized with the first candidate category label "dog" considered the correct category label, and the parameters of the image classification model are adjusted in a way that increases the reliability of "dog."

[0504] Step S920 corresponds to step S620 in method 600. Step S930 corresponds to step S630 in method 600. For a detailed description, please refer to method 600, which will not be repeated here.

[0505] In the embodiments of this application, an evaluation model is used to guide the image processing model to predict reasonable labels that have good consistency with the sample images, thereby improving the training effect of the image processing model. Specifically, the solution of this application uses the prediction results of the evaluation model to represent the correlation between candidate labels and sample images. The candidate labels are determined based on the strength of the correlation to train the image processing model. Candidate labels with a strong correlation with the sample images are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect.

[0506] Furthermore, according to the scheme of the embodiments of this application, the image processing model can be trained based on the optimal candidate labels obtained by the evaluation model, that is, the image processing model can be trained by a greedy optimization method, which can make the training process more stable.

[0507] S940, determine the second candidate label based on the prediction results of the image processing model. The second candidate label belongs to the candidate label set.

[0508] Optionally, step S940 includes sampling a second candidate label based on the prediction result of the image processing model.

[0509] S950 is an evaluation model trained based on sample images and second candidate labels.

[0510] In other words, the prediction results of the image processing model are used as the evaluation criterion for the multiple candidate labels. Based on the image processing model's prediction of whether the multiple candidate labels are correct labels, the second candidate label is determined.

[0511] The following explanation uses an image classification model as an example of an image processing model.

[0512] For example, if the correct category of the sample image is "dog," and the evaluation model is an image generation model, then the second candidate category label determined from the seven candidate category labels based on the image classification model's prediction is also "dog." In this case, the image generation model is trained based on the sample image and the second candidate category label "dog." That is, the parameters of the image generation model are adjusted to ensure that it can generate the sample image based on the second candidate category label "dog."

[0513] Step S940 corresponds to step S640 in method 600. Step S950 corresponds to step S650 in method 600. For a detailed description, please refer to method 600, which will not be repeated here.

[0514] In this embodiment of the application, the evaluation model is trained by determining the second candidate label based on the prediction result of the image processing model, which can improve the training effect of the evaluation model and enable the evaluation model to reconstruct the sample image more accurately.

[0515] It should be understood that the embodiments of this application only illustrate the application of method 600 in the fields of image processing and natural language processing. Method 600 can also be applied to other weakly supervised training scenarios such as audio processing. It is only necessary to replace the training samples, candidate labels, inference models and evaluation models in method 600 accordingly. In order to avoid repetition, it will not be described in detail here.

[0516] Figure 10 This application illustrates a data processing method 1000 according to an embodiment of the present application. This method can be executed by a device or apparatus capable of performing model calculations. For example, the device can be a cloud service device or a terminal device, such as a computer, server, or other apparatus with sufficient computing power to execute the data processing method. It can also be a system composed of a cloud service device and a terminal device. Exemplarily, method 1000 can be executed by… Figure 4 The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 Execution is performed by any of the execution devices 210.

[0517] For example, method 1000 can be specifically derived from, such as Figure 5 The execution device 210 shown executes the process, and the data to be processed in method 1000 can be as follows: Figure 5 The input data provided by the client device 240 shown.

[0518] Figure 10 The model used in the data processing method 1000 can be obtained through the above. Figure 6 It is constructed using the methods described in [the document]. For a detailed description, please refer to method 600. To avoid unnecessary repetition, the description of method 1000 will be omitted below.

[0519] Method 1000 includes steps S1010 to S1020, which are described below.

[0520] S1010, retrieve the data to be processed.

[0521] The type of data to be processed is related to the task of the inference model. This application does not limit the type of data to be processed in its embodiments.

[0522] Optionally, the data to be processed may include image data, audio data, or text data.

[0523] For example, if an inference model is used for an image processing task, the data to be processed can be an image. Specifically, image processing tasks can include image classification, image detection, image segmentation, image recognition, image generation, image super-resolution, image denoising, or object detection, etc.

[0524] For example, if an inference model is used for a text processing task, the data to be processed can be text. Specifically, text processing tasks can include reading comprehension, discrete reasoning, semantic parsing, text recognition, or text translation.

[0525] For example, if an inference model is used for an audio processing task, the data to be processed can be audio data. Specifically, audio processing tasks include speech recognition or voiceprint devices, etc.

[0526] S1020, the inference model is used to process the data to be processed to obtain the processing result. This inference model is trained based on training samples and a first candidate label. The first candidate label is determined based on the prediction result of the evaluation model. The prediction result of the evaluation model is used to indicate the evaluation value of the training sample reconstructed based on the candidate label. The first candidate label belongs to the candidate label set corresponding to the training sample, and the candidate label set includes multiple candidate labels.

[0527] The inference model can be an inference model trained using method 600.

[0528] Optionally, the evaluation model is trained based on training samples and a second candidate label. The second candidate label is determined based on the prediction results of the inference model. The second candidate label belongs to the candidate label set, and the prediction results of the inference model are used to indicate the evaluation value of the candidate label as the correct label.

[0529] Optionally, the evaluation model's prediction result is the prediction probability of reconstructing the training sample based on the candidate labels, and the prediction probability of reconstructing the training sample based on the first candidate label is greater than or equal to the prediction probability of reconstructing the training sample based on other candidate labels.

[0530] Optionally, the second candidate label is obtained by sampling based on the prediction results of the inference model.

[0531] According to the scheme of this application embodiment, the evaluation model guides the inference model to predict reasonable labels with good consistency with the training samples, thereby improving the training effect of the inference model. Specifically, the scheme of this application embodiment uses the prediction results of the evaluation model to represent the correlation between candidate labels and training samples. Based on the strength of the correlation, candidate labels are determined to train the inference model. Candidate labels with a strong correlation with the training samples are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect. Using this inference model to process the data to be processed is conducive to obtaining more accurate prediction results.

[0532] Figure 11 This application illustrates a question-answering method 1100 according to an embodiment of the present application. This method can be executed by a device or apparatus capable of performing model calculations. For example, the device can be a cloud service device or a terminal device, such as a computer, server, or other apparatus with sufficient computing power to perform data processing methods. It can also be a system composed of a cloud service device and a terminal device. Exemplarily, method 1100 can be executed by… Figure 4 The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 Execution is performed by any of the execution devices 210.

[0533] For example, method 1100 can be specifically derived from, as follows: Figure 5 The execution device 210 shown executes the method 1100, and the problem to be processed and the condition information of the problem to be processed can be as follows: Figure 5 The input data provided by the client device 240 shown.

[0534] Figure 11 The model used in the question-answering method 1100 can be obtained through the above. Figure 7 It is constructed using the methods described in [the document]. For a detailed description, please refer to method 700. To avoid unnecessary repetition, the description of method 1100 will be omitted below.

[0535] Method 1100 includes steps S1110 to S1120, which are described below.

[0536] S1110, Obtain the problem to be processed and the condition information of the problem to be processed.

[0537] S1120, A question-answering model is used to process the question to be processed and its conditional information to predict the answer to the question. The question-answering model is trained based on training samples and a first candidate reasoning scheme. The training samples include the question and its conditional information. The first candidate reasoning scheme is determined based on the prediction results of the question reconstruction model and belongs to the candidate reasoning scheme set. The question reconstruction model is used to indicate the prediction results of the question reconstruction model based on the conditional information of the question and multiple candidate reasoning schemes. The prediction results of the question reconstruction model are used to indicate the evaluation value of the question to be reconstructed based on the conditional information of the question and multiple candidate reasoning schemes. The multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

[0538] Specifically, the question-answering model in step S1120 can be trained using method 700.

[0539] For example, a question-answering model can use the question to be processed and its conditional information as input data to predict the indication information of the correct reasoning solution, and then execute the reasoning solution. The execution result is the answer to the question to be processed predicted by the question-answering model. The indication information of the correct reasoning solution can be the reasoning solution itself. Alternatively, the indication information of the correct reasoning solution can also include the confidence probabilities of multiple reasoning solutions, and the reasoning solution with the highest confidence probability among these multiple reasoning solutions is regarded as the correct reasoning solution.

[0540] Alternatively, a question-answering model can take the question to be processed, its conditional information, and multiple reasoning schemes as input data, predict the indication information of the correct reasoning scheme, and then execute that reasoning scheme. The execution result is the answer to the question to be processed predicted by the question-answering model. The indication information of the correct reasoning scheme can be the reasoning scheme itself. Alternatively, the indication information of the correct reasoning scheme can also include the confidence probabilities of multiple reasoning schemes, with the reasoning scheme with the highest confidence probability among these multiple reasoning schemes being regarded as the correct reasoning scheme.

[0541] According to the scheme of this application embodiment, a question reconstruction model is used to guide the question answering model to predict reasonable reasoning solutions with good consistency with the question, thereby improving the training effect of the question answering model. Specifically, the scheme of this application embodiment uses the prediction results of the question reconstruction model to represent the semantic relevance between candidate reasoning solutions and the question. The candidate reasoning solutions are determined based on the strength of the semantic relevance to train the question answering model. Candidate reasoning solutions with strong semantic relevance to the question are more likely to be correct reasoning solutions, thus helping to mitigate the impact of harmful reasoning solutions and improving the training effect. Using this question answering model to process the question helps to obtain more accurate reasoning solutions, and thus more accurate solutions.

[0542] Optionally, the question reconstruction model is trained based on training samples and a second candidate reasoning scheme. The second candidate reasoning scheme is determined based on the prediction results of the question-answering model and belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction results of the question-answering model based on the question and the question's condition information. The prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes. Multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

[0543] Optionally, the prediction results of the problem reconstruction model include the prediction probability of reconstructing the problem based on the problem's conditional information and multiple candidate reasoning schemes, wherein the prediction probability of reconstructing the problem based on the problem's conditional information and the first candidate reasoning scheme is greater than or equal to the prediction probability of reconstructing the problem based on the problem's conditional information and other candidate reasoning schemes.

[0544] Optionally, the second candidate reasoning scheme is obtained by sampling the prediction results of the question-answering model.

[0545] Optionally, the conditional information for the question includes the documents associated with the question.

[0546] Optionally, the first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The literal form of the first string is the same as the literal form of the second string in the condition information. The representation of the placeholder in the problem reconstruction model is determined according to the context of the second string, which is a keyword in the condition information.

[0547] Optionally, the representation of the placeholder in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context of the second string.

[0548] This application embodiment also provides an image processing method 1200, which can be executed by a device or apparatus capable of performing model calculations. For example, the device can be a cloud service device or a terminal device, such as a computer, server, or other apparatus with sufficient computing power to execute the image processing method, or a system composed of a cloud service device and a terminal device. Exemplarily, method 1200 can be executed by... Figure 4 The data processing device, user equipment, execution device 110, local device 101, local device 102 or in Figure 5 Execution is performed by any of the execution devices 210.

[0549] For example, method 1200 can be specifically derived from, as follows: Figure 5 The execution device 210 shown executes the method 1200, where the image to be processed can be as follows: Figure 5 The input data provided by the client device 240 shown.

[0550] The model used in image processing method 1200 can be constructed using method 900 described above. For a detailed description, please refer to method 900. To avoid unnecessary repetition, repeated descriptions will be omitted when introducing method 1200 below.

[0551] Method 1200 includes steps S1210 to S1220, which are described below.

[0552] S1210, Obtain the image to be processed.

[0553] S1220: The image processing model is used to process the image to be processed to obtain the processing result. The image processing model is trained based on the sample image and a first candidate label. The first candidate label is determined based on the prediction result of the evaluation model. The first candidate label belongs to a candidate label set, which includes multiple candidate labels. The prediction result of the evaluation model is used to indicate the evaluation value of reconstructing the sample image based on the candidate labels.

[0554] According to the scheme of this application embodiment, the evaluation model guides the image processing model to predict reasonable labels with good consistency with the sample images, thereby improving the training effect of the image processing model. Specifically, the scheme of this application embodiment uses the prediction results of the evaluation model to represent the correlation between candidate labels and sample images. The candidate labels are determined based on the strength of the correlation to train the image processing model. Candidate labels with a strong correlation with the sample images are more likely to be correct labels, which helps to mitigate the impact of incorrect labels and improve the training effect. Using this image processing model to process the image to be processed helps to obtain more accurate prediction results.

[0555] Optionally, the evaluation model is trained based on the sample image and the second candidate label. The second candidate label is determined based on the prediction result of the image processing model. The second candidate label belongs to the candidate label set. The prediction result of the image processing model is used to indicate the evaluation value of the candidate label as the correct label.

[0556] Optionally, the prediction result of the evaluation model is the prediction probability of reconstructing the sample image based on the candidate labels, and the prediction probability of reconstructing the sample image based on the first candidate label is greater than or equal to the prediction probability of reconstructing the sample image based on other candidate labels.

[0557] Optionally, the second candidate label is sampled based on the prediction results of the image processing model.

[0558] The apparatus of the present application embodiments will now be described in detail with reference to the accompanying drawings. It should be understood that the apparatus described below is capable of performing the methods of the foregoing embodiments of the present application. To avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing the apparatus of the present application embodiments below.

[0559] Figure 12 This is a schematic block diagram of a training device according to an embodiment of this application. Figure 12 The training device 3000 shown includes an acquisition unit 3010 and a processing unit 3020.

[0560] In one possible implementation, the training device can be used to perform the method 600 of the embodiments of this application.

[0561] Specifically, the acquisition unit 3010 can perform the above step S610, and the processing unit 3020 can perform the above steps S620 to S630.

[0562] Optionally, the processing unit 3020 can also be used to perform the above steps S640 to S650.

[0563] In one possible implementation, the training device can be used to perform the method 700 of the embodiments of this application.

[0564] Specifically, the acquisition unit 3010 can perform the above step S710, and the processing unit 3020 can perform the above steps S720 to S730.

[0565] Optionally, the processing unit 3020 can also be used to perform the above steps S740 to S750.

[0566] In one possible implementation, the training device can be used to perform the method 900 of the embodiments of this application.

[0567] Specifically, the acquisition unit 3010 can perform the above step S910, and the processing unit 3020 can perform the above steps S920 to S930.

[0568] Optionally, the processing unit 3020 can also be used to perform the above steps S940 to S950.

[0569] Figure 13 This is a schematic block diagram of the inference device 4000 provided in the embodiments of this application. Figure 11 The inference device 4000 shown includes an acquisition unit 4010 and a processing unit 4020.

[0570] In one possible implementation, the inference device can be used to execute the method 1000 of the embodiments of this application, and the inference device can also be referred to as a data processing device.

[0571] Specifically, the acquisition unit 4010 can execute the above step S1010, and the processing unit 4020 can execute the above step S1020.

[0572] In one possible implementation, the inference device can be used to perform the method 1100 of the embodiments of this application, and the inference device can also be referred to as a question-and-answer device.

[0573] Specifically, the acquisition unit 4010 can perform the above step S1110, and the processing unit 4020 can perform the above step S1120.

[0574] In one possible implementation, the inference device can be used to perform the method 1200 of the embodiments of this application, and the inference device can also be referred to as an image processing device.

[0575] Specifically, the acquisition unit 4010 can execute the above step S1210, and the processing unit 4020 can execute the above step S1220.

[0576] It should be noted that the training device 3000 and device 4000 described above are embodied in the form of functional units. The term "unit" here can be implemented in software and / or hardware, and there is no specific limitation on this.

[0577] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.

[0578] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0579] Figure 14 This is a schematic diagram of the hardware structure of a training device provided in an embodiment of this application. Figure 14 The training device 5000 shown (which may specifically be a computer device) includes a memory 5001, a processor 5002, a communication interface 5003, and a bus 5004. The memory 5001, processor 5002, and communication interface 5003 are interconnected via the bus 5004.

[0580] The memory 5001 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 5001 may store a program, and when the program stored in the memory 5001 is executed by the processor 5002, the processor 5002 performs the various steps of the training method of the embodiments of this application. For example, the processor 5002 may execute method 600, method 700, or method 900 described above.

[0581] The processor 5002 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to implement the training method of the embodiments of this application.

[0582] The processor 5002 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the training method of this application can be completed through the integrated logic circuitry in the processor 5002 or through software instructions.

[0583] The processor 5002 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 5001, and processor 5002 reads information from memory 5001 and combines it with its hardware to complete... Figure 12 The apparatus shown includes units that are required to perform functions, or to perform methods 600, 700, or 900 of the method embodiments of this application.

[0584] The communication interface 5003 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 5000 and other devices or communication networks. For example, training samples and a set of candidate inference schemes corresponding to the training samples can be obtained through the communication interface 5003.

[0585] Bus 5004 may include a pathway for transmitting information between various components of device 5000 (e.g., memory 5001, processor 5002, communication interface 5003).

[0586] Figure 15 This is a schematic diagram of the hardware structure of the inference device provided in the embodiments of this application. Figure 15 The device 6000 shown (which may specifically be a computer device) includes a memory 6001, a processor 6002, a communication interface 6003, and a bus 6004. The memory 6001, processor 6002, and communication interface 6003 are interconnected via the bus 6004.

[0587] The memory 6001 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 6001 may store programs, and when the program stored in the memory 6001 is executed by the processor 6002, the processor 6002 is used to execute method 1000, method 1100, or method 1200 of the embodiments of this application.

[0588] The processor 6002 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute related programs to implement method 1000, method 1100, or method 1200 of the method embodiments of this application.

[0589] The processor 6002 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the method of this application can be completed through the integrated logic circuitry in the hardware of the processor 6002 or through software instructions.

[0590] The processor 6002 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 6001, and the processor 6002 reads the information in memory 6001 and combines it with its hardware to complete the task. Figure 1 The unit included in the apparatus shown in 3 is required to perform the function, or to perform method 1000, method 1100 or method 1200 of the method embodiments of this application.

[0591] The communication interface 6003 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 6000 and other devices or communication networks. For example, the communication interface 6003 can be used to obtain information about the problem to be solved and the conditions of the problem.

[0592] Bus 6004 may include a pathway for transmitting information between various components of device 6000 (e.g., memory 6001, processor 6002, communication interface 6003).

[0593] This application also provides a computer-readable medium storing program code for execution by a device, the program code including any one of a training method for a model, a training method for a question-answering model, a training method for an image processing model, a data processing method, a question-answering method, or an image processing method for executing the model in this application embodiment.

[0594] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any one of the training methods for the model, the training methods for the question-answering model, the training methods for the image processing model, the data processing method, the question-answering method, or the image processing method described in this application.

[0595] This application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in the memory through the data interface and executes any one of the training methods of the model, the training method of the question-answering model, the training method of the image processing model, the data processing method, the question-answering method, or the image processing method in this application embodiment.

[0596] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute any one of the training methods of the model, the training method of the question-answering model, the training method of the image processing model, the data processing method, the question-answering method, or the image processing method in the embodiments of this application.

[0597] It should also be understood that, in embodiments of this application, the memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the processor may also include non-volatile random access memory. For example, the processor may also store device type information.

[0598] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0599] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0600] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0601] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0602] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0603] 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0604] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0605] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes 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 application. The aforementioned storage medium includes: a Universal Serial Bus flash disk (USB flash disk, UFD), which can also be simply referred to as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code.

[0606] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. < / sol>

Claims

1. A training method for a question-answering model, characterized in that, include: Obtain training samples and a set of candidate reasoning schemes corresponding to the training samples. The training samples include questions and conditional information of the questions. The execution result of the candidate reasoning schemes in the set of candidate reasoning schemes is the correct answer to the question. The candidate reasoning schemes in the set of candidate reasoning schemes are reasoning schemes obtained under weak supervision. The first candidate reasoning scheme is determined based on the prediction results of the problem reconstruction model. The first candidate reasoning scheme belongs to the set of candidate reasoning schemes. The problem reconstruction model is used to obtain the prediction results of the problem reconstruction model based on the condition information of the problem and multiple candidate reasoning schemes. The prediction results of the problem reconstruction model are used to indicate the evaluation value of the problem to be reconstructed based on the condition information of the problem and the multiple candidate reasoning schemes. The multiple candidate reasoning schemes belong to the set of candidate reasoning schemes. The question-answering model is trained based on the training samples and the first candidate reasoning scheme.

2. The training method according to claim 1, characterized in that, The training method also includes: The second candidate reasoning scheme is determined based on the prediction result of the question-answering model. The second candidate reasoning scheme belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction result of the question-answering model based on the question and the condition information of the question. The prediction result of the question-answering model is used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes. The multiple candidate reasoning schemes belong to the candidate reasoning scheme set. The problem reconstruction model is trained based on the training samples and the second candidate inference scheme.

3. The training method according to claim 1 or 2, characterized in that, The prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the conditional information of the problem and the multiple candidate inference schemes. The prediction probability of reconstructing the problem based on the conditional information of the problem and the first candidate inference scheme is greater than or equal to the prediction probability of reconstructing the problem based on the conditional information of the problem and the other candidate inference schemes.

4. The training method according to claim 1 or 2, characterized in that, The conditional information for the question includes the document associated with the question.

5. The training method according to claim 1 or 2, characterized in that, The first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is a second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

6. The training method according to claim 5, characterized in that, The placeholder's representation in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context representation of the second string.

7. A question-and-answer method, characterized in that, include: Obtain the problem to be processed and the condition information of the problem to be processed; A question-answering model is used to process the question to be processed and its conditional information to predict the answer to the question. The question-answering model is trained based on training samples and a first candidate reasoning scheme. The training samples include the question and its conditional information. The first candidate reasoning scheme is determined based on the prediction results of a question reconstruction model and belongs to a set of candidate reasoning schemes. The candidate reasoning schemes in the set are reasoning schemes obtained under weak supervision. The question reconstruction model is used to obtain its prediction results based on the question's conditional information and multiple candidate reasoning schemes. The prediction results of the question reconstruction model are used to indicate the evaluation value of the question reconstructed based on the question's conditional information and the multiple candidate reasoning schemes. The multiple candidate reasoning schemes belong to the set of candidate reasoning schemes, and the execution result of the candidate reasoning schemes in the set of candidate reasoning schemes is the correct answer to the question.

8. The question-and-answer method according to claim 7, characterized in that, The problem reconstruction model is trained based on the training samples and the second candidate reasoning scheme. The second candidate reasoning scheme is determined based on the prediction results of the question-answering model and belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction results of the question-answering model based on the question and the condition information of the question. The prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes and the multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

9. The question-and-answer method according to claim 7 or 8, characterized in that, The prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the conditional information of the problem and the multiple candidate inference schemes. The prediction probability of reconstructing the problem based on the conditional information of the problem and the first candidate inference scheme is greater than or equal to the prediction probability of reconstructing the problem based on the conditional information of the problem and the other candidate inference schemes.

10. The question-and-answer method according to claim 7 or 8, characterized in that, The conditional information for the question includes the document associated with the question.

11. The question-and-answer method according to claim 7 or 8, characterized in that, The first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is a second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

12. The question-and-answer method according to claim 11, characterized in that, The placeholder's representation in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context representation of the second string.

13. A training device for a question-answering model, characterized in that, include: The acquisition unit is used to acquire training samples and a set of candidate reasoning schemes corresponding to the training samples. The training samples include questions and conditional information of the questions. The execution result of the candidate reasoning schemes in the set of candidate reasoning schemes is the correct answer to the question. The candidate reasoning schemes in the set of candidate reasoning schemes are reasoning schemes acquired under weak supervision. Processing unit, used for: The first candidate reasoning scheme is determined based on the prediction results of the problem reconstruction model. The first candidate reasoning scheme belongs to the set of candidate reasoning schemes. The problem reconstruction model is used to obtain the prediction results of the problem reconstruction model based on the condition information of the problem and multiple candidate reasoning schemes. The prediction results of the problem reconstruction model are used to indicate the evaluation value of the problem to be reconstructed based on the condition information of the problem and the multiple candidate reasoning schemes. The multiple candidate reasoning schemes belong to the set of candidate reasoning schemes. The question-answering model is trained based on the training samples and the first candidate reasoning scheme.

14. The training device according to claim 13, characterized in that, The processing unit is also used for: The second candidate reasoning scheme is determined based on the prediction result of the question-answering model. The second candidate reasoning scheme belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction result of the question-answering model based on the question and the condition information of the question. The prediction result of the question-answering model is used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes. The multiple candidate reasoning schemes belong to the candidate reasoning scheme set. The problem reconstruction model is trained based on the training samples and the second candidate inference scheme.

15. The training device according to claim 13 or 14, characterized in that, The prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the conditional information of the problem and the multiple candidate inference schemes. The prediction probability of reconstructing the problem based on the conditional information of the problem and the first candidate inference scheme is greater than or equal to the prediction probability of reconstructing the problem based on the conditional information of the problem and the other candidate inference schemes.

16. The training apparatus according to claim 13 or 14, characterized in that, The conditional information for the question includes the document associated with the question.

17. The training device according to claim 13 or 14, characterized in that, The first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is a second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

18. The training device according to claim 17, characterized in that, The placeholder's representation in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context representation of the second string.

19. A question-and-answer device, characterized in that, include: The acquisition unit is used to acquire the problem to be processed and the condition information of the problem to be processed; A processing unit is configured to process the question to be processed and its conditional information using a question-answering model to obtain an answer to the question. The question-answering model is trained based on training samples and a first candidate reasoning scheme. The training samples include the question and its conditional information. The first candidate reasoning scheme is determined based on the prediction results of a question reconstruction model and belongs to a set of candidate reasoning schemes. The candidate reasoning schemes in the set are reasoning schemes obtained under weak supervision. The question reconstruction model is configured to obtain its prediction results based on the question's conditional information and multiple candidate reasoning schemes. The prediction results of the question reconstruction model are used to indicate the reconstruction of the question's evaluation value based on the question's conditional information and the multiple candidate reasoning schemes. The multiple candidate reasoning schemes belong to the set of candidate reasoning schemes, and the execution result of the candidate reasoning scheme in the set of candidate reasoning schemes is the correct answer to the question.

20. The question-and-answer device according to claim 19, characterized in that, The problem reconstruction model is trained based on the training samples and the second candidate reasoning scheme. The second candidate reasoning scheme is determined based on the prediction results of the question-answering model and belongs to the candidate reasoning scheme set. The question-answering model is used to obtain the prediction results of the question-answering model based on the question and the condition information of the question. The prediction results of the question-answering model are used to indicate the evaluation value of multiple candidate reasoning schemes as correct reasoning schemes and the multiple candidate reasoning schemes belong to the candidate reasoning scheme set.

21. The question-and-answer device according to claim 19 or 20, characterized in that, The prediction result of the problem reconstruction model includes the prediction probability of reconstructing the problem based on the conditional information of the problem and the multiple candidate inference schemes. The prediction probability of reconstructing the problem based on the conditional information of the problem and the first candidate inference scheme is greater than or equal to the prediction probability of reconstructing the problem based on the conditional information of the problem and the other candidate inference schemes.

22. The question-and-answer device according to claim 19 or 20, characterized in that, The conditional information for the question includes the document associated with the question.

23. The question-and-answer device according to claim 19 or 20, characterized in that, The first string in the candidate reasoning scheme is input into the problem reconstruction model in the form of a placeholder. The first string is a second string from the condition information. The representation of the placeholder in the problem reconstruction model is determined based on the context of the second string. The second string is a keyword in the condition information.

24. The question-and-answer device according to claim 23, characterized in that, The placeholder's representation in the problem reconstruction model is achieved through an attention mask, which is used to make the placeholder pay attention to the context representation of the second string.

25. A training device for a question-answering model, characterized in that, It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to invoke the program instructions to perform the method as described in any one of claims 1 to 6.

26. A question-and-answer device, characterized in that, It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to invoke the program instructions to perform the method as described in any one of claims 7 to 12.

27. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for execution by a storage device, the program code including methods for performing any one of claims 1 to 6 or claims 7 to 12.

28. A computer program product containing instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as claimed in any one of claims 1 to 6 or 7 to 12.

Citation Information

Patent Citations

  • Method and system for computer question answering

    CN102903008A

  • Classification model application and classification model training method and device

    CN110222171A

  • Answer determination method and device for intelligent questions and answers

    CN110309283A

  • Question generation method and system

    CN111553159A

  • Question and answer model construction method and system, question and answer method and device and judgment system

    CN112131370A