Target answer generation method and device, storage medium and electronic device

By adjusting the parameters of the question-answering model and optimizing the model using training data from specific scenarios, the problem of low matching accuracy of the question-answering robot when faced with unexpected questions was solved. This enabled flexible and accurate answer generation in specific scenarios, reducing manpower costs and improving productivity.

CN116644167BActive Publication Date: 2026-06-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-05-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing question-answering robots struggle to provide effective answers to unexpected questions posed by users, resulting in a low degree of match between the generated target answer and the question.

Method used

By inputting the reference question information and answer information of the initial question-answering model into the target scoring model, adjusting the parameters of the question-answering model, and generating the target question-answering model, the model is optimized by ensuring that the generated answer matches the question better than the target match. The model is then optimized using the training data of the large language model in a specific scenario and the answer quality scoring model.

Benefits of technology

It improves the matching accuracy between the answers generated by the question-answering robot and the questions, enabling it to provide flexible and accurate answers in specific scenarios, reducing manpower costs and increasing productivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116644167B_ABST
    Figure CN116644167B_ABST
Patent Text Reader

Abstract

The application discloses a target answer generation method and device, a storage medium and an electronic device. It relates to the field of financial technology. The method comprises the following steps: inputting reference question information of an initial question and answer model and reference answer information output by the initial question and answer model according to the reference question information into a target scoring model to obtain reference question and answer parameters output by the target scoring model; adjusting model parameters of the initial question and answer model according to the reference question and answer parameters to obtain a target question and answer model, wherein the target question and answer model is used to output corresponding second answer information for input second question information, and the matching degree of the second answer information and the second question information is greater than a target matching degree; and generating target answer information corresponding to target question information in a target scene by using the target question and answer model when the target question information is received. Through the application, the problem that the matching degree of the generated target answer and the corresponding question is low in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a method and apparatus for generating a target answer, a storage medium, and an electronic device. Background Technology

[0002] In recent years, with the rapid development of computer technology, more and more companies are choosing to introduce more automated processes into their business systems or internal office systems, such as intelligent customer service robots and technical Q&A robots, to reduce labor costs and improve productivity.

[0003] Currently, mainstream question-answering robots still use relatively traditional methods, such as building knowledge bases to query specific questions or answering according to pre-set human rules. However, the generated answers are relatively fixed. Existing question-answering robot methods work reasonably well for some pre-designed questions, but they often struggle to provide effective answers to unexpected questions posed by users.

[0004] There is currently no effective solution to the problem that the target answer generated by related technologies has a low matching degree with the corresponding question. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, storage medium, and electronic device for generating target answers, in order to solve the problem that the generated target answers have a low degree of matching with the corresponding questions in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a method for generating a target answer is provided.

[0007] The method includes:

[0008] The reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is a first question information and a first answer information with a corresponding relationship collected in the target scene.

[0009] The model parameters of the initial question-answering model are adjusted according to the reference question-answering parameters to obtain the target question-answering model. The target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree.

[0010] Upon receiving target question information from the target scenario, the target question-answering model is used to generate target answer information corresponding to the target question information.

[0011] Optionally, the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answering parameters output by the target scoring model, including:

[0012] The reference question information and the reference answer information are concatenated into a question-answer pair;

[0013] The question-answer pair is input into the target scoring model, and the question-answer parameters output by the target scoring model are used as the reference question-answer parameters.

[0014] Optionally, before inputting the question-answer pair into the target scoring model to obtain the question-answer parameters output by the target scoring model as the reference question-answer parameters, the method further includes:

[0015] Obtain a set of candidate parameter groups corresponding to the target scene, wherein the set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2. Each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters that have a corresponding relationship. The candidate question information in the candidate question information set is used to represent a candidate question in the target scene. The candidate answer information in the candidate answer information set is used to represent a candidate answer to the candidate question. The candidate question-answer parameters in the candidate question-answer parameter set are used to represent the degree of matching between the candidate answer and the candidate question. The candidate question information included in the candidate question information sets in different candidate parameter groups is used to describe different types of questions, and the candidate question information included in the candidate question information sets in the same candidate parameter group is used to describe the same type of questions.

[0016] N question-answer pairs labeled with the first question-answer parameters are generated based on the candidate parameter set;

[0017] The initial scoring model is trained using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model.

[0018] Optionally, generating N question-answer pairs labeled with the first question-answer parameters based on the candidate parameter set includes:

[0019] The candidate question information, candidate answer information, and candidate question-answer parameters that are in the same candidate parameter group in the candidate parameter group set are freely combined to obtain N combinations, wherein each combination includes 1 candidate question information, 1 candidate answer information, and 1 candidate question-answer parameter;

[0020] The candidate question information in the same combination among N combinations is taken as the first question information, the candidate answer information is taken as the corresponding first answer information, and the candidate question-answer parameters are taken as the first question-answer parameters, thus obtaining N question-answer pairs labeled with the first question-answer parameters.

[0021] Optionally, obtaining the set of candidate parameter groups corresponding to the target scene includes:

[0022] M target work orders are collected from the target scenario, where M is a positive integer greater than or equal to 2. The target work orders are used to record the questions, answers and question-answer parameters that have corresponding relationships in the target scenario.

[0023] Generate a set of candidate parameter groups corresponding to the target scenario based on M target work orders.

[0024] Optionally, generating a set of candidate parameter groups corresponding to the target scenario based on the M target work orders includes:

[0025] Extract the corresponding question text, answer text, and rating text from each of the M target work orders. The question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question.

[0026] The candidate question information is extracted from the question text of each target work order record, the candidate answer information is extracted from the answer text of each target work order record, and the candidate question-and-answer parameters are extracted from the rating text of each target work order record, to obtain M sets of candidate question information, candidate answer information and candidate question-and-answer parameters with corresponding relationships;

[0027] For the M groups of candidate question information that have a corresponding relationship, the candidate answer information and the M candidate question information in the candidate question and answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question;

[0028] Obtain the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each candidate question information set, and obtain the candidate answer information set and candidate question-answer parameter set corresponding to each candidate question information set;

[0029] A set of candidate question information, candidate answer information, and candidate question-answer parameter set that have a corresponding relationship is determined as a candidate parameter group, and the candidate parameter group set is obtained, where R is a positive integer greater than or equal to T.

[0030] Optionally, training the initial scoring model using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model includes:

[0031] The following steps are used to train the scoring model to be trained in the p-th round using the i-th question and answer labeled with the first question and answer parameters, where p is a positive integer greater than or equal to 1:

[0032] The training model obtained through the (p-1)th round of training outputs the question-answer parameter results of the i-th question-answer pair, wherein when p equals 1, the training model obtained through the (p-1)th round of training is the initial scoring model that has not been trained.

[0033] By comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained;

