Question and answer model training method, object analysis method and related equipment
By splitting the sample questions into sub-questions and evaluating the contribution value of the sub-answer, the problem of low Q&A accuracy in some scenarios is solved, achieving higher Q&A accuracy and evaluation accuracy.
Patent Information
- Application Number
- CN202411586119.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the target question-and-answer model has low question-and-answer accuracy in some usage scenarios, mainly because the scene state before and after performing a single scenario operation is not sufficient to accurately determine the reward and punishment strategy.
By splitting the sample questions into multiple sub-questions and evaluating the contribution value of the sub-answer based on preset multiple question-and-answer evaluation strategies, the model parameters of the question-and-answer model are adjusted to improve the accuracy of question-and-answer.
The Q&A accuracy and evaluation accuracy of the target Q&A model are improved, so that the model can understand and answer complex questions more accurately.
Smart Images

Figure CN119474272A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a question-answering model training method, an object analysis method, and related equipment. Background Art
[0002] With the continuous development of technology, more and more clients or servers can provide intelligent question-and-answer services to realize intelligent application functions.
[0003] For example, in the field of content recommendation, the device implements the content recommendation function by providing question-and-answer services for relevant information such as content interest points or content popularity.
[0004] For another example, in the field of psychology, the device can provide auxiliary psychological counseling functions by providing question-and-answer services based on micro-expressions or behaviors and other related actions.
[0005] In related technologies, question-answering services are usually implemented using a trained target question-answering model, which is trained in the following way:
[0006] For the usage scenario of the target question-answering model, the new scenario states entered by triggering different scenario operations under different scenario states are collected. Since the scenario states before and after the execution of the scenario operation can timely reflect the execution correctness of the scenario operation, the reward and punishment strategy for the usage scenario can be determined by marking whether the collected scenario state switches are correct or not.
[0007] Based on the obtained reward and punishment strategy, the question-answering model to be trained is subjected to multiple rounds of iterative training to obtain a trained target question-answering model; wherein, in each round of iterative training, sample questions posed for the current scenario state of the usage scenario are input into the question-answering model, and corresponding scenario operations are performed according to the training answers generated by the question-answering model, so that the usage scenario enters a new scenario state, and the correctness of the scenario state switching is evaluated based on the reward and punishment strategy, so that the model parameters of the question-answering model can be adjusted based on the evaluation results.
[0008] However, in some usage scenarios of the target question-answering model, the scene state before and after executing a single scene operation is not sufficient to accurately determine the reward and punishment strategy. For example, in the above-mentioned content recommendation scenario, it is difficult to mark the scene state before and after the scene operation of querying the content hot search list, and the reward and punishment strategy when recommending content to a certain object. Then, the target question-answering model trained based on the less accurate reward and punishment strategy will also have a lower question-answering accuracy, and thus the practicality of the application function provided by the target question-answering model is lower. Summary of the invention
[0009] The embodiments of the present application provide a question-answering model training method, an object analysis method, and related equipment, which are used to solve the problem of low question-answering accuracy of a trained target question-answering model.
[0010] In a first aspect, a training method for a question-answering model is provided, comprising:
[0011] Get a sample problem set;
[0012] Based on the sample question set, the pre-trained question-answering model is trained for at least one round of iterative training, and when it is determined that the model training loss reaches the training target, a target question-answering model is obtained; wherein each round of iterative training includes:
[0013] Using the pre-trained question-answering model, split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query;
[0014] Based on the preset multiple question-answering evaluation strategies, respectively executing: using a question-answering evaluation strategy, respectively evaluating the contribution value of each sub-answer of the query when generating the predicted answer, and obtaining an evaluation result;
[0015] When it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on the sub-answers that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
[0016] In a second aspect, an object analysis method is provided, comprising:
[0017] Obtain the problems to be analyzed for the target object;
[0018] The target question answering model trained by the method described in the first aspect is used to perform the following operations on the question to be analyzed:
[0019] Splitting the problem to be analyzed into multiple target sub-problems;
[0020] From a plurality of preset application program interfaces, respectively calling application program interfaces that match the plurality of target sub-questions, and querying the target sub-answers of the corresponding target sub-questions; wherein the application program interfaces are used to search for information from the associated application program when called; and different application program interfaces are associated with different applications;
[0021] Based on the obtained sub-answers to each target, a description text for the target object is generated to obtain an analytical answer to the problem to be analyzed.
[0022] In a third aspect, a training device for a question-answering model is provided, comprising:
[0023] Acquisition module: used to obtain sample question sets;
[0024] Training module: used to perform at least one round of iterative training on the pre-trained question-answering model based on the sample question set, and obtain the target question-answering model when the model training loss reaches the training target; wherein each round of iterative training includes:
[0025] Question answering module: used to use the pre-trained question answering model to split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query;
[0026] Evaluation module: used for respectively executing, based on a plurality of preset question-answer evaluation strategies: adopting a question-answer evaluation strategy, respectively evaluating the contribution value of each sub-answer of the query when generating the predicted answer, and obtaining an evaluation result;
[0027] The training module is specifically used to: when it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on the sub-answers that the model training loss does not reach the training target, adjust the model parameters of the pre-trained question-answering model.
[0028] Optionally, the acquisition module is specifically used for:
[0029] Collecting various online questions obtained in response to the input operation;
[0030] Based on the pre-stored interface function descriptions of each query interface, multiple expanded questions are generated according to the sentence structures of each online question; wherein the query interface is used to query data from an associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface; the expanded question is a question that can be answered by calling at least one query interface among the query interfaces;
[0031] The sample question set is established based on the online questions and the multiple expanded questions.
[0032] Optionally, the question-answering module is specifically used for:
[0033] Using the pre-trained question-answering model, perform the following operations:
[0034] Based on the text features extracted from the selected sample question, the sample question is decomposed into a plurality of sub-question keywords, and sub-questions corresponding to the plurality of sub-question keywords are generated;
[0035] Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the sub-answers of the multiple sub-questions of the query are integrated to generate a predicted answer to the sample question.
[0036] Optionally, the question-answering module is specifically used for:
[0037] Obtaining the interface function description of each pre-stored query interface; wherein the query interface is used to query data from the associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface;
[0038] For the multiple sub-questions, respectively: selecting a target query interface whose interface function description matches the sub-question from the query interfaces, and calling the target query interface to query the sub-answers of the sub-questions;
[0039] Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the obtained sub-answers are integrated to generate a predicted answer to the sample question.
[0040] Optionally, the question-answering module is specifically used for:
[0041] Extracting question content features from the selected sample questions, and extracting corresponding description content features from the function descriptions of each interface;
[0042] Based on the feature similarity between the question content feature and each description content feature, selecting a plurality of associated query interfaces related to the sample question from the query interfaces;
[0043] For the multiple sub-questions, respectively: selecting a target query interface whose interface function description matches the selected sub-question from the multiple associated query interfaces, and calling the target query interface to query the sub-answers of the sub-questions.
[0044] Optionally, the question-answering module is specifically used for:
[0045] Extracting the problem semantic features of the sub-problem, and extracting the description semantic features of the interface function description of the target query interface;
[0046] Determining the calling frequency of the target query interface based on the difference between the obtained question semantic features and the description semantic features;
[0047] The target query interface is cyclically called based on the calling frequency to query the sub-question, query data returned by the target query interface after each call is obtained, and a sub-answer is generated based on at least one query data obtained.
[0048] Optionally, the multiple question-answering evaluation strategies are determined based on at least two of the following data:
[0049] The query efficiency or query success rate of the sub-answers of each of the multiple sub-questions;
[0050] The answer logic represented by the answer track formed by the multiple sub-questions and their sub-answers;
[0051] Preset standard questions and their standard evaluation results, as well as multiple standard sub-questions and their standard sub-answers derived from the standard questions;
[0052] The sample problem involves scenario constraint information preset in the application scenario.
[0053] Optionally, the evaluation module is specifically used for:
[0054] Establishing a question-answering track based on the sample question, the multiple sub-questions and their sub-answers, and the predicted answer;
[0055] Respectively combining a plurality of preset question-answering evaluation strategies with the question-answering track to establish evaluation tasks corresponding to the plurality of question-answering evaluation strategies;
[0056] The trained evaluation model is used to execute the obtained multiple evaluation tasks respectively, wherein the execution process of each evaluation task includes:
[0057] Based on the corresponding question-and-answer evaluation strategy, the contribution value of each sub-answer in the question-and-answer trajectory in generating the predicted answer is evaluated to obtain an evaluation result.
[0058] Optionally, the training module is specifically used for:
[0059] Fusion of multiple evaluation results to obtain a comprehensive evaluation value;
[0060] When the comprehensive evaluation value is greater than the evaluation threshold, determining the probability of generating the predicted answer by querying each sub-answer as the target answer process in the process of generating the predicted answer from the sample question using multiple reference answers;
[0061] When it is determined based on the obtained answer probability that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
[0062] Optionally, when the sample problems selected for each round of iterative training are multiple sample problems, the training module is specifically used to:
[0063] For the multiple sample questions, respectively performing: based on the sample questions, the multiple sub-questions split from the sample questions and the sub-answers of the corresponding queries, and the predicted answers generated by the sample questions, establishing a question-answering track corresponding to the sample questions;
[0064] Taking the question-answering tracks whose corresponding evaluation results meet the training screening conditions as the preferred question-answering tracks, and obtaining at least one preferred question-answering track among the question-answering tracks corresponding to each of the plurality of sample questions;
[0065] When it is determined based on the occurrence probability of the at least one preferred question-answering trajectory in the multiple question-answering trajectories that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
[0066] In a fourth aspect, an object analysis device is provided, comprising:
[0067] Acquisition module: used to obtain the problem to be analyzed for the target object;
[0068] Processing module: used to use the target question answering model trained by the method described in the first aspect to perform the following operations on the question to be analyzed:
[0069] The processing module is specifically used to: split the problem to be analyzed into multiple target sub-problems;
[0070] The processing module is specifically used to: respectively call the application program interfaces that match the multiple target sub-questions from the preset multiple application program interfaces, and query the target sub-answers of the corresponding target sub-questions; wherein the application program interfaces are used to search for information from the associated application programs when called; and different application program interfaces are associated with different applications;
[0071] The processing module is specifically used to: generate a description text for the target object based on each target sub-answer obtained, and obtain an analysis answer to the problem to be analyzed.
[0072] According to a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect or the second aspect.
[0073] A sixth aspect provides a computer device, including:
[0074] A memory for storing program instructions;
[0075] The processor is used to call the program instructions stored in the memory and execute the method as described in the first aspect or the second aspect according to the obtained program instructions.
[0076] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method as described in the first aspect or the second aspect.
[0077] In the embodiment of the present application, when generating the predicted answer to the sample question, the sample question is split into multiple sub-questions, and the predicted answer is generated by querying the sub-answers of each of the multiple sub-questions. Compared with the method of directly identifying the text features of the sample question to generate the predicted answer, it can more comprehensively understand the semantics of the sample question, avoid missing the details of the sample question and giving the wrong answer, and improve the accuracy of the question and answer of the trained target question and answer model.
[0078] Furthermore, after obtaining the predicted answer, a plurality of preset question-answering evaluation strategies can be used to evaluate the question-answering process. Compared with the method of using a preset reward and punishment strategy to evaluate the scene feedback brought by the predicted answer, on the one hand, the entire question-answering process can be comprehensively evaluated based on each sub-answer of the query; on the other hand, through a plurality of question-answering evaluation strategies, the entire question-answering process can be comprehensively evaluated from a plurality of evaluation angles. Therefore, it is possible to avoid the situation where a one-sided evaluation result is obtained due to a relatively single evaluation content, such as evaluation based only on the scene state change, and improve the evaluation accuracy, thereby improving the question-answering accuracy of the trained target question-answering model.
[0079] Furthermore, when adjusting the model parameters of the pre-trained question-answering model, adjustments will only be made when the multiple evaluation results obtained meet the training screening conditions. Therefore, only high-quality data that meet the training screening conditions can be used as data for training the pre-trained question-answering model, so that the target question-answering model is trained based on high-quality data, thereby improving the question-answering accuracy of the trained target question-answering model. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1A A schematic diagram of an application field of the training method of the question-answering model provided in an embodiment of the present application;
[0081] Figure 1B A schematic diagram of a principle of a training method for a question-answering model in related technology;
[0082] Figure 1C A principle diagram of the training method of the question-answering model under the relevant technology Figure 2 ;
[0083] Figure 1D An application scenario of the training method of the question-answering model provided in the embodiment of the present application;
[0084] Figure 2 A flowchart diagram of a method for training a question-answering model provided in an embodiment of the present application;
[0085] Figure 3A A schematic diagram of a principle of a training method for a question-answering model provided in an embodiment of the present application;
[0086] Figure 3B A schematic diagram of a training method for a question-answering model provided in an embodiment of the present application Figure 2 ;
[0087] Figure 4A A third schematic diagram of a principle of a training method for a question-answering model provided in an embodiment of the present application;
[0088] Figure 4B A fourth schematic diagram of a principle of a method for training a question-answering model provided in an embodiment of the present application;
[0089] Figure 5A A fifth schematic diagram of a principle of a method for training a question-answering model provided in an embodiment of the present application;
[0090] Figure 5B A sixth schematic diagram of a principle of a method for training a question-answering model provided in an embodiment of the present application;
[0091] Fig. 6A A flow chart of a training method for a question-answering model provided in an embodiment of the present application Figure 2 ;
[0092] Figure 6B A schematic diagram of a principle of a method for training a question-answering model provided in an embodiment of the present application is shown in FIG7;
[0093] Fig. 7A A schematic diagram of a flow chart of an object analysis method provided in an embodiment of the present application;
[0094] Figure 7B A schematic diagram of a principle of an object analysis method provided in an embodiment of the present application;
[0095] Figure 7C A schematic diagram of the object analysis method provided in the embodiment of the present application Figure 2 ;
[0096] Fig. 8A A structural schematic diagram 1 of a training device for a question-answering model provided in an embodiment of the present application;
[0097] Figure 8B A structural schematic diagram 1 of an object analysis device provided in an embodiment of the present application;
[0098] Fig. 9 A structural diagram of a training device or object analysis device for a question-answering model provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0099] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0100] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0101] (1) Agent:
[0102] An agent is a software or hardware system that can perceive the environment, make decisions, and take actions to achieve a certain goal. An agent can be a simple program or a complex robot or other form of automated equipment. In the field of artificial intelligence, an agent is often used to describe any entity that can autonomously interact with the environment and pursue certain goals.
[0103] (2) Large language model (LLM):
[0104] The main features of large language models are large scale, many parameters, and large amount of training data. They usually use deep neural network architectures such as Transformer or LSTM, and are trained through autoregression or autoencoding. During the training process, the model will try to predict the next word or character to learn the statistical laws of the language.
[0105] (3) Reinforcement Learning (RL):
[0106] Reinforcement learning is a machine learning method that allows an agent to learn the best behavior strategy through interaction with the environment. In reinforcement learning, the agent will continuously try different behaviors and adjust its strategy based on the feedback from the environment to maximize a certain indicator, such as cumulative rewards or long-term benefits.
[0107] The embodiments of the present application relate to artificial intelligence (AI) technology and cloud computing. Artificial intelligence technology and cloud computing can be applied to multiple fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, smart transportation, smart maps, assisted driving, vehicle terminals, aircraft, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology and cloud computing will be applied in more fields and play an increasingly important role.
[0108] It should be noted that the embodiments of the present application involve operations to obtain data such as sample question sets or questions to be analyzed. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0109] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0110] The following is a brief introduction to the application fields of the training method of the question-answering model and the object analysis method provided in the embodiments of the present application.
[0111] With the continuous development of technology, more and more clients or servers can provide intelligent question-and-answer services to realize intelligent application functions.
[0112] For example, in the field of content recommendation, the device implements the content recommendation function by providing question-answering services for relevant information such as content interest points or content popularity. Figure 1A In a short video application, when the playback time of the currently playing first video exceeds a threshold, you can ask a question to the question-answering model to obtain an answer about a second video predicted by the question-answering model that has content interests similar to those of the first video. Then, in response to a video switching operation, the first video can be switched to play the second video to implement a content recommendation function.
[0113] For another example, in the field of psychology, the device can provide auxiliary psychological counseling functions by providing question-and-answer services based on micro-expressions or behaviors and other related actions.
[0114] In related technologies, question-answering services are usually implemented using a trained target question-answering model, which is trained in the following way:
[0115] For the usage scenario of the target question-answering model, the new scenario states entered by triggering different scenario operations under different scenario states are collected. Since the scenario states before and after the execution of the scenario operation can timely reflect the execution correctness of the scenario operation, the reward and punishment strategy for the usage scenario can be determined by marking whether the collected scenario state switches are correct or not.
[0116] Based on the obtained reward and punishment strategy, the question-answering model to be trained is subjected to multiple rounds of iterative training to obtain a trained target question-answering model; wherein, in each round of iterative training, sample questions posed for the current scenario state of the usage scenario are input into the question-answering model, and corresponding scenario operations are performed according to the training answers generated by the question-answering model, so that the usage scenario enters a new scenario state, and the correctness of the scenario state switching is evaluated based on the reward and punishment strategy, so that the model parameters of the question-answering model can be adjusted based on the evaluation results.
[0117] Please refer to Figure 1B The question-answering model is configured in the robot, and the robot can play the maze game through the question-answering model. Then, the reward and punishment strategy can be formulated according to whether there is no way to go after taking the next step from each position, whether it returns to the historical position, etc.
[0118] During the training process, the robot asks the question-answering model a question each time: In the maze map, how should the robot take the next step based on the current position? The robot outputs the predicted answer to the question, and takes the next step in the maze map according to the predicted answer. Based on the scene states such as whether there is no way to take the next step or whether it returns to the previous position, the robot evaluates the correctness of the scene state switching according to the reward and punishment strategy, and obtains the evaluation result, so as to adjust the model parameters of the question-answering model based on the evaluation result.
[0119] Please refer to Figure 1C , the reward and punishment strategy can be formulated based on human preference data. In this case, it is necessary to first collect the data to be labeled and manually label it to obtain the human preference data, and then train the reward and punishment model through the obtained human preference data.
[0120] During the training process, questions are asked to the question-answering model to obtain the predicted answers output by the question-answering model. The reward and punishment model is used to evaluate whether the predicted answers are in line with human preferences, and the evaluation results are obtained to adjust the model parameters of the question-answering model based on the evaluation results.
[0121] However, in some usage scenarios of the target question-answering model, the scene state before and after executing a single scene operation is not sufficient to accurately determine the reward and punishment strategy. For example, in the above-mentioned content recommendation scenario, it is difficult to mark the scene state before and after the scene operation of querying the content hot search list, and the reward and punishment strategy when recommending content to a certain object. Then, the target question-answering model trained based on the less accurate reward and punishment strategy will also have a lower question-answering accuracy, and thus the practicality of the application function provided by the target question-answering model is lower.
[0122] In order to solve the problem of low question-answering accuracy of the trained target question-answering model, the present application proposes a method for training a question-answering model. In the method, based on the obtained sample question set, the pre-trained question-answering model is trained for at least one round of iterations to output the target question-answering model.
[0123] Each round of iterative training includes:
[0124] Using a pre-trained question-answering model, the selected sample question is split into multiple sub-questions, and the predicted answer to the sample question is generated based on the sub-answers of the multiple sub-questions of the query. Based on the preset multiple question-answering evaluation strategies, respectively execute: using a question-answering evaluation strategy, respectively evaluate the contribution value of each sub-answer of the query when generating the predicted answer, and obtain the evaluation result. When it is determined that the obtained multiple evaluation results meet the training screening conditions, adjust the model parameters of the pre-trained question-answering model based on each sub-answer.
[0125] In the embodiment of the present application, when generating the predicted answer to the sample question, the sample question is split into multiple sub-questions, and the predicted answer is generated by querying the sub-answers of each of the multiple sub-questions. Compared with the method of directly identifying the text features of the sample question to generate the predicted answer, it can more comprehensively understand the semantics of the sample question, avoid missing the details of the sample question and giving the wrong answer, and improve the accuracy of the question and answer of the trained target question and answer model.
[0126] Furthermore, after obtaining the predicted answer, a plurality of preset question-answering evaluation strategies can be used to evaluate the question-answering process. Compared with the method of using a preset reward and punishment strategy to evaluate the scene feedback brought by the predicted answer, on the one hand, the entire question-answering process can be comprehensively evaluated based on each sub-answer of the query; on the other hand, through a plurality of question-answering evaluation strategies, the entire question-answering process can be comprehensively evaluated from a plurality of evaluation angles. Therefore, it is possible to avoid the situation where a one-sided evaluation result is obtained due to a relatively single evaluation content, such as evaluation based only on the scene state change, and improve the evaluation accuracy, thereby improving the question-answering accuracy of the trained target question-answering model.
[0127] Furthermore, when adjusting the model parameters of the pre-trained question-answering model, adjustments will only be made when the multiple evaluation results obtained meet the training screening conditions. Therefore, only high-quality data that meet the training screening conditions can be used as data for training the pre-trained question-answering model, so that the target question-answering model is trained based on high-quality data, thereby improving the question-answering accuracy of the trained target question-answering model.
[0128] On this basis, this application proposes an object analysis method. In this method, after obtaining the question to be analyzed for the target object, the target question answering model trained by the above-mentioned question answering model training method is used to perform the following operations on the question to be analyzed:
[0129] The problem to be analyzed is divided into multiple target sub-problems. From the preset multiple application program interfaces, the application program interfaces that match the multiple target sub-problems are called respectively to query the target sub-answers of the corresponding target sub-problems. The application program interface is used to search for information from the associated application when called, and different application program interfaces are associated with different applications. Based on the obtained target sub-answers, a description text for the target object is generated to obtain the analysis answer of the problem to be analyzed.
[0130] In the embodiment of the present application, since the target question and answer model has learned the ability to accurately split sub-questions and accurately describe the final answer based on the sub-answers of the query, it can flexibly use multiple preset application programming interfaces to accurately split the problem to be analyzed into multiple target sub-questions that have the greatest contribution value to obtaining the analysis answer, and accurately describe the analysis answer, so that the problem to be analyzed can be accurately analyzed based on the target question and answer model, thereby improving the object analysis accuracy on the basis of improving the question and answer accuracy of the target question and answer model.
[0131] The following describes the application scenarios of the training method of the question-answering model and the object analysis method provided in this application.
[0132] Please refer to Figure 1D , which is a schematic diagram of an application scenario of the training method and object analysis method of the question-answering model provided in this application. The application scenario includes a server 101 and a client 102, and the server 101 and the client 102 can communicate with each other. The communication method can be wired communication technology, for example, by connecting a network cable or a serial port cable; or wireless communication technology, for example, by Bluetooth or wireless fidelity (WIFI) and other technologies, without specific limitation.
[0133] The client 102 generally refers to a device that can provide application functions based on the question-answering model, such as a terminal device, a third-party application program accessible to the terminal device, or a webpage accessible to the terminal device, etc. The server 101 generally refers to a device that can use or train the question-answering model, such as a terminal device or a server, etc.
[0134] Terminal devices include but are not limited to mobile phones, computers, smart medical devices, smart home appliances, vehicle-mounted terminals or aircraft, etc. Servers include but are not limited to cloud servers, local servers or associated third-party servers, etc. Both the client 101 and the server 102 can use cloud computing to reduce the occupation of local computing resources; cloud storage can also be used to reduce the occupation of local storage resources.
[0135] As an embodiment, the server 101 and the client 102 may be the same device, or may be different devices, or may be different devices with some modules in common, etc., without specific limitation.
[0136] In response to the trigger operation for the object analysis function, the client 102 sends the question to be analyzed by the client 102 to the server 101. The server 101 receives the question to be analyzed sent by the client 102, generates an analysis answer to the question to be analyzed using the target question-answering model, and feeds back the analysis answer to the client 102. After receiving the analysis answer sent by the server 101, the client 102 completes the object analysis function based on the analysis answer.
[0137] The following is based on Figure 1D , the training method of the question-answering model provided in the embodiment of the present application is specifically introduced. Please refer to Figure 2 , which is a flow chart of the training method of the question-answering model provided in an embodiment of the present application.
[0138] S201, obtaining a sample question set.
[0139] Before training the question-answering model, you can first obtain a sample question set, which contains multiple sample questions. Different sample questions can involve different fields or different scenarios, etc., without any specific restrictions.
[0140] As an embodiment, there are multiple methods for obtaining a sample question set, for example, downloading sample questions from network resources as a sample question set; for example, collecting questions obtained by the client in response to an input operation as sample questions to generate a sample question set; for example, expanding questions based on questions obtained in response to an input operation to establish a sample question set, etc., without specific limitation.
[0141] The following is an introduction to a method for obtaining a sample question set in an interface call scenario.
[0142] Collect various online questions obtained in response to input operations. Based on the pre-stored interface function descriptions of each query interface, generate multiple expanded questions according to the statement structure of each online question. The query interface is used to query data from the associated database when called. Databases associated with different query interfaces store data involving different fields. Different fields can be fields belonging to completely different knowledge systems, such as the weather field, the financial field, the film and television field, and the mathematical computing field; they can also be fields of different directions in a knowledge system. For example, child psychology and adult psychology in psychology can be different fields.
[0143] The interface function description is used to describe at least one query function provided by the corresponding query interface. The expanded question is a question that can be answered by calling at least one query interface in each query interface. Therefore, a sample question set can be established based on each online question and multiple expanded questions.
[0144] Real online questions can reflect users' real questioning needs, so that the question-answering model can be trained based on an accurate set of sample questions, so that the trained target question-answering model can predict answers more accurately. Question expansion based on real online questions makes the expanded questions closer to real scenarios, avoiding misleading the training process of the question-answering model due to the fact that the expanded questions are too niche, and improving the accuracy of the question-answering of the trained target question-answering model.
[0145] Please refer to Figure 3A , each query interface includes a calculator interface, a stock price query interface, a weather query interface, a geographic knowledge query interface, and a book information query interface, etc. The interface function description includes, for example, a query format, a query result format, a query strategy, etc. of at least one query function.
[0146] For example, the interface function description of the calculator interface is: calculate mathematical operations between numbers; numbers include: integers and decimals, etc.; mathematical operations include: addition, subtraction, multiplication, division, square root and power, etc.; the operation rules of mathematical operations are: the order of operations from left to right, and the priority of operations in brackets is higher than the priority of operations outside brackets, etc.
[0147] For another example, the interface function description of the stock price query interface is: the query format is: stock number + query date; the queried data includes: price with two decimal places and query date, etc.
[0148] Then, the online questions collected in response to input operations include, for example, "What will the weather be like in city A tomorrow?", "Please help me check the unit price of stock B today?", "What is 123+(258-569)*8 / 14 equal to?", "Which celebrities wrote the preface of book C?", and "Will the topography of geographical location D change between August and September?", etc.
[0149] According to the sentence structure of the online question "What will the weather be like in city A tomorrow?", you can generate extended questions for the stock price query interface, such as "What was the price of stock A yesterday?". According to the online question "Can you help me check the price of stock B today?", you can generate extended questions for the geographic knowledge query interface, such as "Can you help me check the topographic picture of geographic location B today?", etc.
[0150] Please refer to Figure 3BGenerating expansion questions can also be achieved by using a trained large language model. The large language model is used for data enhancement. Each query interface and each online question is combined to generate an expansion task. The expansion task is used as a prompt word and input into the large language model, so that the large language model generates various expansion questions according to the expansion task.
[0151] In the expansion task, you can also set the constraint information of the expansion question so that the large language model can generate the expansion question that meets the constraint information. For example, the constraint information includes: generating an expansion question that can indicate the call of a certain query interface based on each query interface; generating the expansion question according to the format of the online question.
[0152] For example, a large language model is used to extract a stock price query interface from various query interfaces, and at the same time, a question "What was the price of stock A yesterday?" is extracted from various online questions, so that an expanded question "What was the stock market information of stock C yesterday?" can be generated according to the constraint information.
[0153] For example, a large language model is used to extract a weather query interface from various query interfaces, and at the same time, a question "What was the price of stock A yesterday?" is extracted from various online questions, so that an expanded question "What was the weather information of city B in the past seven days?" can be generated according to the constraint information.
[0154] As an embodiment, a quantity threshold may be preset, and when it is determined that the number of collected online questions is less than the quantity threshold, multiple expanded questions are generated until the quantity threshold is reached. This ensures that the data of the sample question set in the training process of the question-answering model is sufficient, and the problem of low training accuracy due to insufficient data does not occur. This not only improves the data coverage, but also enhances the effectiveness and adaptability of question-answering model training, and can improve the question-answering accuracy of the target question-answering model obtained through training.
[0155] S202, based on the obtained sample question set, perform at least one round of iterative training on the pre-trained question-answering model, and obtain the target question-answering model when it is determined that the model training loss reaches the training target.
[0156] After obtaining the sample question set, the pre-trained question-answering model can be subjected to at least one round of iterative training based on the obtained sample question set, and the target question-answering model can be obtained when the model training loss reaches the training target. The pre-trained question-answering model can be a model trained based on a general data set and is not limited to a certain usage scenario, that is, the model parameters of the pre-trained question-answering model are not in the initial random state, and the pre-trained question-answering model already has a certain knowledge reserve and can answer questions. The pre-trained question-answering model can simplify the model training process in a certain usage scenario. It only requires at least one round of iterative training of the pre-trained question-answering model to make the model training loss reach the training target and obtain the target question-answering model.
[0157] After obtaining the target question-answering model, the model training loss of the target question-answering model can be further determined based on the questions to be analyzed input during the use of the target question-answering model. Therefore, when the model training loss does not reach the training target, the model parameters of the target question-answering model can continue to be adjusted, so that the training and use processes can be carried out simultaneously, thereby improving the flexibility of model training.
[0158] The pre-trained question-answering model can be an intelligent agent, a large language model, an actor model, or a model trained using reinforcement learning, etc., without specific limitation.
[0159] The following is an introduction using one round of iterative training process as an example. Please refer to S2021 to S2023. The process of each round of iterative training is similar and will not be repeated here.
[0160] S2021 uses a pre-trained question-answering model to split the selected sample question into multiple sub-questions, and generates a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query.
[0161] At least one sample question is selected from the sample question set for this round of iterative training. The selection can be with or without replacement, and there is no specific restriction. Taking the selection of a sample question as an example, during this round of iterative training, the pre-trained question-answering model is used to split the selected sample question into multiple sub-questions, and the predicted answer to the sample question is generated based on the sub-answers of the multiple sub-questions of the query.
[0162] The complexity of the sub-questions is lower than that of the sample questions. For example, sub-questions are questions that can be answered directly through queries, while sample questions can be questions that are answered by organizing language to describe each sub-answer. Therefore, by splitting the sample question into multiple sub-questions, it can reflect the understanding ability of the pre-trained question-answering model that has been learned for the sample question, as well as the logical thinking for solving the sample question.
[0163] For example, if the sample question is "What is the weather information of City B in the past seven days?", then the sub-questions can include "What dates are included in the 7 days ending with yesterday's date?", "Query the temperature information, rainfall information and ultraviolet information of City B on these dates", and "Count the temperature changes of temperature information, rainfall changes of rain information, and ultraviolet changes of ultraviolet information on these dates".
[0164] As an embodiment, the pre-trained question-answering model can make decisions based on the sample questions obtained, automatically split the selected sample questions into multiple sub-questions based on its own understanding of the sample questions, and query the sub-answers of the corresponding sub-questions, so as to build a predicted answer in combination with the knowledge base stored in the pre-trained question-answering model. Then, using the pre-trained question-answering model, perform the following operations:
[0165] Based on the text features extracted from the selected sample questions, the sample questions are decomposed into multiple sub-question keywords, and sub-questions corresponding to the multiple sub-question keywords are generated. Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the sub-answers of the multiple sub-questions of the query are integrated to generate the predicted answer to the sample question.
[0166] Each sub-question can reflect the ability of the pre-trained question-answering model to extract text features for sample questions, the ability to understand sample questions based on the extracted text features, and the logical thinking to solve sample questions. By integrating the sub-answers of multiple sub-questions through the learned knowledge base, it can reflect the problem-solving ideas for sample questions that the pre-trained question-answering model has learned, as well as the accuracy of the knowledge in the learned knowledge base, so that through continuous iterative training, the trained target question-answering model can have more humanized question-answering capabilities and improve the accuracy of the target question-answering model.
[0167] As an embodiment, the pre-trained question-answering model can determine to call the appropriate query interface for each sub-question to query the sub-answer of the corresponding sub-question. Then, after obtaining the interface function description of each pre-stored query interface, the pre-trained question-answering model is used to execute the following operations for multiple sub-questions:
[0168] From each query interface, select the target query interface whose interface function description matches the sub-question, and call the target query interface to query the sub-answer of the sub-question. Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, integrate the obtained sub-answers to generate the predicted answer to the sample question.
[0169] The query interface is used to query data from the associated database when called. Databases associated with different query interfaces store data related to different fields. The interface function description is used to describe at least one query function provided by the corresponding query interface.
[0170] The query interface may be an application programming interface (API), a small program with a query function, a query entry in a database, an instant messaging record search entry, etc., without specific limitation.
[0171] By splitting the sample question into multiple sub-questions, the matching target query interface can be determined for each sub-question to query the sub-answers of the corresponding sub-questions. Then the sample question can not only be a vertical question involving one field, but also a horizontal question involving multiple fields, which improves the comprehensiveness of the question and answer of the target question and answer model obtained by training, thereby improving the question and answer accuracy of the target question and answer model.
[0172] Please refer to Figure 4A , one query interface is a calculator interface, and the interface function description of the calculator interface is: calculating mathematical operations between numbers; numbers include: integers and decimals, etc.; mathematical operations include: addition, subtraction, multiplication, division, square root and power, etc.; the operation rules of mathematical operations are: the order of operations from left to right, and the priority of operations in brackets is higher than the priority of operations outside brackets, etc.
[0173] When the sample question is "What is 8*(5+2) equal to?", the sub-questions that are split out may include "What is 5+2 equal to?" and "What is the product of the sub-answer of the previous sub-question and 8?". Then, in each query interface, it can be determined that the interface function description of the calculator interface matches each sub-question. Then the calculator interface can be used as the target query interface for each sub-question, and the sub-answer of each sub-question can be queried in turn. The sub-answer of the sub-question "What is 5+2 equal to?" is "7". The sub-question "What is the product of the sub-answer of the previous sub-question and 8?" can be converted into the sub-question "What is 7*8 equal to?", and its sub-answer is "56". The sub-answer of a sub-question can be used as the predicted answer.
[0174] As an embodiment, when selecting a target query interface whose interface function description matches the sub-question from various query interfaces, the target query interface may be selected from all query interfaces as described above, or the query interface that is extremely irrelevant to the sample question may be filtered out from all query interfaces before selection. The process of filtering out query interfaces that are extremely irrelevant to the sample question is described below.
[0175] Extract the question content features from the selected sample questions, and extract the corresponding description content features from the interface function descriptions respectively. Based on the feature similarity between the question content features and the description content features, select multiple associated query interfaces related to the sample questions from the query interfaces.
[0176] For multiple sub-questions, respectively execute: from multiple associated query interfaces, select a target query interface whose interface function description matches the selected sub-question, and call the target query interface to query the sub-answers of the sub-questions.
[0177] Since the matching of sub-questions and interface function descriptions is implemented using a pre-trained question-answering model, which has a large number of model parameters, each match occupies a lot of computing resources. At the same time, in the API query scenario, there are hundreds or thousands of APIs, and directly splicing all API information into the pre-trained question-answering model may exceed the maximum length limit it can handle.
[0178] Therefore, by pre-adopting simple feature comparison to reduce the selection range when selecting the target query interface, the amount of computation consumed when using the pre-trained question-answering model to match sub-questions and interface function descriptions can be greatly reduced, unnecessary computing resources can be avoided, and the selection efficiency can be improved, thereby improving the training efficiency of the target question-answering model. At the same time, through multiple screening, the correlation between the predicted answer output by the pre-trained question-answering model and the sample question can be improved, as well as the accuracy when selecting through multiple associated query interfaces, thereby improving the question-answering accuracy of the trained target question-answering model.
[0179] The feature similarity between the question content feature and each description content feature can be obtained by using a calculation method such as cosine similarity, please refer to formula (1).
[0180]
[0181] Among them, A represents the question content characteristics of the sample question, and B represents the description content characteristics of the interface function description of any query interface.
[0182] Selecting multiple associated query interfaces related to the sample question from each query interface may be performed by selecting multiple query interfaces with the largest feature similarity from each query interface according to a preset number of interfaces as multiple associated query interfaces.
[0183] Please refer to Figure 4B , extract content features from the sample question "What will the weather be like in city A tomorrow?" to obtain the question content features, recorded as embedding1, and extract content features from the interface function descriptions of each query interface (query interface_1, query interface_2, ... query interface_n) to obtain the corresponding description content features, recorded as embedding2_1, embedding2_2, ... and embedding2_n. Use the above formula (1) to determine the feature similarity between the question content features and each description content feature. Arrange the query interfaces in descending order of feature similarity, and select the first k associated query interfaces from the sorted query interfaces, recorded as associated query interface_1, associated query interface_2, ... associated query interface_k.
[0184] As an embodiment, the pre-trained question-answering model can also make autonomous decisions on the frequency of calling the target query interface. For some sub-questions, it may be necessary to call the target query interface multiple times in a loop to obtain sub-answers. For example, the sample question "What is the weather information of City B in the past seven days?" is split into sub-questions including "Which dates are included in the 7 days ending with yesterday's date?" and "Query the weather information of City B on these dates?". Then for the sub-question "Query the weather information of City B on these dates?", it is necessary to call the weather information query interface 7 times in a loop to query the weather information for seven days. Therefore, the pre-trained question-answering model can also determine the frequency of calling the target query interface to improve the accuracy of question and answer.
[0185] Extract the problem semantic features of the sub-questions, and extract the description semantic features of the interface function description of the target query interface. Determine the call frequency of the target query interface based on the difference between the obtained problem semantic features and the description semantic features. Based on the call frequency, call the target query interface cyclically to query the sub-questions, obtain the query data returned by the target query interface after each call, and generate a sub-answer based on at least one query data obtained.
[0186] The calling frequency may include at least one of the number of calls and the calling conditions, for example, calling three times in a cycle of one hour; for example, calling again when query data is obtained after each call; for example, calling twice at the same time; for example, calling once every time a sub-answer to a specified sub-question is received, etc., without specific limitation.
[0187] For example, the target query interface is a weather information query interface, and the interface function description of the weather information query interface includes: querying the weather information on a specified date. Then, the difference between the question semantic feature and the description semantic feature can represent the difference between one day and seven days, so that the calling frequency of the weather information query interface can be determined to be 7 cycles.
[0188] As an embodiment, the pre-trained question-answering model is associated with a historical memory pool for storing training-related data, such as a sample data set, at least one sample question selected for each round of iterative training, each query interface and its interface function description, sub-answers queried from the corresponding target query interface, etc.
[0189] As an embodiment, the sample question, each sub-question, each sub-answer and predicted answer can be recorded as a question-answering trajectory in the order in which they are obtained. Please refer to formula (2), where T represents the set of question-answering trajectories recorded by the sample question set.
[0190] T={I (n,k) A 1 (n,k) O 1 (n,k) …AM (n,k) O M (n,k)} (2)
[0191] Among them, I (n,k) A represents the question-answering track recorded during the k-th prediction of the n-th sample question. 1 (n,k) Indicates query for the first sub-question, O 1 (n,k) represents the sub-answer obtained by querying the first sub-question. n = 1, 2 ... N, k = 1, 2 ... K, M represents the maximum number of queries for all sub-questions.
[0192] The question-answering trajectory can be used as the question-answering process, reflecting the thinking process when using the pre-trained question-answering model to predict the answer, thereby reflecting the question-answering accuracy of the pre-trained question-answering model.
[0193] S2022, based on the preset multiple question-answering evaluation strategies, respectively execute: adopt a question-answering evaluation strategy to respectively evaluate the contribution value of each sub-answer of the query when generating a predicted answer, and obtain an evaluation result.
[0194] After obtaining the sub-answers of each sub-question split from the sample question, you can execute them separately based on the preset multiple question-and-answer evaluation strategies: use a question-and-answer evaluation strategy to evaluate the contribution value of each sub-answer of the query when generating the predicted answer, and obtain the evaluation result.
[0195] A variety of question-answering evaluation strategies can evaluate the question-answering process from a variety of evaluation perspectives and obtain corresponding evaluation results, thereby making a comprehensive and integrated evaluation of the question-answering process, thus avoiding the problems of poor training effect and low training efficiency of the pre-trained question-answering model and low question-answering accuracy of the trained target question-answering model caused by a single or one-sided evaluation process.
[0196] The contribution value of the sub-answer when generating a predicted answer can represent the content proportion of the sub-answer in the predicted answer, the difficulty of obtaining the predicted answer from the sub-answer, the emotional correlation between the sub-answer and the predicted answer, the logical correlation between the sub-answer and the predicted answer, etc., without specific limitation.
[0197] As an embodiment, the multiple question-answering evaluation strategies are determined based on at least two of the following data:
[0198] 1. The query efficiency or query success rate of each sub-answer of multiple sub-questions. The query efficiency or query success rate of the sub-answer can reflect the query difficulty of the sub-answer. The lower the query efficiency or query success rate, the greater the query difficulty, and the lower the contribution value when generating the predicted answer; the higher the query efficiency or query success rate, the lower the query difficulty, and the higher the contribution value when generating the predicted answer.
[0199] For example, in the scenario of querying a sub-answer by calling a query interface, if the query interface call fails, the obtained sub-answer may be a call failure feedback, and its contribution value when generating a predicted answer is 0. If the query interface call efficiency is high and the sub-answer can be obtained quickly, then the query of the next sub-question can be entered based on the sub-answer, so that more contributions can be made when generating a predicted answer, and the contribution value is higher.
[0200] 2. The answer logic represented by the answer trajectory formed by multiple sub-questions and their sub-answers. The answer logic can be reflected in many aspects, such as the number of sub-questions or sub-answers, the correlation between sub-questions, the fusion between sub-answers, the relevance between sub-answers and the usage scenarios of the pre-trained question-answering model, etc.
[0201] For example, the greater the number of sub-questions or sub-answers, the longer the path to the predicted answer, and the lower the contribution value of the reply logic when generating the predicted answer; the smaller the number of sub-questions or sub-answers, the shorter the path to the predicted answer, and the higher the contribution value of the reply logic when generating the predicted answer.
[0202] For another example, the association relationship between sub-questions can be that the sub-answer of one sub-question is the question content in another sub-question, or that the two sub-questions are questions about parallel or semantically opposite content, or that the two sub-questions have the same or similar subjects or verbs, etc., without specific limitation.
[0203] For another example, if each sub-answer can be used as a word in a different grammatical position in a sentence and integrated into a sentence, then the fusibility is high; if there are multiple sub-answers that cannot be integrated into a sentence, then the fusibility is low.
[0204] For another example, if the usage scenario of the pre-trained question-answering model is a weather query scenario, then when the sub-answer is used to describe the weather, the relevance is high; when the sub-answer is used to describe numerical calculations, the relevance is low.
[0205] 3. Preset standard questions and their standard evaluation results, as well as multiple standard sub-questions and their standard sub-answers split from the standard questions. By taking the preset standard questions and their standard evaluation results, as well as multiple standard sub-questions and their standard sub-answers split from the standard questions as samples, and evaluating each sub-answer obtained from the sample questions with the evaluation criteria of the samples, the evaluation process has a reference basis, avoiding situations where the evaluation results are too outrageous, etc., which can improve the evaluation accuracy, thereby improving the training accuracy, and thus improving the question-answering accuracy of the trained target question-answering model.
[0206] 4. Preset scenario constraint information in the application scenarios involved in the sample questions. The scenario constraint information is used to prevent the generated predicted answers from containing content that is not allowed in the application scenarios. For example, in the calculator scenario, if the scenario constraint information is to retain two decimal places, then the predicted answers will not contain values with more than two decimal places.
[0207] As an embodiment, when selecting multiple question-answering evaluation strategies, the question-answering evaluation strategies corresponding to the other evaluation results, except for the evaluation results representing the best evaluation results and the worst evaluation results, can be selected as the evaluation strategies used in this round of iterative training, and the other evaluation results can be used as the evaluation results referenced by this round of iterative training. This can avoid the situation where the evaluation results of a certain question-answering evaluation strategy are too superior or too poor, which will affect other evaluation results when combining multiple evaluation results, thereby improving the evaluation accuracy and applicability.
[0208] In each round of iterative training, multiple question-answering evaluation strategies can also be randomly selected so that each question-answering evaluation strategy will be used throughout the entire training process, thereby improving the comprehensiveness of the evaluation and thus improving the question-answering accuracy of the target question-answering model obtained through training.
[0209] As an embodiment, the evaluation process can be implemented using a trained evaluation model to improve the intelligence of the evaluation process, thereby improving the evaluation efficiency and accuracy, and achieving the purpose of improving the accuracy of the question and answer of the trained target question and answer model. The evaluation model can be an intelligent agent, a large language model, or a critic model, etc., without specific limitation.
[0210] Based on the sample question, multiple sub-questions and their sub-answers, and the predicted answer, a question-answering track is established. The question-answering track is used to characterize each question-answering process, so that a comprehensive and comprehensive evaluation of the question-answering process can be performed. The question-answering track can be referred to in the previous article and will not be repeated here.
[0211] Combine the preset multiple question-answering evaluation strategies and question-answering trajectories to establish evaluation tasks corresponding to the multiple question-answering evaluation strategies. Use the trained evaluation model to execute the obtained multiple evaluation tasks respectively, wherein the execution process of each evaluation task includes: based on the corresponding question-answering evaluation strategy, evaluate the contribution value of each sub-answer in the question-answering trajectory when generating the predicted answer, and obtain the evaluation result.
[0212] In the API call scenario, please refer to Figure 5A (1) in the question-answering evaluation strategy is to evaluate the success rate of API calls. Please refer to Figure 5A (2) in the question-answering evaluation strategy is to evaluate the answer logic represented by the answer trajectory, please refer to Figure 5A In (3), there is also a question-answering evaluation strategy that evaluates the correctness of the predicted answer as the answer to the sample question.
[0213] Then, we combine each question-answering evaluation strategy and question-answering track to establish the corresponding evaluation task. Each evaluation task can include three task contents. The first task content is used to indicate the identity of the evaluation model and the question-answering evaluation strategy. The second task content is used to indicate the question-answering track to be evaluated. The third task content is used to provide the evaluation example corresponding to the question-answering evaluation strategy.
[0214] S2023, when it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on each sub-answer that the model training loss does not reach the training target, adjust the model parameters of the pre-trained question-answering model.
[0215] After obtaining the evaluation results corresponding to multiple question-and-answer evaluation strategies, it can be determined whether the multiple evaluation results meet the training screening conditions. Meeting the training screening conditions means that the question-and-answer process of the sample question is a high-quality question-and-answer process, which can be used as a reference for adjusting the model parameters of the pre-trained question-and-answer model. Therefore, when the training screening conditions are met, when it is determined based on each sub-answer that the model training loss does not reach the training target, the model parameters of the pre-trained question-and-answer model are adjusted.
[0216] Failure to meet the training screening conditions indicates that the question-answering process of the sample question is a low-quality question-answering process with little learnability. Therefore, it can be discarded and not used as a reference for adjusting the model parameters of the pre-trained question-answering model.
[0217] There can be multiple training screening conditions. For example, among multiple evaluation results, if there are more than a preset number of evaluation results, which all indicate that the contribution value of each sub-answer in generating the predicted answer reaches the expected value, it can be determined that the training screening condition is met. Taking the evaluation result as a scoring result of a 10-point system as an example, if there are more than 3 evaluation results with a corresponding scoring result greater than 8 points, it is determined that the training screening condition is met.
[0218] For another example, if multiple evaluation results all indicate that the contribution value of each sub-answer in generating the predicted answer reaches the expectation, and there is at least one evaluation result that indicates that the contribution value of each sub-answer in generating the predicted answer reaches the target, it can be determined that the training screening condition is met. Taking the evaluation result as a scoring result of a 10-point system as an example, if the scoring results corresponding to the 5 evaluation results are all greater than 6 points, and there is an evaluation result corresponding to a scoring result greater than or equal to 9, it is determined that the training screening condition is met.
[0219] If the number of training times is pre-configured, then when the number of iterative training rounds reaches the training time, it is determined that the model training loss has reached the training target, otherwise it has not reached the training target; if the training target is pre-configured to minimize the model training loss, then when the model training loss determined based on each sub-answer obtained through multiple rounds of iterative training fluctuates around a smaller value, it can be determined that the model training loss has reached the training target, otherwise it has not reached the training target; if the training target is pre-configured as a threshold, then when the model training loss determined based on each sub-answer is less than the threshold, it can be determined that the model training loss has reached the training target, otherwise it has not reached the training target, etc., without specific restrictions.
[0220] As an embodiment, taking the evaluation result in numerical format as an example, a process of adjusting the model parameters of a pre-trained question-answering model is introduced. Multiple evaluation results are obtained by integrating to obtain a comprehensive evaluation value. When the comprehensive evaluation value is greater than the evaluation threshold, the probability of generating a predicted answer by querying each sub-answer as a target answer process in the process of generating multiple reference answers from sample questions is determined. When it is determined based on the obtained answer probability that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
[0221] The multiple evaluation results obtained by fusion may be a weighted sum of the multiple evaluation results; or the average value of other evaluation results may be calculated after discarding the maximum value and the minimum value among the multiple evaluation results, etc., and there is no specific limitation.
[0222] When the comprehensive evaluation value is greater than the evaluation threshold, it is determined that the training screening conditions are met, and the model parameters of the pre-trained question-answering model can be further adjusted based on each sub-answer. When the comprehensive evaluation value is not greater than the evaluation threshold, it is determined that the training screening conditions are not met, and the next round of iterative training can be directly entered, or the model parameters of the pre-trained question-answering model can be adjusted based on the question-answering process of other sample questions selected in this round of iterative training.
[0223] When adjusting the model parameters of the pre-trained question-answering model based on each sub-answer, the response probability of generating a predicted answer by querying each sub-answer as a target response process in the process of generating a predicted answer from a sample question can be determined, please refer to formula (3). The model training loss can be determined by the response probability, and when the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted until the determined model training loss reaches the training target, and the target training model is output.
[0224]
[0225] Among them, M represents the maximum number of queries, I represents a sample question, and A m represents a query for the mth sub-problem, O m-1 represents the sub-answer found in a query for the m-1th sub-question, P θ (·) represents the conditional probability for θ.
[0226] Please refer to Figure 5B , generating predicted answers from sample questions may include three reference reply processes, the first reference reply process is: obtaining sub-answer A from sub-question A query, then obtaining sub-answer B from sub-question B query, and finally generating a predicted answer based on sub-answer A and sub-answer B; the second reference reply process is: obtaining sub-answer C from sub-question C query, then obtaining sub-answer A from sub-question A query, then obtaining sub-answer D from sub-question D query, and finally generating a predicted answer based on sub-answer A, sub-answer C and sub-answer D; the third reference reply process is: obtaining sub-answer E from sub-question E query, then obtaining sub-answer B from sub-question B query, and finally generating a predicted answer based on sub-answer B and sub-answer E.
[0227] During this round of iterative training, the sample question is split into sub-question A and sub-question B, which corresponds to the first reference answering process. Then, the probability that the first reference answering process can be used as the target answering process among the three reference answering processes can be determined, which is the aforementioned answering probability.
[0228] Since the first reference answer process is a high-quality question-answer process that meets the training screening conditions, the training process attempts to increase the probability that the first reference answer process can be used as the target answer process among the three reference answer processes. Based on this answer probability, the model parameters of the pre-trained question-answer model can be adjusted so that the trained target question-answer model can generate the most accurate predicted answers with the highest quality question-answer process, thereby achieving the purpose of improving the question-answer accuracy of the target question-answer model.
[0229] As an embodiment, multiple sample questions can be selected in each round of iterative training, and the above method is used to generate corresponding predicted answers and obtain corresponding multiple evaluation results for each sample question. In one round of iterative training, the question-answering process of multiple sample questions is learned, so that the pre-trained question-answering model can learn the correct question-answering process more efficiently, improve the training efficiency, and enable the pre-trained question-answering model to output the target question-answering model after at least one round of iterative training, and use the target question-answering model to answer questions with an accurate question-answering process.
[0230] For multiple sample questions, we can perform the following operations separately: based on the sample question, the multiple sub-questions split from the sample question, the sub-answers of the corresponding query, and the predicted answers generated by the sample question, we can establish the question-answering track corresponding to the sample question. The question-answering process of each sample question is recorded in the question-answering track, which is convenient for the subsequent analysis of the logical relationship between the sub-questions.
[0231] The question-answering trajectories whose corresponding evaluation results meet the training screening conditions are taken as the preferred question-answering trajectories, and at least one preferred question-answering trajectory is obtained from the question-answering trajectories corresponding to the multiple sample questions. Based on the occurrence probability of at least one preferred question-answering trajectory in the multiple question-answering trajectories, the model parameters of the pre-trained question-answering model are adjusted.
[0232] The model training loss is determined by the occurrence probability. When the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted until the determined model training loss reaches the training target, and the target training model is output.
[0233] The probability of at least one preferred question-answering trajectory occurring in multiple question-answering trajectories, see formula (4), can characterize the possibility of the question-answering process in which the pre-trained question-answering model can accurately answer the question. By adjusting the model parameters of the pre-trained question-answering model, this possibility can be increased, thereby achieving the purpose of obtaining a target question-answering model that can accurately answer questions.
[0234]
[0235] Among them, N represents the number of sample questions selected in this round of iterative training, K represents the number of high-quality question-answering trajectories, and the others can be referred to the previous introduction.
[0236] For example, 100 sample questions are selected for this round of iterative training. Among the question-answering processes of these 100 sample questions, there are 80 high-quality question-answering processes. That is to say, the current pre-trained question-answering model has an 80% chance of accurately answering questions. Then, by adjusting the model parameters of the pre-trained question-answering model, in the next round of iterative training, there will be 90 high-quality question-answering processes. Then, the training goal is gradually approached, and the pre-trained question-answering model is closer to the target question-answering model.
[0237] Adjusting the model parameters of the pre-trained question-answering model can be implemented using a synchronous feature training (SFT) algorithm or other algorithms, without specific limitation.
[0238] The following uses the API call field and the pre-trained question-answering model as an example to introduce the training method of the question-answering model. Please refer to Fig. 6A and Figure 6B .
[0239] S601, collecting each online question obtained in response to the input operation, and storing each online question as a sample question in a history memory pool associated with the agent.
[0240] In response to an input operation triggered by a question input location provided in a network resource, an online question can be obtained, and thus by collecting the input online questions, sample questions can be obtained, and the sample questions are stored in a historical memory pool associated with the agent for use in training.
[0241] S602, based on the interface function description of each API contained in the pre-stored API set and according to the statement structure of each online question, generate multiple expanded questions, and store the multiple expanded questions as sample questions in the historical memory pool associated with the intelligent agent.
[0242] In the process of collecting online questions, you can also generate expanded questions based on the sample questions stored in the historical memory pool to enrich the set of sample questions stored in the historical memory pool and provide richer training data for the training process of the question-answering model.
[0243] S603, after obtaining the sample problem set, in each round of iterative training, at least one sample problem is selected from the historical memory pool, denoted as I n , n is a positive integer. In the embodiment of the present application, the problem of selecting multiple samples in each round of iterative training is introduced as an example.
[0244] S604, split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the respective sub-answers of the multiple sub-questions of the query, so as to obtain a question-answering track of the sample question.
[0245] An intelligent agent is used to understand and analyze each sample problem, and the sample problem is automatically split into multiple sub-problems, which are recorded as And automatically decide to call the API matching the sub-question from the API set to obtain the necessary external information as the corresponding sub-answer, denoted as At the same time, the agent can combine the knowledge learned internally to construct a predicted answer with each sub-answer, so as to obtain the question-answering trajectory of each sample question. The question-answering trajectory includes the sample question, each sub-question and its sub-answer, and the predicted answer. In the question-answering trajectory, each sub-question is arranged in the order of questioning, please refer to the above formula (1).
[0246] S605, after obtaining the question-answering track corresponding to at least one sample question, the trained evaluation model can be used to evaluate each question-answering track according to multiple question-answering evaluation strategies to obtain evaluation results corresponding to each of the multiple question-answering evaluation strategies.
[0247] S606, by fusing multiple evaluation results, a comprehensive evaluation value of each question-answering trajectory is obtained.
[0248] Through a variety of question-and-answer evaluation strategies, the response quality of the question-and-answer trajectory is comprehensively evaluated from multiple angles. The multi-dimensional comprehensive evaluation value is used to compensate for the possible limitations of the evaluation model to improve the accuracy of the evaluation.
[0249] S607, sort the question-answering trajectories from large to small according to the comprehensive evaluation value, and select the top k high-quality question-answering trajectories.
[0250] k can be a preset value, or the number of question and answer trajectories whose comprehensive evaluation values determined from each question and answer trajectory are greater than the comprehensive threshold, or a preset proportion of the total number of each question and answer trajectory, etc., without specific limitation.
[0251] S608, determining the occurrence probability of k high-quality question-answer trajectories in each question-answer trajectory, and determining the model training loss.
[0252] When determining the model training loss, the SFT training strategy can be used to train the agent. The agent continuously interacts with the environment and collects new sample problems. Through such an iterative cycle, the performance of the agent gradually improves until it finally stabilizes and reaches the expected convergence state.
[0253] S609: When it is determined that the model training loss has not reached the training target, the model parameters are adjusted and the next round of iterative training is entered.
[0254] S610: When it is determined that the model training loss reaches the training target, a trained target question-answering model is obtained.
[0255] In the embodiment of the present application, there is no need to manually label human interest data, which improves the intelligence level of the training question-answering model, and also achieves 2. Continuous self-evolution performance improvement can be compatible with multiple fields or multiple application scenarios. By using a combination of multiple question-answering evaluation strategies to obtain a comprehensive evaluation value, the evaluation accuracy can be improved, and the evaluation process does not need strong rule dependence, which increases the flexibility and adaptability of the evaluation.
[0256] Based on the same inventive concept, the present application embodiment provides an object analysis method. Figure 1D , the object analysis method provided in the embodiment of the present application is specifically introduced.
[0257] After the target question-answering model is output using the above training method, the target question-answering model can be used to answer questions to implement the corresponding application functions. For example, in the application program interface (API) call scenario, the application function is the analysis function. Please refer to Fig. 7A , which is a flow chart of the object analysis method provided in an embodiment of the present application.
[0258] S701, obtaining a problem to be analyzed for a target object.
[0259] The target objects in different application fields are different, so the problems to be analyzed for the target objects are also different. For example, in the field of psychological analysis, problems to be analyzed for describing behaviors or expressions can be obtained; for example, in the field of short videos, problems to be analyzed for the first video currently being played can be obtained, and so on. There is no specific limitation.
[0260] Using the target question-answering model, execute S702 to S704 for the question to be analyzed:
[0261] S702, split the problem to be analyzed into multiple target sub-problems.
[0262] S703: Calling application program interfaces that match the multiple target sub-problems respectively from the preset multiple application program interfaces to query the target sub-answers of the corresponding target sub-problems.
[0263] The application program interface is used to search for information from the associated application program when it is called. Different application program interfaces are associated with different applications.
[0264] For example, in the field of psychological analysis, the application program interface is, for example, a psychology term query application interface, a psychology case query application interface, or a psychology course application interface, etc., without specific limitation.
[0265] For another example, in the field of short videos, the application program interface may include different short video application interfaces, etc., without any specific limitation.
[0266] S704: Based on the obtained target sub-answers, generate a description text for the target object to obtain an analysis answer to the problem to be analyzed.
[0267] For example, in the field of psychoanalysis, see Figure 7BAfter obtaining the problem to be analyzed for describing the behavior or expression, the target question-answering model can be used to split the problem to be analyzed into multiple target sub-problems (such as including target sub-problem_1, target sub-problem_2, ... target sub-problem_v), and from the corresponding application program interfaces of the preset multiple psychology information query applications (such as including psychology application program interface_1, psychology application program interface_2, ... psychology application program interface_n), the application program interfaces matching the multiple target sub-problems are respectively called to query the target sub-answers of the corresponding target sub-problems (such as including target sub-answer_1, target sub-answer_2 ... target sub-answer_v). The target question-answering model is used to expand the descriptive text of each target sub-answer to obtain the analysis answer for the behavior or expression.
[0268] For another example, in the field of short videos, please refer to Figure 7C , obtain the question to be analyzed for the first video currently being played, and the question to be analyzed is used to indicate the video interest points of the first video for analysis. Using the target question-answering model, the question to be analyzed is split into multiple target sub-questions, and each sub-question is used to indicate a potential interest point in the first video. Potential interest points are, for example, the title, cover, background image, audio content, foreground image, etc. of the first video. From the corresponding application program interfaces of the preset multiple content heat query applications (such as heat query application program interface_1, heat query application program interface_2, ... heat query application program interface_n), the application program interfaces that match the multiple target sub-questions are called respectively to query the heat information of the potential interest points contained in the corresponding target sub-questions as the target sub-answers. The target question-answering model is used to synthesize the target sub-answers to generate the video interest points for the first video, and obtain the second video matching the video interest point from the video database as the analysis answer.
[0269] Based on the same inventive concept, the present application embodiment provides a training device for a question-answering model, which can realize the functions corresponding to the training method for the aforementioned question-answering model. Fig. 8A The device includes an acquisition module 801, a training module 802, a question-answering module 803 and an evaluation module 804, wherein:
[0270] Acquisition module 801: used to acquire a sample question set;
[0271] Training module 802: for performing at least one round of iterative training on the pre-trained question-answering model based on the sample question set, and obtaining a target question-answering model when the model training loss reaches the training target; wherein each round of iterative training includes:
[0272] Question answering module 803: used to use a pre-trained question answering model to split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query;
[0273] Evaluation module 804: for respectively executing, based on a plurality of preset question-answer evaluation strategies: adopting a question-answer evaluation strategy, respectively evaluating the contribution value of each sub-answer of the query when generating a predicted answer, and obtaining an evaluation result;
[0274] The training module 802 is specifically used to: when it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on each sub-answer that the model training loss does not reach the training target, adjust the model parameters of the pre-trained question-answering model.
[0275] In a possible embodiment, the acquisition module 801 is specifically used for:
[0276] Collecting various online questions obtained in response to the input operation;
[0277] Based on the pre-stored interface function descriptions of each query interface, multiple expanded questions are generated according to the sentence structures of each online question; wherein the query interface is used to query data from the associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface; the expanded question is a question that can be answered by calling at least one query interface among the query interfaces;
[0278] A sample question set is established based on each online question and multiple expanded questions.
[0279] In a possible embodiment, the question-answering module 803 is specifically used for:
[0280] Using a pre-trained question-answering model, do the following:
[0281] Based on the text features extracted from the selected sample questions, the sample questions are decomposed into multiple sub-question keywords, and sub-questions corresponding to the multiple sub-question keywords are generated;
[0282] Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the sub-answers of multiple sub-questions of the query are integrated to generate the predicted answer to the sample question.
[0283] In a possible embodiment, the question-answering module 803 is specifically used for:
[0284] Obtaining the interface function description of each pre-stored query interface; wherein the query interface is used to query data from the associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface;
[0285] For multiple sub-questions, respectively: From each query interface, select the target query interface whose interface function description matches the sub-question, and call the target query interface to query the sub-answer of the sub-question;
[0286] Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the obtained sub-answers are integrated to generate the predicted answer to the sample question.
[0287] In a possible embodiment, the question-answering module 803 is specifically used for:
[0288] Extracting question content features from the selected sample questions, and extracting corresponding description content features from the function descriptions of each interface;
[0289] Based on the feature similarity between the question content feature and each description content feature, multiple associated query interfaces related to the sample question are selected from each query interface;
[0290] For multiple sub-questions, respectively execute: from multiple associated query interfaces, select a target query interface whose interface function description matches the selected sub-question, and call the target query interface to query the sub-answers of the sub-questions.
[0291] In a possible embodiment, the question-answering module 803 is specifically used for:
[0292] Extracting semantic features of sub-questions and extracting semantic features of interface function description of target query interface;
[0293] Based on the difference between the obtained question semantic features and the description semantic features, the calling frequency of the target query interface is determined;
[0294] The target query interface is called cyclically based on the calling frequency to query the sub-question, query data returned by the target query interface after each call is obtained, and a sub-answer is generated based on at least one query data obtained.
[0295] In a possible embodiment, multiple question-answering evaluation strategies are determined based on at least two of the following data:
[0296] The query efficiency or query success rate of the sub-answers of multiple sub-questions;
[0297] The answer logic represented by the answer trajectory formed by multiple sub-questions and their sub-answers;
[0298] Preset standard questions and their standard evaluation results, as well as multiple standard sub-questions and their standard sub-answers derived from the standard questions;
[0299] The scenario constraint information preset in the application scenario involved in the sample problem.
[0300] In a possible embodiment, the evaluation module 804 is specifically used for:
[0301] Establish a question-answering track based on sample questions, multiple sub-questions and their sub-answers, and predicted answers;
[0302] Combine multiple preset question-answering evaluation strategies and question-answering trajectories to establish evaluation tasks corresponding to each of the multiple question-answering evaluation strategies;
[0303] The trained evaluation model is used to execute the obtained multiple evaluation tasks respectively, wherein the execution process of each evaluation task includes:
[0304] Based on the corresponding question-answer evaluation strategy, the contribution value of each sub-answer in the question-answer trajectory when generating the predicted answer is evaluated to obtain the evaluation result.
[0305] In a possible embodiment, the training module 802 is specifically used for:
[0306] Fusion of multiple evaluation results to obtain a comprehensive evaluation value;
[0307] When the comprehensive evaluation value is greater than the evaluation threshold, the probability of generating a predicted answer by querying each sub-answer as a target answer process in the process of generating a predicted answer from a sample question using multiple reference answers is determined;
[0308] When it is determined based on the obtained answer probabilities that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
[0309] In a possible embodiment, when the sample problems selected for each round of iterative training are multiple sample problems, the training module 802 is specifically used to:
[0310] For multiple sample questions, respectively: based on the sample question, multiple sub-questions split from the sample question and the sub-answers of the corresponding query, and the predicted answer generated by the sample question, establish the question-answering track corresponding to the sample question;
[0311] Taking the question-answering trajectories whose corresponding evaluation results meet the training screening conditions as the preferred question-answering trajectories, and when it is determined that the model training loss does not reach the training target, obtaining at least one preferred question-answering trajectory from the question-answering trajectories corresponding to the multiple sample questions;
[0312] Based on the occurrence probability of at least one preferred question-answering trajectory in the multiple question-answering trajectories, a model parameter of the pre-trained question-answering model is adjusted.
[0313] Based on the same inventive concept, the present application embodiment provides an object analysis device that can implement the functions corresponding to the aforementioned object analysis method. Figure 8B , the device comprises an acquisition module 81 and a processing module 82, wherein:
[0314] Acquisition module 81: used to acquire the problem to be analyzed for the target object;
[0315] Processing module 82: for using the target question answering model trained by the method of the first aspect to perform the following operations on the question to be analyzed:
[0316] The processing module 82 is specifically used to: split the problem to be analyzed into multiple target sub-problems;
[0317] The processing module 82 is specifically used to: respectively call the application program interfaces that match the multiple target sub-questions from the preset multiple application program interfaces, and query the target sub-answers of the corresponding target sub-questions; wherein the application program interface is used to search for information from the associated application program when called; different application program interfaces are associated with different applications;
[0318] The processing module 82 is specifically used to generate a description text for the target object based on each target sub-answer obtained, and obtain an analysis answer to the problem to be analyzed.
[0319] Please refer to Fig. 9 , is a computer device 900 provided in an embodiment of the present application, and the computer device 900 can be, for example, Figure 1D The client 101 or the server 102 in the data storage program. The current version and the historical version of the data storage program and the application software corresponding to the data storage program can be installed on the computer device 900, and the computer device 900 includes a processor 980 and a memory 920. In some embodiments, the computer device 900 may include a display unit 940, and the display unit 940 includes a display panel 941 for displaying a user interactive operation interface, etc.
[0320] In a possible embodiment, the display panel 941 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0321] The processor 980 is used to read the computer program and then execute the method defined by the computer program. For example, the processor 980 reads the data storage program or file, so as to run the data storage program on the computer device 900 and display the corresponding interface on the display unit 940. The processor 980 may include one or more general-purpose processors and may also include one or more DSPs (Digital Signal Processors) to perform related operations to implement the technical solutions provided in the embodiments of the present application.
[0322] The memory 920 generally includes internal memory and external memory, and the internal memory may be a random access memory (RAM), a read-only memory (ROM), and a cache (CACHE), etc. The external memory may be a hard disk, an optical disk, a USB disk, a floppy disk, or a tape drive, etc. The memory 920 is used to store computer programs and other data, and the computer program includes applications corresponding to each client, etc. Other data may include data generated after the operating system or application is run, and the data includes system data (such as configuration parameters of the operating system) and user data. In the embodiment of the present application, the computer program is stored in the memory 920, and the processor 980 executes the computer program in the memory 920 to implement any of the methods discussed in the previous figure.
[0323] The display unit 940 is used to receive input digital information, character information or contact touch operation / contactless gesture, and generate signal input related to user settings and function control of the computer device 900. Specifically, in the embodiment of the present application, the display unit 940 may include a display panel 941. The display panel 941 is, for example, a touch screen, which can collect user touch operations on or near it (such as operations performed by the user using fingers, stylus, or any other suitable object or accessory on or on the display panel 941), and drive corresponding connection devices according to a pre-set program.
[0324] In a possible embodiment, the display panel 941 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the player, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 980, and can receive and execute the command sent by the processor 980.
[0325] The display panel 941 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 940, in some embodiments, the computer device 900 may further include an input unit 930, which may include an image input device 931 and other input devices 932, wherein the other input devices may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0326] In addition to the above, the computer device 900 may also include a power supply 990 for supplying power to other modules, an audio circuit 960, a near field communication module 970, and an RF circuit 910. The computer device 900 may also include one or more sensors 950, such as an acceleration sensor, a light sensor, a pressure sensor, etc. The audio circuit 960 specifically includes a speaker 961 and a microphone 962, etc. For example, the computer device 900 can collect the user's voice through the microphone 962 to perform corresponding operations, etc.
[0327] As an embodiment, the number of processors 980 may be one or more, and the processor 980 and the memory 920 may be coupled or relatively independently configured.
[0328] As an example, Fig. 9 The processor 980 in the embodiment can be used to implement the following Fig. 8A The functions of the acquisition module 801, the training module 802, the question-answering module 803 and the evaluation module 804 in Figure 8B The functions of the acquisition module 81 and the processing module 82.
[0329] As an example, Fig. 9 The processor 980 in can be used to implement the corresponding functions of the server or terminal device discussed above.
[0330] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by a computer program, and the aforementioned computer program can be stored in a computer-readable storage medium. When the computer program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0331] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, for example, through a computer program product, which is stored in a storage medium, including a computer program for a computer device to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0332] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A training method for a question-answering model, characterized in that: include: Get a sample set of questions; Based on the sample question set, the pre-trained question-answering model is trained for at least one round of iterative training, and when it is determined that the model training loss reaches the training target, a target question-answering model is obtained; wherein each round of iterative training includes: Using the pre-trained question-answering model, split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query; Based on the preset multiple question-answering evaluation strategies, respectively executing: using a question-answering evaluation strategy, respectively evaluating the contribution value of each sub-answer of the query when generating the predicted answer, and obtaining an evaluation result; When it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on the sub-answers that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
2. The method according to claim 1, characterized in that The obtaining of the sample question set comprises: Collecting various online questions obtained in response to the input operation; Based on the pre-stored interface function descriptions of each query interface, multiple expanded questions are generated according to the sentence structures of each online question; wherein the query interface is used to query data from an associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface; the expanded question is a question that can be answered by calling at least one query interface among the query interfaces; The sample question set is established based on the online questions and the multiple expanded questions.
3. The method according to claim 1, characterized in that The pre-trained question-answering model is used to split the selected sample question into multiple sub-questions, and based on the sub-answers of the multiple sub-questions of the query, a predicted answer to the sample question is generated, including: Using the pre-trained question-answering model, perform the following operations: Based on the text features extracted from the selected sample question, the sample question is decomposed into a plurality of sub-question keywords, and sub-questions corresponding to the plurality of sub-question keywords are generated; Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the sub-answers of the multiple sub-questions of the query are integrated to generate a predicted answer to the sample question.
4. The method according to claim 3, characterized in that The method of integrating the sub-answers of the plurality of sub-questions of the query based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model to generate the predicted answer to the sample question includes: Obtaining the interface function description of each pre-stored query interface; wherein the query interface is used to query data from the associated database when called; databases associated with different query interfaces store data related to different fields; the interface function description is used to describe at least one query function provided by the corresponding query interface; For the multiple sub-questions, respectively: selecting a target query interface whose interface function description matches the sub-question from the query interfaces, and calling the target query interface to query the sub-answers of the sub-questions; Based on the learned knowledge base represented by the model parameters of the pre-trained question-answering model, the obtained sub-answers are integrated to generate a predicted answer to the sample question.
5. The method according to claim 4, characterized in that The method of performing, for each of the plurality of sub-questions, respectively: selecting a target query interface whose interface function description matches the sub-question from each query interface, and calling the target query interface to query the sub-answers of the sub-question, includes: Extracting question content features from the selected sample questions, and extracting corresponding description content features from the function descriptions of each interface; Based on the feature similarity between the question content feature and each description content feature, selecting a plurality of associated query interfaces related to the sample question from the query interfaces; For the multiple sub-questions, respectively: selecting a target query interface whose interface function description matches the selected sub-question from the multiple associated query interfaces, and calling the target query interface to query the sub-answers of the sub-questions.
6. The method according to claim 4 or 5, characterized in that: The calling of the target query interface to query the sub-answer of the sub-question includes: Extracting the problem semantic features of the sub-problem, and extracting the description semantic features of the interface function description of the target query interface; Determining the calling frequency of the target query interface based on the difference between the obtained question semantic features and the description semantic features; The target query interface is cyclically called based on the calling frequency to query the sub-question, query data returned by the target query interface after each call is obtained, and a sub-answer is generated based on at least one query data obtained.
7. The method according to any one of claims 1 to 5, characterized in that: The multiple question-answering evaluation strategies are determined based on at least two of the following data: The query efficiency or query success rate of the sub-answers of each of the multiple sub-questions; The answer logic represented by the answer track formed by the multiple sub-questions and their sub-answers; Preset standard questions and their standard evaluation results, as well as multiple standard sub-questions and their standard sub-answers derived from the standard questions; The sample problem involves scenario constraint information preset in the application scenario.
8. The method according to any one of claims 1 to 5, characterized in that: The preset multiple question-answer evaluation strategies are respectively executed: using a question-answer evaluation strategy to respectively evaluate the contribution value of each sub-answer of the query when generating the predicted answer, and obtaining an evaluation result, including: Establishing a question-answering track based on the sample question, the multiple sub-questions and their sub-answers, and the predicted answer; Respectively combining a plurality of preset question-answering evaluation strategies with the question-answering track to establish evaluation tasks corresponding to the plurality of question-answering evaluation strategies; The trained evaluation model is used to execute the obtained multiple evaluation tasks respectively, wherein the execution process of each evaluation task includes: Based on the corresponding question-and-answer evaluation strategy, the contribution value of each sub-answer in the question-and-answer trajectory in generating the predicted answer is evaluated to obtain an evaluation result.
9. The method according to any one of claims 1 to 5, characterized in that: When the multiple evaluation results obtained by determining satisfy the training screening condition, and when the model training loss determined based on each sub-answer does not reach the training target, adjusting the model parameters of the pre-trained question-answering model, including: Fusion of multiple evaluation results to obtain a comprehensive evaluation value; When the comprehensive evaluation value is greater than the evaluation threshold, determining the probability of generating the predicted answer by querying each sub-answer as the target answer process in the process of generating the predicted answer from the sample question using multiple reference answers; When it is determined based on the obtained answer probability that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
10. The method according to any one of claims 1 to 5, characterized in that: When the sample questions selected for each round of iterative training are multiple sample questions, when the multiple evaluation results obtained are determined to meet the training screening conditions, when the model training loss determined based on each sub-answer does not reach the training target, adjusting the model parameters of the pre-trained question-answering model includes: For the multiple sample questions, respectively performing: based on the sample questions, the multiple sub-questions split from the sample questions and the sub-answers of the corresponding queries, and the predicted answers generated by the sample questions, establishing a question-answering track corresponding to the sample questions; Taking the question-answering tracks whose corresponding evaluation results meet the training screening conditions as the preferred question-answering tracks, and obtaining at least one preferred question-answering track among the question-answering tracks corresponding to each of the plurality of sample questions; When it is determined based on the occurrence probability of the at least one preferred question-answering trajectory in the multiple question-answering trajectories that the model training loss does not reach the training target, the model parameters of the pre-trained question-answering model are adjusted.
11. An object analysis method, characterized in that: include: Obtain the problems to be analyzed for the target object; The target question answering model trained by the method according to any one of claims 1 to 10 is used to perform the following operations on the question to be analyzed: Splitting the problem to be analyzed into multiple target sub-problems; From a plurality of preset application program interfaces, respectively calling application program interfaces that match the plurality of target sub-questions, and querying the target sub-answers of the corresponding target sub-questions; wherein the application program interfaces are used to search for information from the associated application program when called; and different application program interfaces are associated with different applications; Based on the obtained sub-answers to each target, a description text for the target object is generated to obtain an analytical answer to the problem to be analyzed.
12. A training device for a question-answering model, characterized in that: include: Acquisition module: used to obtain sample question sets; Training module: used to perform at least one round of iterative training on the pre-trained question-answering model based on the sample question set, and obtain the target question-answering model when the model training loss reaches the training target; wherein each round of iterative training includes: Question answering module: used to use the pre-trained question answering model to split the selected sample question into multiple sub-questions, and generate a predicted answer to the sample question based on the sub-answers of the multiple sub-questions of the query; Evaluation module: used for respectively executing, based on a plurality of preset question-answer evaluation strategies: adopting a question-answer evaluation strategy, respectively evaluating the contribution value of each sub-answer of the query when generating the predicted answer, and obtaining an evaluation result; The training module is specifically used to: when it is determined that the multiple evaluation results obtained meet the training screening conditions, and when it is determined based on the sub-answers that the model training loss does not reach the training target, adjust the model parameters of the pre-trained question-answering model.
13. An object analysis device, characterized in that: include: Acquisition module: used to obtain the problem to be analyzed for the target object; Processing module: used to use the target question answering model trained by the method according to any one of claims 1 to 10 to perform the following operations on the question to be analyzed: The processing module is specifically used to: split the problem to be analyzed into multiple target sub-problems; The processing module is specifically used to: respectively call the application program interfaces that match the multiple target sub-questions from the preset multiple application program interfaces, and query the target sub-answers of the corresponding target sub-questions; wherein the application program interfaces are used to search for information from the associated application programs when called; and different application program interfaces are associated with different applications; The processing module is specifically used to: generate a description text for the target object based on each target sub-answer obtained, and obtain an analysis answer to the problem to be analyzed.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
15. A computer device, characterized in that: include: A memory for storing program instructions; The processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 11 according to the obtained program instructions.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 11.
Citation Information
Cited By
Model training method and device, storage medium and computer equipment
CN119988985A
Medical big language model training and reasoning method and device, equipment and medium
CN120046736A
Question and answer model training method and question and answer task processing method
CN120744074A