[0034] If the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the training scoring model obtained in the (p-1)th training round are adjusted to obtain the training scoring model obtained in the pth training round.

[0035] Training ends when the value of the target loss function satisfies the preset convergence condition.

[0036] To achieve the above objectives, according to another aspect of this application, an apparatus for generating a target answer is provided.

[0037] The device includes:

[0038] The output module is used to input the reference question information of the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is the first question information and the first answer information collected in the target scene that have a corresponding relationship.

[0039] An adjustment module is used to adjust the model parameters of the initial question-answering model according to the reference question-answering parameters to obtain a target question-answering model, wherein the target question-answering model is used to output corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree;

[0040] The generation module is used to generate target answer information corresponding to the target question information using the target question answering model when receiving target question information in the target scenario.

[0041] This application employs the following method: Upon receiving target question information from a target scenario, a target question-answering model is used to generate target answer information corresponding to the target question information. A target scoring model participates in the training process of the target question-answering model. During the training of the initial question-answering model, reference question information input to the initial question-answering model and reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain reference question-answer parameters output by the target scoring model. The model parameters of the initial question-answering model are then adjusted based on these reference question-answer parameters to obtain the target question-answering model. Since the target scoring model uses N questions labeled with the first question-answer parameters... The training process yields a pair of questions and answers, where N is a positive integer greater than or equal to 2. Each question-and-answer pair consists of the first question and the first answer collected from the target scenario, representing a corresponding relationship. Therefore, the target scoring model can determine the degree of matching between the reference question information input to the initial question-and-answer model and the reference answer information output by the initial model based on the reference question information—that is, the reference question-and-answer parameters. Adjusting the initial question-and-answer model based on these parameters ensures that the target answer information generated from the target question information matches the target question information better than the target matching degree. This solves the problem of low matching degree between the generated target answer and the corresponding question in related technologies, thus achieving the technical effect of improving the matching degree between the generated target answer and the corresponding question. Attached Figure Description

[0042] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0043] Figure 1 This is a flowchart of a method for generating a target answer according to an embodiment of this application;

[0044] Figure 2 This is a flowchart of a method for generating a target question-answering model according to an embodiment of this application;

[0045] Figure 3 This is a schematic diagram illustrating basic data collection for an enterprise scenario based on an embodiment of this application;

[0046] Figure 4 This is a schematic diagram illustrating the generation of reference question-and-answer parameters according to the embodiments of this application;

[0047] Figure 5 This is a schematic diagram illustrating the generation of question-and-answer pairs according to an embodiment of this application;

[0048] Figure 6 This is a schematic diagram of the work order process provided according to the embodiments of this application;

[0049] Figure 7 This is a schematic diagram illustrating the generation of candidate question information, candidate answer information, and candidate question-answer parameters for a target work order based on the embodiments of this application.

[0050] Figure 8 This is a schematic diagram generated based on the candidate question information set, candidate answer information set, and candidate question-answer parameter set provided in the embodiments of this application;

[0051] Figure 9 This is a schematic diagram of a target answer generation apparatus according to an embodiment of this application;

[0052] Figure 10 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0053] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0057] Large Language Model (LLM) refers to a neural network model with an extremely large number of network parameters used in the field of natural language processing.

[0058] Embedding: Word embedding refers to transforming the original word representation into a vector representation. There are many types of embedding methods; the embedding used in this patent is a general term and does not require specifying any particular method.

[0059] SIF (Solidified Average Word Vector): This method calculates the vector representation of the entire sentence by converting the words in the sentence into word vectors through embedding. This method can transform sentences of variable length into vector representations of equal length.

[0060] KNN clustering: an unsupervised clustering method that can group data with similar features into one class.

[0061] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a method for generating a target answer according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0062] Step S101: Input the reference question information of the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is the first question information and the first answer information collected in the target scene that have a corresponding relationship.

[0063] Step S102: Adjust the model parameters of the initial question-answering model according to the reference question-answering parameters to obtain the target question-answering model. The target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree.

[0064] Step S103: Upon receiving the target question information in the target scenario, the target question-answering model is used to generate the target answer information corresponding to the target question information.

[0065] Using the above method, upon receiving target question information from the target scenario, a target question-answering model is used to generate target answer information corresponding to the target question information. The target scoring model participates in the training process of the target question-answering model. During the training of the initial question-answering model, the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The model parameters of the initial question-answering model are then adjusted based on the reference question-answer parameters to obtain the target question-answering model. Since the target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters... The training process involves N being a positive integer greater than or equal to 2. Each question-answer pair consists of the first question and the first answer information collected from the target scenario, which have a corresponding relationship. Therefore, the target scoring model can determine the degree of matching between the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information, i.e., the reference question-answering parameters. Adjusting the initial question-answering model according to the reference question-answering parameters to obtain the target question-answering model ensures that the degree of matching between the target answer information generated based on the target question information and the target question information is greater than the target matching degree. This solves the problem of low matching degree between the generated target answer and the corresponding question in related technologies. Thus, it achieves the technical effect of improving the matching degree between the generated target answer and the corresponding question.

[0066] In the technical solution provided in step S101 above, the target question-answering model can be applied to various terminal devices in the target scenario, including but not limited to customer service robots, technical Q&A robots, etc., to reduce manpower costs and improve productivity.

[0067] Optionally, in this embodiment, the target question-answering model may be, but is not limited to, a large language model. The large language model is a large language model with generative capabilities. It does not need to be a specific model. The target question-answering model has strong generation and creation capabilities and can generate corresponding answers based on specific questions rather than fixed templates or formulaic responses.

[0068] Optionally, in this embodiment, unlike ordinary large language models, the target question-answering model in this application can not only handle some general tasks, such as article comprehension and code generation, but more importantly, it can be put into practical application in a specific target scenario. The target scenario can include, but is not limited to, any scenario with specific technology or needs, such as enterprise scenarios, teaching scenarios, and shopping scenarios. For example, in enterprise scenarios, due to the different businesses of enterprises, the technologies involved also vary greatly. Therefore, ordinary large language models do not have knowledge of the specific business domain of enterprises and cannot answer the questions that arise in the above-mentioned highly professional enterprise scenarios. Therefore, ordinary large language models are difficult to put into practical application.

[0069] Optionally, in this embodiment, the target question-answering model differs from ordinary large language models in that it can be applied in a specific target scenario because it is trained through the following process. The generation method of the target question-answering model can be explained using, but is not limited to, an enterprise scenario as an example. Figure 2 This is a flowchart of a method for generating a target question-answering model according to an embodiment of this application, such as... Figure 2 As shown, it includes the following steps:

[0070] 1) Basic data collection for enterprise scenarios;

[0071] 2) Preliminary optimization of the large language model (corresponding to the initial question-answering model mentioned above);

[0072] 3) Collect training data for the answer quality scoring model (corresponding to the target scoring model above), and use the collected training data to train the answer quality scoring model;

[0073] 4) Training the answer quality scoring model and final tuning of the large language model.

[0074] in, Figure 3 This is a schematic diagram illustrating basic data collection for an enterprise scenario based on an embodiment of this application, such as... Figure 3 As shown, enterprise documents are collected that require the robot's (which can be understood as the target question-answering model, or a terminal deployed by the aforementioned target question-answering model) support in relevant fields (which can be understood as the corresponding technical fields in each enterprise scenario, such as financial technology for financial enterprises, and computer technology for IT (Information Technology) enterprises), and then split into paragraphs. The reason for using paragraphs instead of sentences in this step is that large language models can better capture the logical relationships in context compared to traditional NLP (Natural Language Processing) models, and when facing complex scenarios in actual enterprise applications, the model also needs the ability to extract knowledge from more textual information. After splitting into paragraphs, let the paragraph be P, and the length of the paragraph after word segmentation be L. Randomly replace N words in the paragraph with whitespace characters, where N can be 15% * L (rounded up), and let the replaced paragraph be P'. Then (P, P') is a set of training data. For example, the original paragraph reads: "This business targets general customers." Randomly replacing N words in the paragraph with blank characters (i.e., masking the original paragraph) yields the replaced paragraph: "This business targets XXXX." Multiple sets of training data can be randomly sampled from each paragraph; the specific values ​​can be adjusted based on the total text volume of the document. Subsequently, the collected data is used to predict words generated from blank characters for the initial training of the large language model. This training step aims to give the large language model a basic understanding of the enterprise-related domain. The trained large language model at this stage corresponds to the initial question-answering model in this application, while the final optimized large language model corresponds to the target question-answering model in this application.

[0075] In one exemplary embodiment, the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information can be input to the target scoring model in the following manner, to obtain the reference question-answer parameters output by the target scoring model: concatenating the reference question information and the reference answer information into a question-answer pair; inputting the question-answer pair into the target scoring model to obtain the question-answer parameters output by the target scoring model as the reference question-answer parameters.

[0076] Optionally, in this embodiment, the reference answer information and reference question information can be represented in vector form. For example, the reference answer information can be an answer vector. The reference problem information can be a problem vector. Question-answer pairs can be represented as answer vectors. and problem vector The concatenated vector.

[0077] Optionally, in this embodiment, Figure 4 This is a schematic diagram illustrating the generation of reference question-and-answer parameters according to embodiments of this application, such as... Figure 4 As shown, the problem vector (Corresponding to the reference question information above), the input is fed into the initially optimized large language model (corresponding to the initial question-answering model above, or the question-answering model to be trained), and the answer vector output by the large language model is obtained. (Corresponding to the above reference answer information), then, the question vector and answer vector The questions and answers are concatenated into question-answer pairs and resized to fit the input shape of a ResNet (residual neural network). The output is a single-class classification. The question-answer pairs are then input into the target scoring model, and the label of the output probability of the target scoring model is the corresponding score s (corresponding to the reference question-answer parameters mentioned above) for the corresponding question-answer pair. Since all processes are differentiable, end-to-end training can be performed directly using backpropagation. That is, the model parameters of the current large language model can be adjusted according to the current reference question-answer parameters. The target scoring model can be, but is not limited to, a ResNet-128 classification model.

[0078] In an exemplary embodiment, before inputting the question-answer pair into the target scoring model and obtaining the question-answer parameters output by the target scoring model as the reference question-answer parameters, the method may include, but is not limited to, the following: obtaining a set of candidate parameter groups corresponding to the target scenario, wherein the set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2, and each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships, wherein the candidate question information in the set of candidate question information is used to characterize a candidate question in the target scenario, and the candidate answer information... The candidate answer information in the set is used to represent the candidate answers to the candidate questions, and the candidate question-answer parameters in the candidate question-answer parameter set are used to represent the degree of matching between the candidate answers and the candidate questions. The candidate question information sets in different candidate parameter groups are used to describe different types of questions, and the candidate question information sets in the same candidate parameter group are used to describe the same type of questions. N question-answer pairs labeled with the first question-answer parameters are generated according to the candidate parameter group set. The initial scoring model is trained using the N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model.

[0079] Optionally, in this embodiment, the reference answer information and reference question information described above can be represented in vector form. For example, the reference answer information can be an answer vector. The reference problem information can be a problem vector. Question-answer pairs can be represented as answer vectors. and problem vector The concatenated vector. Similarly, in this application, question information (e.g., candidate question information, first question information, second question information, etc.) and answer information (e.g., candidate answer information, first answer information, second answer information, etc.) can all be expressed in vector form. The following describes the possible representations of the candidate parameter set, candidate parameter set, candidate question information set, and candidate answer information set, respectively:

[0080] Candidate question information set: The candidate question information set includes m candidate question information. Used to describe the same type of problem;

[0081] Candidate answer information set: The candidate answer information set includes m candidate answer information. Used to describe the answers to questions of the same type mentioned above;

[0082] Candidate question-answering parameter set: (s1,s2,…,s) m );

[0083] Candidate parameter groups: (s1,s2,…,s m ), where m is the total number of problems in the subclass, and t represents the index of the problem class. This can be understood as follows: for example, if there are 100 types of problems in an enterprise scenario, the candidate parameter set can include 100 candidate parameter sets, each corresponding to one type of problem. When t is 95, the candidate parameter sets contain... Both can be used to describe this type of problem (Class 95), and Both can be used to answer this type 95 question, and the degree of matching is greater than the target degree of matching.

[0084] In an exemplary embodiment, N question-answer pairs labeled with the first question-answer parameter can be generated based on the candidate parameter set in the following manner, but not limited to: freely combining the candidate question information, the candidate answer information, and the candidate question-answer parameter in the same candidate parameter set to obtain N combinations, wherein each combination includes one candidate question information, one candidate answer information, and one candidate question-answer parameter; taking the candidate question information in the same combination among the N combinations as the first question information, the candidate answer information as the corresponding first answer information, and the candidate question-answer parameter as the first question-answer parameter, to obtain N question-answer pairs labeled with the first question-answer parameter.

[0085] Optionally, in this embodiment, the candidate parameter group is: (s1, s2, ..., s4) describes the generation process of the N question-answer pairs labeled with the first question-answer parameters. Figure 5 This is a schematic diagram of question-and-answer pair generation according to the embodiments of this application, such as... Figure 5 As shown, and Each element can form a question-answer pair, and there are a total of 16 question-answer pairs in permutation and combination. Then, a candidate question-answer parameter is randomly selected from (s1,s2,...,s4) as the first question-answer parameter to label the question-answer pair, resulting in 16 question-answer pairs labeled with the first question-answer parameter.

[0086] In an exemplary embodiment, the candidate parameter set corresponding to the target scenario can be obtained, but is not limited to, by means of the following: collecting M target work orders from the target scenario, where M is a positive integer greater than or equal to 2, the target work orders being used to record questions, answers, and question-and-answer parameters that have corresponding relationships in the target scenario; and generating the candidate parameter set corresponding to the target scenario based on the M target work orders.

[0087] It's important to note that while existing question-answering robots (which can be understood as target question-answering models, or terminals deployed with the aforementioned target question-answering models) perform reasonably well with some pre-designed questions, they often struggle to provide effective answers to unexpected user questions. This is especially true for follow-up questions from customers, as the robots lack contextual understanding and therefore cannot generate the desired answers. On the other hand, ordinary large language models, lacking relevant scenario-based data (corresponding to the 16 question-answer pairs annotated with the first question-answering parameter), often struggle to be applied in practice. This is because large language models require high-quality and high-quantity training data. Manually collecting and annotating data is time-consuming and labor-intensive, and data quality can be subjectively influenced by the annotators, leading to suboptimal training results. However, without training with large language models, general-purpose models lack the knowledge specific to the enterprise's business domain and cannot provide effective assistance. To address the difficulty in obtaining samples during the training of the aforementioned target question-answering and target rating models, this application proposes a method for automatically generating a large amount of high-quality labeled training data. This enables the trained robot (with the target question-answering model deployed) to provide satisfactory answers to users even in specific enterprise scenarios (corresponding to the aforementioned target scenarios).

[0088] Optionally, in this embodiment, in an enterprise environment, a complete work order process should include three parts: problem statement, problem answer, and feedback rating. Therefore, a work order that has completed its task (corresponding to the target work order) should record the problem, answer, and rating in the work order process.

[0089] Optionally, in this embodiment, the target work order can also generate training data for similar systems within the enterprise environment, recording corresponding questions, answers, and question-and-answer parameters.

[0090] In an exemplary embodiment, a set of candidate parameter groups corresponding to the target scenario can be generated based on M target work orders in the following manner, but not limited to: extracting the corresponding question text, answer text, and rating text from each of the M target work orders, wherein the question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question; extracting candidate question information from the question text recorded in each target work order, extracting candidate answer information from the answer text recorded in each target work order, and extracting candidate question-answer parameters from the rating text recorded in each target work order, thereby obtaining M sets of corresponding candidate question information. The process involves selecting answer information and candidate question-answer parameters; for M groups of candidate question information with corresponding relationships, the M candidate question information in the candidate answer information and candidate question-answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question; obtaining the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each set of candidate question information, thus obtaining the set of candidate answer information and the set of candidate question-answer parameters corresponding to each set of candidate question information; determining a set of candidate question information, candidate answer information, and candidate question-answer parameters with corresponding relationships as a set of candidate parameters, thus obtaining the set of candidate parameter sets, wherein R is a positive integer greater than or equal to T.

[0091] Optionally, in this embodiment, as mentioned above, this application proposes a method for automatically generating a large amount of high-quality labeled training data (corresponding to N question-answer pairs labeled with question-answer parameters) by generating training data through an internal enterprise work order or similar system. The following describes the process of generating training data:

[0092] A complete work order process should include three parts: problem submission, problem response, and feedback rating. Figure 6 This is a schematic diagram of the work order process provided in the embodiments of this application, such as... Figure 6As shown, the inquirer initiates an initial work order carrying a "question text" using the system in the target scenario, asking relevant questions. After the respondent (possibly a technician in the target scenario) receives the initial work order, they answer the questions corresponding to the "question text" and edit the "answer text." Then, a reference work order carrying the "question text" and "answer text" is returned to the inquirer. The inquirer evaluates the "answer text" and obtains the target work order carrying the "question text," "answer text," and "rating text."

[0093] Figure 7 This is a schematic diagram illustrating the generation of candidate question information, candidate answer information, and candidate question-answer parameters for a target work order based on the embodiments of this application, as shown below. Figure 7 As shown, both the question text and the answer text are converted into vector representations using embedding and SIF weighted average word vectors. The rating text is then normalized to the range of (0, 1), thus obtaining the candidate question information for the target work order. Candidate answer information And candidate question-answer parameters (s).

[0094] Figure 8 This is a schematic diagram generated based on the candidate question information set, candidate answer information set, and candidate question-answer parameter set provided in the embodiments of this application, as shown below. Figure 8 As shown, each target work order corresponds to a set of (q, a, s), then the problem vector set formed by all work orders is represented as: The corresponding answer set and score set are (s1,s2,…,s n Then, the KNN clustering algorithm is used to cluster the problem vector set into smaller classes of different problems, such as... Cosine similarity is used during clustering to calculate the similarity between different question vectors. After clustering, each sub-cluster contains a set of questions, answers, and scores, such as... (s1,s2,…,s m A set of candidate problem information with corresponding relationships. Candidate answer information set and candidate question-answer parameter set (s1, s2, ..., s m The parameter set can be understood as a candidate parameter set. Here, m represents the total number of questions in the subclass, and t represents the index of the question class. Because different answers to the same type of question should be independent of the specific form of the question—that is, within a subclass, the same answer under different question vectors should have the same score—m can be derived from a subclass. 2The total training data for (q, a, s) is given. Let the total number of elements t be T. 70% of T is used as the training set to train the answer quality scoring model (i.e., the target scoring model mentioned above), and the remaining 30% is used as training data for the subsequent training of the large language model, thus obtaining the target question-answering model. In the process of obtaining the target question-answering model from the remaining 30% of the training data for the subsequent training of the large language model, only the sentence vector q of the question (i.e., the reference answer information) serves as the training input to the large language model. After the large language model outputs the answer vector a (i.e., the reference answer information), q and a are concatenated and resized, and then used as the input to the quality scoring model (i.e., the target question-answering model) to obtain the final score (i.e., the reference question-answering parameters). Since all processes are differentiable, backpropagation can be used directly to train the large language model end-to-end.

[0095] In an exemplary embodiment, the initial scoring model can be trained using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model, but not limited to the following steps: The i-th question-answer pair labeled with the first question-answer parameters is used to train the scoring model to be trained in the p-th round, where p is a positive integer greater than or equal to 1; the scoring model to be trained obtained in the (p-1)-th round of training outputs the question-answer parameter result of the i-th question-answer pair, where, when p equals 1, the scoring model to be trained in the (p-1)-th round is the initial scoring model that has not been trained; the first question-answer parameters labeled with the i-th question-answer pair and the question-answer parameter result are compared to obtain the value of the target loss function corresponding to the scoring model to be trained; if the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the scoring model to be trained in the (p-1)-th round of training are adjusted to obtain the scoring model to be trained in the p-th round of training; if the value of the target loss function meets the preset convergence condition, the training ends.

[0096] Optionally, in this embodiment, by comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained. The value of the target loss function may be, but is not limited to, based on the difference between the first question-and-answer parameters and the question-and-answer parameter results.

[0097] Optionally, in this embodiment, the question-answer parameter result is the question-answer parameter output by the scoring model to be trained based on the input question-answer pair. If the difference between the question-answer parameter result corresponding to the question-answer pair and the first question-answer parameter is less than the target difference, it can be regarded as the convergence of the target loss function of the scoring model to be trained.

[0098] In the technical solution provided in step S102 above, the target question answering model can output more flexible second answer information for the same second question information, that is, the second answer information is not a fixed template answer information, and the degree of matching between the second answer information and the second question information is greater than the degree of matching with the target.

[0099] In the technical solution provided in step S103 above, the target question information is any information collected in the target scene to represent the question, that is, the question to be answered collected in the target scene (which may be in the form of voice, text and images, etc.). The question is processed to obtain the target question information, and then the target question information is input into the target question answering model to obtain the target answer information corresponding to the target question information. Then, the target answer information is decoded and transformed, and the answer to the question to be answered is output and displayed.

[0100] It should be noted that the method for generating the target answer proposed in this application can be used to train a question-answering robot that can accurately answer various professional questions in various business fields, without requiring additional human or financial resources to purchase labeled data; training can be conducted using existing enterprise data. The robot obtained through this method can significantly reduce customer service manpower within an enterprise, allowing businesses to use robots to replace human staff or improve productivity in both corporate and internal business operations.

[0101] There are no hard restrictions on the large language model, the corresponding training method, or the embedding method in this application. The large language model can be chosen as long as it has a sufficiently large number of network parameters and text generation capabilities, and the embedding method can convert Chinese words and sentences into word vector representations. The scoring model used in this paper is the basic ResNet-128 network, but it can be replaced with other types of prediction models.

[0102] This application proposes a method for generating target answers. The question-answering robot trained by this method is no longer restricted by predetermined rules compared to the original traditional question-answering robot. Instead, it can learn relevant knowledge in the enterprise's professional field and provide answers similar to those of human customer service.

[0103] This application proposes a method for generating target answers. The data generated in this way has a quality close to that of human annotation, without requiring additional human and financial resources for data collection and annotation. A response quality scoring model is used to perform secondary optimization on a large language model. The trained response quality scoring model is then connected to the end of the large language model. End-to-end training is achieved by scoring the results generated by the large language model and backpropagating the scores.

[0104] The target answer generation method provided in this application, upon receiving target question information in a target scenario, uses a target question-and-answer model to generate target answer information corresponding to the target question information. The target scoring model participates in the training process of the target question-and-answer model. During the training of the initial question-and-answer model, reference question information input to the initial question-and-answer model and reference answer information output by the initial question-and-answer model based on the reference question information are input to the target scoring model to obtain reference question-and-answer parameters output by the target scoring model. The model parameters of the initial question-and-answer model are then adjusted based on the reference question-and-answer parameters to obtain the target question-and-answer model. Since the target scoring model uses labeled first question-and-answer parameters... The target question-answering model is trained using N question-answer pairs, where N is a positive integer greater than or equal to 2. Each question-answer pair consists of the first question and the first answer collected from the target scenario, which have a corresponding relationship. Therefore, the target scoring model can determine the degree of matching between the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information, i.e., the reference question-answering parameters. Adjusting the initial question-answering model according to the reference question-answering parameters to obtain the target question-answering model ensures that the degree of matching between the target answer information generated based on the target question information and the target question information is greater than the target matching degree. This solves the problem of low matching degree between the generated target answer and the corresponding question in related technologies. Thus, it achieves the technical effect of improving the matching degree between the generated target answer and the corresponding question.

[0105] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0106] This application also provides a target answer generation apparatus. It should be noted that the target answer generation apparatus of this application can be used to execute the target answer generation method provided in this application. The target answer generation apparatus provided in this application will be described below.

[0107] Figure 9 This is a schematic diagram of an apparatus for generating a target answer according to an embodiment of this application. Figure 9 As shown, the device includes:

[0108] Output module 902 is used to input the reference question information of the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is the first question information and the first answer information collected in the target scene that have a corresponding relationship.

[0109] The adjustment module 904 is used to adjust the model parameters of the initial question-answering model according to the reference question-answering parameters to obtain the target question-answering model, wherein the target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree;

[0110] The generation module 906 is used to generate target answer information corresponding to the target question information using the target question answering model when receiving target question information in the target scenario.

[0111] The target answer generation device provided in this application generates target answer information corresponding to the target question information by receiving target question information in a target scenario and using a target question-and-answer model. The target scoring model participates in the training process of the target question-and-answer model. During the training of the initial question-and-answer model, reference question information input to the initial question-and-answer model and reference answer information output by the initial question-and-answer model based on the reference question information are input to the target scoring model to obtain reference question-and-answer parameters output by the target scoring model. The model parameters of the initial question-and-answer model are then adjusted based on the reference question-and-answer parameters to obtain the target question-and-answer model. Since the target scoring model uses labeled first question-and-answer parameters... The target question-answering model is trained using N question-answer pairs, where N is a positive integer greater than or equal to 2. Each question-answer pair consists of the first question and the first answer collected from the target scenario, which have a corresponding relationship. Therefore, the target scoring model can determine the degree of matching between the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information, i.e., the reference question-answering parameters. Adjusting the initial question-answering model according to the reference question-answering parameters to obtain the target question-answering model ensures that the degree of matching between the target answer information generated based on the target question information and the target question information is greater than the target matching degree. This solves the problem of low matching degree between the generated target answer and the corresponding question in related technologies. Thus, it achieves the technical effect of improving the matching degree between the generated target answer and the corresponding question.

[0112] Optionally, in the target answer generation apparatus provided in this application embodiment, the output module includes:

[0113] A splicing unit is used to splice the reference question information and the reference answer information into a question-answer pair;

[0114] The input unit is used to input the question-answer pair into the target scoring model and obtain the question-answer parameters output by the target scoring model as the reference question-answer parameters.

[0115] Optionally, in the target answer generation apparatus provided in the embodiments of this application, the apparatus further includes:

[0116] The acquisition module is used to acquire a set of candidate parameter groups corresponding to the target scenario before inputting the question-answer pair into the target scoring model and obtaining the question-answer parameters output by the target scoring model as the reference question-answer parameters. The set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2. Each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships. The candidate question information in the candidate question information set represents a candidate question in the target scenario, the candidate answer information in the candidate answer information set represents a candidate answer to the candidate question, and the candidate question-answer parameters in the candidate question-answer parameter set represent the degree of matching between the candidate answer and the candidate question. The candidate question information included in the candidate question information sets in different candidate parameter groups represents different types of questions, while the candidate question information included in the candidate question information sets in the same candidate parameter group represents the same type of question.

[0117] A tagging module is used to generate N question-answer pairs labeled with the first question-answer parameters based on the candidate parameter set;

[0118] The training module is used to train the initial scoring model using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model.

[0119] Optionally, in the target answer generation apparatus provided in this application embodiment, the annotation generation module includes:

[0120] A combination unit is used to freely combine the candidate question information, the candidate answer information, and the candidate question-answer parameter in the same candidate parameter group in the candidate parameter group set to obtain N combinations, wherein each combination includes 1 candidate question information, 1 candidate answer information, and 1 candidate question-answer parameter;

[0121] The first generation unit is used to take the candidate question information in the same combination of N combinations as the first question information, the candidate answer information as the corresponding first answer information, and the candidate question-answer parameters as the first question-answer parameters, to obtain N question-answer pairs labeled with the first question-answer parameters.

[0122] Optionally, in the target answer generation apparatus provided in this application embodiment, the acquisition module includes:

[0123] The acquisition unit is used to acquire M target work orders from the target scene, where M is a positive integer greater than or equal to 2. The target work orders are used to record the questions, answers and question-answer parameters that have corresponding relationships in the target scene.

[0124] The second generation unit is used to generate a set of candidate parameter groups corresponding to the target scene based on the M target work orders.

[0125] Optionally, in the target answer generation apparatus provided in this application embodiment, the second generation unit is further configured to:

[0126] Extract the corresponding question text, answer text, and rating text from each of the M target work orders. The question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question.

[0127] The candidate question information is extracted from the question text of each target work order record, the candidate answer information is extracted from the answer text of each target work order record, and the candidate question-and-answer parameters are extracted from the rating text of each target work order record, to obtain M sets of candidate question information, candidate answer information and candidate question-and-answer parameters with corresponding relationships;

[0128] For the M groups of candidate question information that have a corresponding relationship, the candidate answer information and the M candidate question information in the candidate question and answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question;

[0129] Obtain the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each candidate question information set, and obtain the candidate answer information set and candidate question-answer parameter set corresponding to each candidate question information set;

[0130] A set of candidate question information, candidate answer information, and candidate question-answer parameter set that have a corresponding relationship is determined as a candidate parameter group, and the candidate parameter group set is obtained, where R is a positive integer greater than or equal to T.

[0131] Optionally, in the target answer generation apparatus provided in this application embodiment, the training module includes:

[0132] The training unit is configured to train the scoring model to be trained in the p-th round using the i-th question and answer labeled with the first question and answer parameters through the following steps:

[0133] The training model obtained through the (p-1)th round of training outputs the question-answer parameter results of the i-th question-answer pair, wherein when p equals 1, the training model obtained through the (p-1)th round of training is the initial scoring model that has not been trained.

[0134] By comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained;

[0135] If the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the training scoring model obtained in the (p-1)th training round are adjusted to obtain the training scoring model obtained in the pth training round.

[0136] Training ends when the value of the target loss function satisfies the preset convergence condition.

[0137] The device for generating the target answer includes a processor and a memory. The modules and units mentioned above are all stored in the memory as program units, and the processor executes the program units stored in the memory to achieve the corresponding functions.

[0138] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the matching degree between the generated target answer and the corresponding question.

[0139] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0140] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for generating the target answer.

[0141] This invention provides a processor for running a program, wherein the program executes a method for generating the target answer during runtime.

[0142] Figure 10 This is a schematic diagram of an electronic device according to an embodiment of this application, such as... Figure 10 As shown, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps:

[0143] The reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is a first question information and a first answer information with a corresponding relationship collected in the target scene.

[0144] The model parameters of the initial question-answering model are adjusted according to the reference question-answering parameters to obtain the target question-answering model. The target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree.

[0145] Upon receiving target question information from the target scenario, the target question-answering model is used to generate target answer information corresponding to the target question information.

[0146] Optionally, the processor described above may also perform the following steps when executing the program:

[0147] The reference question information and the reference answer information are concatenated into a question-answer pair;

[0148] The question-answer pair is input into the target scoring model, and the question-answer parameters output by the target scoring model are used as the reference question-answer parameters.

[0149] Optionally, the processor described above may also perform the following steps when executing the program:

[0150] Before inputting the question-answer pair into the target scoring model and obtaining the question-answer parameters output by the target scoring model as the reference question-answer parameters, a set of candidate parameter groups corresponding to the target scenario is obtained. The set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2. Each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships. The candidate question information in the candidate question information set is used to represent a candidate question in the target scenario. The candidate answer information in the candidate answer information set is used to represent a candidate answer to the candidate question. The candidate question-answer parameters in the candidate question-answer parameter set are used to represent the degree of matching between the candidate answer and the candidate question. The candidate question information included in the candidate question information sets in different candidate parameter groups is used to describe different types of questions, while the candidate question information included in the candidate question information sets in the same candidate parameter group is used to describe the same type of questions.

[0151] N question-answer pairs labeled with the first question-answer parameters are generated based on the candidate parameter set;

[0152] The initial scoring model is trained using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model.

[0153] Optionally, the processor described above may also perform the following steps when executing the program:

[0154] The candidate question information, candidate answer information, and candidate question-answer parameters that are in the same candidate parameter group in the candidate parameter group set are freely combined to obtain N combinations, wherein each combination includes 1 candidate question information, 1 candidate answer information, and 1 candidate question-answer parameter;

[0155] The candidate question information in the same combination among N combinations is taken as the first question information, the candidate answer information is taken as the corresponding first answer information, and the candidate question-answer parameters are taken as the first question-answer parameters, thus obtaining N question-answer pairs labeled with the first question-answer parameters.

[0156] Optionally, the processor described above may also perform the following steps when executing the program:

[0157] M target work orders are collected from the target scenario, where M is a positive integer greater than or equal to 2. The target work orders are used to record the questions, answers and question-answer parameters that have corresponding relationships in the target scenario.

[0158] Generate a set of candidate parameter groups corresponding to the target scenario based on M target work orders.

[0159] Optionally, the processor described above may also perform the following steps when executing the program:

[0160] Extract the corresponding question text, answer text, and rating text from each of the M target work orders. The question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question.

[0161] The candidate question information is extracted from the question text of each target work order record, the candidate answer information is extracted from the answer text of each target work order record, and the candidate question-and-answer parameters are extracted from the rating text of each target work order record, to obtain M sets of candidate question information, candidate answer information and candidate question-and-answer parameters with corresponding relationships;

[0162] For the M groups of candidate question information that have a corresponding relationship, the candidate answer information and the M candidate question information in the candidate question and answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question;

[0163] Obtain the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each candidate question information set, and obtain the candidate answer information set and candidate question-answer parameter set corresponding to each candidate question information set;

[0164] A set of candidate question information, candidate answer information, and candidate question-answer parameter set that have a corresponding relationship is determined as a candidate parameter group, and the candidate parameter group set is obtained, where R is a positive integer greater than or equal to T.

[0165] Optionally, the processor described above may also perform the following steps when executing the program:

[0166] The following steps are used to train the scoring model to be trained in the p-th round using the i-th question and answer labeled with the first question and answer parameters, where p is a positive integer greater than or equal to 1:

[0167] The training model obtained through the (p-1)th round of training outputs the question-answer parameter results of the i-th question-answer pair, wherein when p equals 1, the training model obtained through the (p-1)th round of training is the initial scoring model that has not been trained.

[0168] By comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained;

[0169] If the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the training scoring model obtained in the (p-1)th training round are adjusted to obtain the training scoring model obtained in the pth training round.

[0170] Training ends when the value of the target loss function satisfies the preset convergence condition.

[0171] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0172] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps:

[0173] The reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is a first question information and a first answer information with a corresponding relationship collected in the target scene.

[0174] The model parameters of the initial question-answering model are adjusted according to the reference question-answering parameters to obtain the target question-answering model. The target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree.

[0175] Upon receiving target question information from the target scenario, the target question-answering model is used to generate target answer information corresponding to the target question information.

[0176] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0177] The reference question information and the reference answer information are concatenated into a question-answer pair;

[0178] The question-answer pair is input into the target scoring model, and the question-answer parameters output by the target scoring model are used as the reference question-answer parameters.

[0179] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0180] Before inputting the question-answer pair into the target scoring model and obtaining the question-answer parameters output by the target scoring model as the reference question-answer parameters, a set of candidate parameter groups corresponding to the target scenario is obtained. The set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2. Each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships. The candidate question information in the candidate question information set is used to represent a candidate question in the target scenario. The candidate answer information in the candidate answer information set is used to represent a candidate answer to the candidate question. The candidate question-answer parameters in the candidate question-answer parameter set are used to represent the degree of matching between the candidate answer and the candidate question. The candidate question information included in the candidate question information sets in different candidate parameter groups is used to describe different types of questions, while the candidate question information included in the candidate question information sets in the same candidate parameter group is used to describe the same type of questions.

[0181] N question-answer pairs labeled with the first question-answer parameters are generated based on the candidate parameter set;

[0182] The initial scoring model is trained using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model.

[0183] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0184] The candidate question information, candidate answer information, and candidate question-answer parameters that are in the same candidate parameter group in the candidate parameter group set are freely combined to obtain N combinations, wherein each combination includes 1 candidate question information, 1 candidate answer information, and 1 candidate question-answer parameter;

[0185] The candidate question information in the same combination among N combinations is taken as the first question information, the candidate answer information is taken as the corresponding first answer information, and the candidate question-answer parameters are taken as the first question-answer parameters, thus obtaining N question-answer pairs labeled with the first question-answer parameters.

[0186] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0187] M target work orders are collected from the target scenario, where M is a positive integer greater than or equal to 2. The target work orders are used to record the questions, answers and question-answer parameters that have corresponding relationships in the target scenario.

[0188] Generate a set of candidate parameter groups corresponding to the target scenario based on M target work orders.

[0189] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0190] Extract the corresponding question text, answer text, and rating text from each of the M target work orders. The question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question.

[0191] The candidate question information is extracted from the question text of each target work order record, the candidate answer information is extracted from the answer text of each target work order record, and the candidate question-and-answer parameters are extracted from the rating text of each target work order record, to obtain M sets of candidate question information, candidate answer information and candidate question-and-answer parameters with corresponding relationships;

[0192] For the M groups of candidate question information that have a corresponding relationship, the candidate answer information and the M candidate question information in the candidate question and answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question;

[0193] Obtain the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each candidate question information set, and obtain the candidate answer information set and candidate question-answer parameter set corresponding to each candidate question information set;

[0194] A set of candidate question information, candidate answer information, and candidate question-answer parameter set that have a corresponding relationship is determined as a candidate parameter group, and the candidate parameter group set is obtained, where R is a positive integer greater than or equal to T.

[0195] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute a program that initializes the following method steps:

[0196] The following steps are used to train the scoring model to be trained in the p-th round using the i-th question and answer labeled with the first question and answer parameters, where p is a positive integer greater than or equal to 1:

[0197] The training model obtained through the (p-1)th round of training outputs the question-answer parameter results of the i-th question-answer pair, wherein when p equals 1, the training model obtained through the (p-1)th round of training is the initial scoring model that has not been trained.

[0198] By comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained;

[0199] If the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the training scoring model obtained in the (p-1)th training round are adjusted to obtain the training scoring model obtained in the pth training round.

[0200] Training ends when the value of the target loss function satisfies the preset convergence condition.

[0201] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0202] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0203] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0204] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0205] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0206] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0207] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0208] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0209] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0210] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for generating a target answer, characterized in that, include: The reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information are input to the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is a first question information and a first answer information with a corresponding relationship collected in the target scene. The model parameters of the initial question-answering model are adjusted according to the reference question-answering parameters to obtain the target question-answering model. The target question-answering model is used to output the corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree. Upon receiving target question information from the target scenario, the target question-answering model is used to generate target answer information corresponding to the target question information. The process of inputting reference question information into an initial question-answering model and reference answer information output by the initial question-answering model based on the reference question information into a target scoring model to obtain reference question-answer parameters output by the target scoring model includes: concatenating the reference question information and the reference answer information into a question-answer pair; inputting the question-answer pair into the target scoring model to obtain question-answer parameters output by the target scoring model as the reference question-answer parameters; Before inputting the question-answer pairs into the target scoring model to obtain the question-answer parameters output by the target scoring model as the reference question-answer parameters, the method further includes: obtaining a set of candidate parameter groups corresponding to the target scene, wherein the set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2, each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships, the candidate question information in the candidate question information set is used to represent a candidate question in the target scene, the candidate answer information in the candidate answer information set is used to represent a candidate answer to the candidate question, and the candidate question-answer parameters in the candidate question-answer parameter set are used to represent the degree of matching between the candidate answer and the candidate question; the candidate question information included in the candidate question information sets in different candidate parameter groups is used to describe different types of questions, and the candidate question information included in the candidate question information sets in the same candidate parameter group is used to describe the same type of questions; generating N question-answer pairs labeled with the first question-answer parameters according to the set of candidate parameter groups; and training the initial scoring model using the N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model; Before inputting the reference question information of the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answer parameters output by the target scoring model, the method further includes: splitting the document in the target scenario into paragraphs to obtain multiple original paragraphs; for each original paragraph, replacing some words in the original paragraph with whitespace characters to obtain a replaced paragraph, resulting in multiple original paragraphs and replaced paragraphs with corresponding relationships; determining each original paragraph and replaced paragraph with corresponding relationships as a set of training data to obtain multiple sets of training data; and training the language model using the multiple sets of training data by predicting words at the whitespace characters to obtain the initial question-answering model.

2. The method according to claim 1, characterized in that, The step of generating N question-answer pairs labeled with the first question-answer parameters based on the candidate parameter set includes: The candidate question information, candidate answer information, and candidate question-answer parameters that are in the same candidate parameter group in the candidate parameter group set are freely combined to obtain N combinations, wherein each combination includes 1 candidate question information, 1 candidate answer information, and 1 candidate question-answer parameter; The candidate question information in the same combination among N combinations is taken as the first question information, the candidate answer information is taken as the corresponding first answer information, and the candidate question-answer parameters are taken as the first question-answer parameters, thus obtaining N question-answer pairs labeled with the first question-answer parameters.

3. The method according to claim 1, characterized in that, The step of obtaining the candidate parameter set corresponding to the target scene includes: M target work orders are collected from the target scenario, where M is a positive integer greater than or equal to 2. The target work orders are used to record the questions, answers and question-answer parameters that have corresponding relationships in the target scenario. Generate a set of candidate parameter groups corresponding to the target scenario based on M target work orders.

4. The method according to claim 3, characterized in that, The step of generating a set of candidate parameter groups corresponding to the target scenario based on M target work orders includes: Extract the corresponding question text, answer text, and rating text from each of the M target work orders. The question text records a question in the target scenario, the answer text records the answer to the corresponding question, and the rating text indicates the degree of matching between the answer and the question. The candidate question information is extracted from the question text of each target work order record, the candidate answer information is extracted from the answer text of each target work order record, and the candidate question-and-answer parameters are extracted from the rating text of each target work order record, to obtain M sets of candidate question information, candidate answer information and candidate question-and-answer parameters with corresponding relationships; For the M groups of candidate question information that have a corresponding relationship, the candidate answer information and the M candidate question information in the candidate question and answer parameters are clustered into R sets of candidate question information, wherein the candidate question information in each set of candidate question information is used to describe the same type of question; Obtain the candidate answer information and candidate question-answer parameters corresponding to each candidate question information in each candidate question information set, and obtain the candidate answer information set and candidate question-answer parameter set corresponding to each candidate question information set; A set of candidate question information, candidate answer information, and candidate question-answer parameter set that have a corresponding relationship is determined as a candidate parameter group, and the candidate parameter group set is obtained, where R is a positive integer greater than or equal to T.

5. The method according to claim 1, characterized in that, The step of training the initial scoring model using N question-answer pairs labeled with the first question-answer parameters to obtain the target scoring model includes: The following steps are used to train the scoring model to be trained in the p-th round using the i-th question and answer labeled with the first question and answer parameters, where p is a positive integer greater than or equal to 1: The training model obtained through the (p-1)th round of training outputs the question-answer parameter results of the i-th question-answer pair, wherein when p equals 1, the training model obtained through the (p-1)th round of training is the initial scoring model that has not been trained. By comparing the first question-and-answer parameters and the question-and-answer parameter results labeled in the i-th question-and-answer pair, the value of the target loss function corresponding to the scoring model to be trained is obtained; If the value of the target loss function does not meet the preset convergence condition, the scoring parameters in the training scoring model obtained in the (p-1)th training round are adjusted to obtain the training scoring model obtained in the pth training round. Training ends when the value of the target loss function satisfies the preset convergence condition.

6. A device for generating a target answer, characterized in that, include: The output module is used to input the reference question information of the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answer parameters output by the target scoring model. The reference question-answer parameters are used to indicate the degree of matching between the reference question information and the reference answer information. The reference question information is used to indicate the questions collected in the target scene. The target scoring model is trained using N question-answer pairs labeled with the first question-answer parameters, where N is a positive integer greater than or equal to 2. Each question-answer pair is the first question information and the first answer information collected in the target scene that have a corresponding relationship. An adjustment module is used to adjust the model parameters of the initial question-answering model according to the reference question-answering parameters to obtain a target question-answering model, wherein the target question-answering model is used to output corresponding second answer information for the input second question information, and the matching degree between the second answer information and the second question information is greater than the target matching degree; The generation module is used to generate target answer information corresponding to the target question information using the target question answering model when receiving target question information in the target scenario; The output module includes: a splicing unit for splicing the reference question information and the reference answer information into a question-answer pair; and an input unit for inputting the question-answer pair into the target scoring model to obtain the question-answer parameters output by the target scoring model as the reference question-answer parameters. The device further includes: an acquisition module, configured to acquire a set of candidate parameter groups corresponding to the target scenario before inputting the question-answer pair into the target scoring model and obtaining the question-answer parameters output by the target scoring model as the reference question-answer parameters, wherein the set of candidate parameter groups includes T candidate parameter groups, where T is a positive integer greater than or equal to 2, and each candidate parameter group includes a set of candidate question information, a set of candidate answer information, and a set of candidate question-answer parameters with corresponding relationships, wherein the candidate question information in the set of candidate question information is used to represent a candidate question in the target scenario, and the candidate answer information in the set of candidate answer information is used to represent a candidate question in the target scenario. The candidate question and answer parameter set represents the candidate answer to the candidate question. The candidate question and answer parameter set is used to represent the degree of matching between the candidate answer and the candidate question. The candidate question information set in different candidate parameter sets is used to describe different types of questions, and the candidate question information set in the same candidate parameter set is used to describe the same type of questions. The annotation generation module is used to generate N question and answer pairs annotated with the first question and answer parameter according to the candidate parameter set. The training module is used to train the initial scoring model using the N question and answer pairs annotated with the first question and answer parameter to obtain the target scoring model. The device is further configured to, before inputting the reference question information input to the initial question-answering model and the reference answer information output by the initial question-answering model based on the reference question information into the target scoring model to obtain the reference question-answering parameters output by the target scoring model, split the document in the target scenario into paragraphs to obtain multiple original paragraphs; for each original paragraph, replace some words in the original paragraph with whitespace characters to obtain a replaced paragraph, thus obtaining multiple original paragraphs and replaced paragraphs with corresponding relationships; determine each original paragraph and replaced paragraph with corresponding relationships as a set of training data to obtain multiple sets of training data; and train the language model using the multiple sets of training data by predicting the words at the whitespace characters to obtain the initial question-answering model.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 5.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 5 through the computer program.